Skip to content

Commit

Permalink
Fixed parser rules
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Jul 29, 2024
1 parent f09a0cd commit 02c8c30
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions grammar/Circom.g4
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ templateDeclaration
;

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

statement
Expand Down Expand Up @@ -93,10 +93,10 @@ expression
primary
: '(' expression ')'
| '[' expression (',' expression)* ']'
| INT
| NUMBER
| ID arrayDimension*
| args
| intSequence
| numSequence
;

componentDefinition: 'component' ID ;
Expand Down Expand Up @@ -129,10 +129,10 @@ componentCall

blockInstantiation: ID '(' ((expression)* | (expression (',' expression)*)) ')' componentCall? ;

arrayDimension: '[' (INT | ID | expression) ']' ;
arrayDimension: '[' (NUMBER | ID | expression) ']' ;

argsWithUnderscore: ('_' | ID) (',' ('_' | ID) )* ;

args: ID (',' ID)* ;

intSequence: INT (',' INT)* ;
numSequence: NUMBER (',' NUMBER)* ;

0 comments on commit 02c8c30

Please sign in to comment.