feat: supports a.b.c variables and refactor lexer/parser#693
Open
killme2008 wants to merge 1 commit intomasterfrom
Open
feat: supports a.b.c variables and refactor lexer/parser#693killme2008 wants to merge 1 commit intomasterfrom
killme2008 wants to merge 1 commit intomasterfrom
Conversation
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances AviatorScript's variable syntax by enabling direct property access notation (e.g., a.b.c) without requiring the # quote prefix, and performs a comprehensive refactoring of the lexer and parser for improved clarity and maintainability.
Key Changes:
- Added support for dotted property access notation (
a.b.c) and array index syntax (foo.bars[0].name) without the#prefix - Refactored parser methods with descriptive names (e.g.,
ternary()→parseTernary(),expr()→parseAdditive()) - Restructured lexer scanning logic into separate methods (
scanNumber(),scanVariable(),scanString(), etc.) for better modularity
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| QuoteVarTest.java | Added tests for property access without quote prefix, including priority behavior when both full key and property chain exist |
| ExpressionLexerUnitTest.java | Added lexer unit tests for scanning dotted variables with array indices |
| ExpressionParser.java | Renamed parser methods to be more descriptive, added comprehensive operator precedence documentation, added memory limit for token history, fixed typos |
| Variable.java | Added utility methods isKeyword() and isLiteralKeyword() to identify reserved variable tokens |
| OperatorType.java | Enhanced documentation with operator categorization and clarifying comments about token semantics |
| DelegateToken.java | Fixed typo: Ternay_End → Ternary_End |
| ExpressionLexer.java | Refactored monolithic scan method into separate scanner methods per token type, improved documentation, optimized character lookup using String.indexOf() |
| OptimizeCodeGenerator.java | Fixed typo: Ternay_End → Ternary_End |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Close #565
Close #529
a.b.cvariable directly instead of#a.b.cquote variable