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

Comparing against a single backslash breaks parsing of rest of conditional #280

Open
vpzomtrrfrt opened this issue Nov 16, 2021 · 2 comments

Comments

@vpzomtrrfrt
Copy link
Member

foo same '\\' or foo same 'b'

gives

foo === '\\' or foo same 'b'

rather than the expected:

foo === '\\' || foo === 'b'

Seems to be specific to comparisons against '\\', as it works otherwise

@AnEmortalKid
Copy link
Member

Aight, this has to do with the tokenizer:

image

This is a good test case, I'll tackle this and see if i can squash this down.

@AnEmortalKid
Copy link
Member

AnEmortalKid commented Apr 29, 2022

So I took a peak at this and there’s a couple of problems:

1 -the way we handled escapes wasn’t very good and should be rewritten.
2- from testing, I believe what happens when we consume the source is we get‘\', somehow from the file it already escaped the \\ to .

I need to do some more testing on just trying to read escaped sequences from a file and NOT escaping so the literal values include \\.

Ill take another peek at this and at a minimum fix the way lexemes are broken up.

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

2 participants