Skip to content

Commit

Permalink
Added function and template blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Aug 3, 2024
1 parent b077169 commit 97095c5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions grammar/Circom.g4
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ blockDeclaration
;

functionDeclaration
: 'function' ID '(' args* ')' '{' functionStmt* '}'
: 'function' ID '(' args* ')' functionBlock
;

functionBlock
: '{' functionStmt* '}'
;

functionStmt
Expand All @@ -38,8 +42,12 @@ functionStmt
;

templateDeclaration
: 'template' ID '(' args* ')' '{' statement* '}'
| 'template' 'custom' ID '(' args* ')' '{' statement* '}'
: 'template' ID '(' args* ')' templateBlock
| 'template' 'custom' ID '(' args* ')' templateBlock
;

templateBlock
: '{' statement* '}'
;

componentMainDeclaration
Expand Down

0 comments on commit 97095c5

Please sign in to comment.