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

Incorrect processing of C/C++ escape-sequence in character constant #14

Open
Derek-Jones opened this issue Oct 11, 2024 · 2 comments
Open

Comments

@Derek-Jones
Copy link

The C/C++ escape-sequence in the character constant '\' is incorrectly processed, leading to the characters up to any following single-quote being treated as a single token

a == '\\' && b == '|'
(a, TokenType.IDENTIFIER, (1, 1))
(==, TokenType.OPERATOR, (1, 3))
(', TokenType.SPECIAL_SYMBOL, (1, 6))
(\\' && b == , TokenType.CONSTANT, (1, 7))
(', TokenType.SPECIAL_SYMBOL, (1, 19))
(|, TokenType.OPERATOR, (1, 20))
(', TokenType.SPECIAL_SYMBOL, (1, 21))
@Dec1mo
Copy link
Collaborator

Dec1mo commented Oct 13, 2024

Thanks for informing us this bug, Derek.
Unfortunately, we no longer maintain this repository. But we do welcome contributions, so you might make a PR to fix this error. Cheers!

@Derek-Jones
Copy link
Author

I looked at the source, and it looks like a fix would involve lots of reorganizing. So not keen to attempt a fix.

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