I implemented double quote escape in commit c61a99f, but this is still incomplete: It is currently impossible to have a single backslash at the end of the string:
"foo\" can't be written as the \ escapes the ". "foo\\" is okay but the result would be foo\\, not foo\.
I prefer to have Java escape semantics (backslash needs to be always escaped) but don't know whether this will break anything.
The alternative would be to interpret \\ as \ and also interpret \ as \, unless it is in front of either \ or ". I have the code for that and could implement it, but this rule is kind of non-standard and could confuse people.
Java enforces backslashes to be escaped an will throw an error otherwise. Should we do the same or be more lenient?
I implemented double quote escape in commit c61a99f, but this is still incomplete: It is currently impossible to have a single backslash at the end of the string:
"foo\"
can't be written as the\
escapes the"
."foo\\"
is okay but the result would befoo\\
, notfoo\
.I prefer to have Java escape semantics (backslash needs to be always escaped) but don't know whether this will break anything.
The alternative would be to interpret
\\
as\
and also interpret\
as\
, unless it is in front of either\
or"
. I have the code for that and could implement it, but this rule is kind of non-standard and could confuse people.Java enforces backslashes to be escaped an will throw an error otherwise. Should we do the same or be more lenient?