Fix grammar for tuple expressions

This commit is contained in:
Federico Bond 2017-06-19 17:16:45 -03:00
parent 26ea9ce07c
commit 1e3b45d61e

View File

@ -88,7 +88,6 @@ Expression =
| Expression '||' Expression | Expression '||' Expression
| Expression '?' Expression ':' Expression | Expression '?' Expression ':' Expression
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression | Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
| Expression? (',' Expression)
| PrimaryExpression | PrimaryExpression
PrimaryExpression = Identifier PrimaryExpression = Identifier
@ -96,6 +95,7 @@ PrimaryExpression = Identifier
| NumberLiteral | NumberLiteral
| HexLiteral | HexLiteral
| StringLiteral | StringLiteral
| TupleExpression
| ElementaryTypeNameExpression | ElementaryTypeNameExpression
ExpressionList = Expression ( ',' Expression )* ExpressionList = Expression ( ',' Expression )*
@ -120,6 +120,9 @@ Identifier = [a-zA-Z_$] [a-zA-Z_$0-9]*
HexNumber = '0x' [0-9a-fA-F]+ HexNumber = '0x' [0-9a-fA-F]+
DecimalNumber = [0-9]+ DecimalNumber = [0-9]+
TupleExpression = '(' ( Expression ( ',' Expression )* )? ')'
| '[' ( Expression ( ',' Expression )* )? ']'
ElementaryTypeNameExpression = ElementaryTypeName ElementaryTypeNameExpression = ElementaryTypeName
ElementaryTypeName = 'address' | 'bool' | 'string' | 'var' ElementaryTypeName = 'address' | 'bool' | 'string' | 'var'