fix: add 168 missing lexer tokens to keyword rule#186
Open
engalar wants to merge 1 commit intomendixlabs:mainfrom
Open
fix: add 168 missing lexer tokens to keyword rule#186engalar wants to merge 1 commit intomendixlabs:mainfrom
engalar wants to merge 1 commit intomendixlabs:mainfrom
Conversation
The keyword rule in MDLParser.g4 allows lexer tokens to be used as identifiers (entity names, attribute names, enum values). Many tokens were missing, causing parse failures when user-defined names matched keywords like Data, Filter, Match, Empty, Open, Container, etc. This adds all word-type lexer tokens to the keyword rule, organized by category with alphabetical ordering for easy auditing. Also removes duplicate entries (STRUCTURES, PAGING, EXECUTE) and a phantom UI token.
AI Code ReviewWhat Looks Good
RecommendationApprove. This PR successfully resolves the parsing issue by adding missing tokens to the keyword rule, improves maintainability through reorganization and deduplication, and provides adequate test coverage. The scoped change appropriately addresses the foundation layer without requiring modifications to other pipeline components since it fixes core parsing functionality. No changes are needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
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.
Summary
keywordrule inMDLParser.g4allows lexer tokens to be used as identifiers (entity/attribute/enum names viaqualifiedName). 168 word-type tokens were missing, causing parse failures when user-defined names matched keywords likeData,Filter,Match,Empty,Open,Container,Node,Activity, etc.STRUCTURES,PAGING,EXECUTE) and 1 phantom token (UI)Before
After
Scope
Only the
keywordrule inMDLParser.g4changed (+ regenerated parser files). No executor, visitor, or AST changes.Follow-up from PR #174 code review which identified this systemic gap.
Test plan
make test— all tests pass (including previously failingTestQuotedIdentifierInWidgetAttributeandTestShowPageMicroflowStyleArgsInWidgetwhich were broken during development by accidentally droppingLAYOUT)comm -23)uniq -d)