New tokens and bug fix#34
Draft
Pacsfury wants to merge 6 commits into
Draft
Conversation
Refactor string handling and identifier kind lookup in lexer.
To rerun Ci
Add new tokens and fix bug
Contributor
|
Thank you for the contribution, but the lexer is going through some massive changes right now, could you readd those tokens once it's finished? Sorry. (Check pr #33 ) |
Contributor
Author
|
Ok. I will convert this to draft until PR #33 is merged and I will readd everything |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add compound assignment, increment/decrement, and shift operators to the lexer
Summary
Extends the lexer to recognize compound assignment operators, increment/decrement operators, and bitwise shift operators, which were previously unsupported. Also fixes an unterminated string literal bug where a missing closing quote followed by a newline was silently accepted instead of raising a diagnostic.
Changes
token.hpptoken_kindenumerators:plus_equal,minus_equal,star_equal,slash_equal,modulo_equal,caret_equal,pipe_equal,ampersand_equalplus_plus,minus_minusless_less,greater_greatertoken_kind_to_string.lexer.cppscan_tokento recognize the new operators viamatch()chains (e.g.+=before++before+), covering:+,-,*,/,%,^,|,&compound assignment forms++,--<<,>>string(): unterminated string detection now also triggers when a newline is hit before the closing", not just at EOF. Previously this case fell through and silently consumed the newline as if it were the closing quote, producing a corrupted token with no diagnostic.