-
Notifications
You must be signed in to change notification settings - Fork 532
Grammar for tuple and tuple indexing expressions #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. A couple of suggestions.
src/expressions/tuple-expr.md
Outdated
@@ -22,6 +29,10 @@ comma: | |||
|
|||
## Tuple indexing expressions | |||
|
|||
> **<sup>Syntax</sup>** | |||
> _TupleIndexingExpression_ : | |||
> [_Expression_] `.` [INTEGER_LITERAL] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be TUPLE_INDEX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. That's correct, but it's like the lexer is aware of context... which is strange. But yeah, the parser is the one that disallows prefixes, suffixes and nonzero numbers beginning in zero.
src/expressions/tuple-expr.md
Outdated
> `(` `)` | ||
> | `(` [_Expression_] `,` `)` | ||
> | `(` [_Expression_] (`,` [_Expression_] )<sup>\+</sup> | ||
> `,`<sup>?</sup> `)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two can be merged into `(` [_Expression_] `,` `)` <sup>\+</sup> [_Expression_]<sup>?</sup> `)`
- use the TUPLE_INDEX token - compacted the TupleExpression
Thanks again. 💟 |
No description provided.