Open scharf opened 11 years ago
the following strings are valid coffeesctipt (and javascript string):
s="\W" s="\z" s="\="
Javascript ignores any \ that is used for characters that are not expected.
Here is my proposal for a better string rule in xtext:
terminal STRING: "'''" -> "'''" | "'" ( (!("'"|'\\') | ('\\' !('\n' | '\r'))) ('\\' !('\n' | '\r') | !('\\'|"'"))*)? "'" | '"""' -> '"""' | '"' ( (!('"'|'\\') | ('\\' !('\n' | '\r'))) ('\\' !('\n' | '\r') | !('\\'|'"'))*)? '"';
It would be nice to get a warning if an unexpected character is used in a string. But is should not fail to parse the rest of the file....
It would be nice to issue an (optional) warning if the character after a \ is not in the list of meaningful characters:
('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\')
the following strings are valid coffeesctipt (and javascript string):
Javascript ignores any \ that is used for characters that are not expected.
Here is my proposal for a better string rule in xtext:
It would be nice to get a warning if an unexpected character is used in a string. But is should not fail to parse the rest of the file....
It would be nice to issue an (optional) warning if the character after a \ is not in the list of meaningful characters: