Skip to content

Commit

Permalink
Cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Aug 3, 2024
1 parent 97095c5 commit cbecc86
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions grammar/Circom.g4
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ functionBlock
;

functionStmt
: '{' functionStmt* '}'
: functionBlock
| ID SELF_OP
| varDeclaration
| expression (ASSIGNMENT | ASSIGMENT_OP) expression
Expand All @@ -47,15 +47,15 @@ templateDeclaration
;

templateBlock
: '{' statement* '}'
: '{' templateStmt* '}'
;

componentMainDeclaration
: 'component' 'main' ('{' 'public' '[' args ']' '}')? '=' ID '(' expressionList? ')' ';'
;

statement
: '{' statement* '}'
templateStmt
: templateBlock
| ID SELF_OP
| varDeclaration
| signalDeclaration
Expand All @@ -68,11 +68,11 @@ statement
| (expression | blockInstantiation) RIGHT_ASSIGNMENT '_'
| '(' argsWithUnderscore ')' (ASSIGNMENT | LEFT_ASSIGNMENT) blockInstantiation
| blockInstantiation RIGHT_ASSIGNMENT '(' argsWithUnderscore ')'
| 'if' parExpression statement ('else' statement)?
| 'while' parExpression statement
| 'for' '(' forControl ')' statement
| 'if' parExpression templateStmt ('else' templateStmt)?
| 'while' parExpression templateStmt
| 'for' '(' forControl ')' templateStmt
| 'assert' parExpression
| statement ';'
| templateStmt ';'
;

forControl: forInit ';' expression ';' forUpdate ;
Expand Down

0 comments on commit cbecc86

Please sign in to comment.