fix: add OPEN to keyword rule for enum value parsing#174
fix: add OPEN to keyword rule for enum value parsing#174engalar wants to merge 1 commit intomendixlabs:mainfrom
Conversation
…rectly OPEN was defined as a lexer token (for OPEN USER TASK, OPEN WORKFLOW) but missing from the parser's keyword rule, causing 3-part enum values like Module.ENUM_IssueStatus.Open to fail parsing in CREATE/CHANGE statements within microflow bodies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ako
left a comment
There was a problem hiding this comment.
Surgical, correct fix. The diagnosis is right — OPEN was added as a lexer token in #159 but never wired into the keyword rule, breaking enum values like Module.ENUM_Status.Open. This is exactly the friction I flagged in the #159 review about common-word tokens.
Concerns
Test plan boxes are unchecked. [ ] Existing tests still pass and [ ] OPEN USER TASK syntax unaffected should be verified before merge. The change is generally safe (allows OPEN as identifier in identifier-position contexts) but worth confirming.
No regression test added. A doctype-test with an enum value named Open would prevent regression — even one line in an existing test file would do it.
Same class of issue likely affects other tokens from #159. That PR added DATA, RECORDS, NOTIFY, PAUSE, UNPAUSE, ABORT, RETRY, RESTART, LOCK, UNLOCK, REASON — common words that could appear as enum values, attribute names, etc. I'd recommend either:
- Adding all of them to the
keywordrule in this PR (zero risk, broad coverage) - Filing a follow-up to audit and add regression tests
LGTM for the immediate fix.
Summary
OPENwas a lexer token (used byOPEN USER TASK,OPEN WORKFLOW) but missing from the parser'skeywordruleModule.ENUM_IssueStatus.Opento fail parsing inCREATE/CHANGEstatements within microflow bodiesOPENto the keyword alternatives inMDLParser.g4line 3592Reproduction
Before:
line 6:47 mismatched input '.' expecting ')'After:
Syntax OKTest plan
mxcli checkpasses for enum values withOpen(previously reserved keyword)OPEN USER TASKandOPEN WORKFLOWsyntax unaffected🤖 Generated with Claude Code