parsley
parsley copied to clipboard
Rename comment{Start,End} to multiLineComment{Start,End}, disallow newline characters in comment{Start,End}
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 examplemultiLineComment{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.