aboutsummaryrefslogtreecommitdiffstats
path: root/grammar.txt
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-22 01:25:08 +0800
committerChristian <c@ethdev.com>2015-02-22 01:25:08 +0800
commit261786d909262e6cb4e9602cced76a3a22b7cb88 (patch)
treef4003a11a769bd9c15758b23fe24ec7f38482f57 /grammar.txt
parentbe15e0b424d9a7bd181c8525dbb2eb0a26806c13 (diff)
downloaddexon-solidity-261786d909262e6cb4e9602cced76a3a22b7cb88.tar.gz
dexon-solidity-261786d909262e6cb4e9602cced76a3a22b7cb88.tar.zst
dexon-solidity-261786d909262e6cb4e9602cced76a3a22b7cb88.zip
Allow conversion to dynamic arrays and update grammar.
Diffstat (limited to 'grammar.txt')
-rw-r--r--grammar.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/grammar.txt b/grammar.txt
index a3b24687..6503516c 100644
--- a/grammar.txt
+++ b/grammar.txt
@@ -18,8 +18,9 @@ ParameterList = '(' ( VariableDeclaration (',' VariableDeclaration)* )? ')'
// semantic restriction: mappings and structs (recursively) containing mappings
// are not allowed in argument lists
VariableDeclaration = TypeName Identifier
-TypeName = ElementaryTypeName | Identifier | Mapping
+TypeName = ElementaryTypeName | Identifier | Mapping | ArrayTypeName
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
+ArrayTypeName = TypeName '[' (Expression)? ']'
Block = '{' Statement* '}'
Statement = IfStatement | WhileStatement | Block |
@@ -42,5 +43,5 @@ Assignment = Expression (AssignmentOp Expression)
FunctionCall = Expression '(' Expression ( ',' Expression )* ')'
NewExpression = 'new' Identifier
MemberAccess = Expression '.' Identifier
-IndexAccess = Expression '[' Expresison ']'
+IndexAccess = Expression '[' (Expresison)? ']'
PrimaryExpression = Identifier | NumberLiteral | StringLiteral | ElementaryTypeName | '(' Expression ')'