This fixes a bug in escapeChar with char literal \ (backslash). It currently generates '\' which makes the whole file syntactically wrong because the ending quote is escaped. This generates '\\' instead.
I also added \t and \n to keep escapeChar consistent with escape.
Another possibility: add the single quote ' to the characters escaped in escape, and make escapeChar simply call escape after transforming the Char to a String:
This fixes a bug in
escapeChar
with char literal\
(backslash). It currently generates'\'
which makes the whole file syntactically wrong because the ending quote is escaped. This generates'\\'
instead.I also added
\t
and\n
to keepescapeChar
consistent withescape
.Another possibility: add the single quote
'
to the characters escaped inescape
, and makeescapeChar
simply callescape
after transforming the Char to a String:See also https://github.com/stil4m/elm-syntax/pull/125/files and https://github.com/stil4m/elm-syntax/issues/124