bugfix(parser): Improved missing comma diag. - #10063
Conversation
PR SummaryLow Risk Overview The parser now passes Reviewed by Cursor Bugbot for commit 981228d. Bugbot is set up for automated code reviews on this repo. Configure here. |
TomerStarkware
left a comment
There was a problem hiding this comment.
@TomerStarkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on eytan-starkware).

Summary
Fixes the diagnostic message for a missing comma in single-element tuple expressions. The
ParserDiagnosticKind::MissingTokenwas referencingSyntaxKind::TokenCommainstead ofSyntaxKind::TerminalComma, which caused the error message to displayMissing token TokenComma.instead of the human-readableMissing token ','.Type of change
Please check one:
Why is this change needed?
The diagnostic emitted when a single-element tuple is missing its trailing comma was referencing the wrong
SyntaxKindvariant (TokenCommainstead ofTerminalComma). This caused the error message to expose an internal token kind name rather than the expected human-readable punctuation character.What was the behavior or documentation before?
When writing a single-element tuple without a trailing comma (e.g.,
(felt252)), the parser emitted:What is the behavior or documentation after?
The parser now correctly emits:
Related issue or discussion (if any)
N/A
Additional context
N/A