aboutsummaryrefslogtreecommitdiffstats
path: root/grammar.txt
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2014-12-16 21:46:17 +0800
committerLefteris Karapetsas <lefteris@refu.co>2014-12-17 07:03:30 +0800
commitadbea475963ab376c2ae378a03bc58f2fb454b6e (patch)
tree4a6f0f245c39dd24c340012f6032bf77b8a86c79 /grammar.txt
parent062b51e7bdf572abba25a76fc8c3bb6e96da71c9 (diff)
downloaddexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar
dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.gz
dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.bz2
dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.lz
dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.xz
dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.tar.zst
dexon-solidity-adbea475963ab376c2ae378a03bc58f2fb454b6e.zip
Minor issues, grammar update, new ForStatement test
Diffstat (limited to 'grammar.txt')
-rw-r--r--grammar.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/grammar.txt b/grammar.txt
index 7c0ac3a5..8c34997b 100644
--- a/grammar.txt
+++ b/grammar.txt
@@ -16,11 +16,13 @@ Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
Block = '{' Statement* '}'
Statement = IfStatement | WhileStatement | Block |
- ( Continue | Break | Return | VariableDefinition | Expression ) ';'
+ ( Continue | Break | Return | VariableDefinition | ExpressionStatement ) ';'
+ExpressionStatement = Expression
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
WhileStatement = 'while' '(' Expression ')' Statement
-ForStatement = 'for' '(' (VardefOrExpressionstatement)? ';' (Expression)? ';' (Expressionstatement)? ')' Statement
+VardefOrExprStmt = Variabledefinition | ExpressionStatement
+ForStatement = 'for' '(' (VardefOrExprStmt)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
Continue = 'continue' ';'
Break = 'break' ';'
Return = 'return' Expression? ';'