-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
The documentation says Branescript allows array indexing in C style manner: foo[0].
However, looking at the formal definition, that seems to be not the case.
Expressions are defined as:
Expr ::= LPAREN Expr RPAREN
| Expr BinOp Expr
| UnaOp Expr
| Array | ArrayIndex | Call | IDENT | Instance | Literal
| Projection
This does contain Array and ArrayIndex, but array is a definition of an array, not the usage of an identifier (variable) that points to / contains an array.
ArrayIndex suffers the same fate as it is prefixed with: Array itself: ArrayIndex ::= Array LBRACKET Expr RBRACKET
Proposed solutions:
We either have to change identifiers such that identifiers can be indexed by default, or we have to change ArrayIndex to be:
ArrayIndex ::= Array LBRACKET Expr RBRACKET | IDENT LBRACKET Expr RBRACKET\
The latter seems better to me in this case. @Lut99 Let me know what you think.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation