Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decide on string escape handling for backslashes #50

Open
akoehn opened this issue Jul 16, 2019 · 0 comments
Open

Decide on string escape handling for backslashes #50

akoehn opened this issue Jul 16, 2019 · 0 comments

Comments

@akoehn
Copy link
Contributor

akoehn commented Jul 16, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant