Open blikjeham opened 7 years ago
The multiline_indicator regex is '\\\\(\s*#.*)?\n'. This would allow a comment after a backslash used for explicit line joining, like:
'\\\\(\s*#.*)?\n'
if a == b \ # a equals b and b == c: pass
The above is not valid python syntax:
A line ending in a backslash cannot carry a comment. https://docs.python.org/3/reference/lexical_analysis.html#explicit-line-joining
A line ending in a backslash cannot carry a comment.
Even worse, the multiline_indicator regex also sees a line continuation with comment in the following regex from HamlPy:
'(?P<id>\#[\w-]*)?'
This breaks minifying code with similar regexes.
I think the multiline_indicator should only look for lines ending in only a backslash (and perhaps some whitespace).
The multiline_indicator regex is
'\\\\(\s*#.*)?\n'
. This would allow a comment after a backslash used for explicit line joining, like:The above is not valid python syntax:
Even worse, the multiline_indicator regex also sees a line continuation with comment in the following regex from HamlPy:
This breaks minifying code with similar regexes.
I think the multiline_indicator should only look for lines ending in only a backslash (and perhaps some whitespace).