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

Backslash escapes quotation mark even when escaped. #32

Open
kckennylau opened this issue Aug 14, 2016 · 3 comments
Open

Backslash escapes quotation mark even when escaped. #32

kckennylau opened this issue Aug 14, 2016 · 3 comments
Labels

Comments

@kckennylau
Copy link

"\" gets treated as quotation, but even "\\" gets treated as quotation.

@JCumin
Copy link
Owner

JCumin commented Aug 16, 2016

@kckennylau Both "\" and "\\" are incorrect syntax, even though TIO doesn't print an error for it (which it should). So I don't see how you saw it get treated as quotation.

Though I now realize that the string "" isn't typable (because \ only escapes "). I might change it so that " escapes ".

@kckennylau
Copy link
Author

@JCumin
Copy link
Owner

JCumin commented Aug 22, 2016

@kckennylau This is extremely annoying to fix because TIO reads the input from a file, and in the offline intrepreter you can input a string in an atom (single quotes) or directly as a term too. Those three scenarios all have different escaping rules: in the file, no escaping is performed before I get to parse it, in an atom \" is escaped as " like a normal ", and in a string term it escapes as expected with backslashes.

@JCumin JCumin added the grammar label Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants