Skip to content

Commit

Permalink
Fix grammar for tuple expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
federicobond committed Jun 19, 2017
1 parent 26ea9ce commit 1e3b45d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/grammar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ Expression =
| Expression '||' Expression
| Expression '?' Expression ':' Expression
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
| Expression? (',' Expression)
| PrimaryExpression

PrimaryExpression = Identifier
| BooleanLiteral
| NumberLiteral
| HexLiteral
| StringLiteral
| TupleExpression
| ElementaryTypeNameExpression

ExpressionList = Expression ( ',' Expression )*
Expand All @@ -120,6 +120,9 @@ Identifier = [a-zA-Z_$] [a-zA-Z_$0-9]*
HexNumber = '0x' [0-9a-fA-F]+
DecimalNumber = [0-9]+

TupleExpression = '(' ( Expression ( ',' Expression )* )? ')'
| '[' ( Expression ( ',' Expression )* )? ']'

ElementaryTypeNameExpression = ElementaryTypeName

ElementaryTypeName = 'address' | 'bool' | 'string' | 'var'
Expand Down

0 comments on commit 1e3b45d

Please sign in to comment.