parsley icon indicating copy to clipboard operation
parsley copied to clipboard

Rename comment{Start,End} to multiLineComment{Start,End}, disallow newline characters in comment{Start,End}

Open stefanradziuk opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

The parsley.token.descriptions.SpaceDesc params commentStart and commentEnd should more clearly indicate that they are intended for multiline comments. With current naming you might try to define Wacc/Python-style comments as:

commentStart = "#",
commentEnd = "\n",

However, this should instead be defined using commentLine = "#".

Additionally, including \n in commentEnd in this case essentially causes comment lines to be discarded when calculating token positions.

Describe the solution you'd like

  • comment{Start,End} should be named more descriptively, for example multiLineComment{Start,End}.
  • Either position calculation should be fixed for comment{Start,End} containing \n, or this behaviour should be documented and produce a warning / error.

stefanradziuk avatar Feb 10 '23 12:02 stefanradziuk