rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Free newlines in string constants without margin character

Open jurgenvinju opened this issue 1 year ago • 0 comments

#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.

jurgenvinju avatar Nov 18 '24 08:11 jurgenvinju