rascal
rascal copied to clipboard
Free newlines in string constants without margin character
#2079 triggered this.
lexical StringCharacter
= "\\" [\" \' \< \> \\ b f n r t]
| UnicodeEscape
| ![\" \' \< \> \\]
| [\n][\ \t \u00A0 \u1680 \u2000-\u200A \u202F \u205F \u3000]* [\'] // margin
;
Proposal to change ![\" \' \< \> \\] to ![\" \' \< \> \\ \n] such that every newline in a string constant requires a margin continuation character.
This would not be backward compatible, but 99% of the cases already use this and for the other 1% it is a bug. If you don't want to end your template with a new line you can close the string constant with a " on the previous line.
Without this parse error issue like the referenced one pop-up unnoticed.