Skip to content

Commit

Permalink
Add lexicals for "for (... : ...)" construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Skydev0h committed May 6, 2021
1 parent 9f5c379 commit 3ff8092
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.3.2-TL-0.5
version=2.3.2-TL-0.7
group=me.serce
kotlin_version=1.3.72
sentry_version=1.6.4
2 changes: 1 addition & 1 deletion src/main/grammars/Solidity.g4
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ whileStatement
: 'while' '(' expression ')' statement ;

forStatement
: 'for' '(' ( simpleStatement | ';' ) ( expressionStatement | ';' ) expression? ')' statement ;
: 'for' '(' ( simpleStatement | ';' ) ( expressionStatement | ';' | ':' ) expression? ')' statement ;

simpleStatement
: ( variableDeclarationStatement | expressionStatement ) ;
Expand Down
2 changes: 1 addition & 1 deletion src/main/grammars/grammar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
WhileStatement = 'while' '(' Expression ')' Statement
PlaceholderStatement = '_'
SimpleStatement = VariableDefinition | ExpressionStatement
ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
ForStatement = 'for' '(' ((SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? | SimpleStatement ':' Identifier) ')' Statement
RepeatStatement = 'repeat' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
InlineAssemblyStatement = 'assembly' StringLiteral? InlineAssemblyBlock
DoWhileStatement = 'do' Statement 'while' '(' Expression ')'
Expand Down
2 changes: 1 addition & 1 deletion src/main/grammars/solidity.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ CatchClause ::= catch ( Identifier? ParameterList )? Block {pin = 1}
WhileStatement ::= while '(' Expression ')' Statement {pin = 1}
PlaceholderStatement ::= '_'
private SimpleStatement ::= VariableDefinition | ExpressionStatement
ForStatement ::= for '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement {pin=1}
ForStatement ::= for '(' ((SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? | SimpleStatement ':' Identifier) ')' Statement {pin=1}
RepeatStatement ::= repeat '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement {pin=1}
InlineAssemblyStatement ::= assembly AssemblyBlock {pin=1}
DoWhileStatement ::= do Statement while '(' Expression ')' {pin=1}
Expand Down

0 comments on commit 3ff8092

Please sign in to comment.