Skip to content

Commit

Permalink
Fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Oct 27, 2024
1 parent 0d91961 commit 6604e36
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions grammar/CircomParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ pragmaDefinition
| 'pragma' 'custom_templates' ';' #PragmaCustomTemplates
;

includeDefinition: 'include' path=STRING ';' ;
includeDefinition: 'include' STRING ';' ;

blockDefiniton
: functionDefinition
| templateDefinition
| busDefinition
;

functionDefinition: 'function' name=ID '(' argNames=simpleIdentifierList? ')' body ;
functionDefinition: 'function' ID '(' argNames=simpleIdentifierList? ')' body ;

templateDefinition
: 'template' customGate='custom'? 'parallel'? name=ID '(' argNames=simpleIdentifierList? ')' body
: 'template' 'custom'? 'parallel'? ID '(' argNames=simpleIdentifierList? ')' body
;

busDefinition: 'bus' name=ID '(' argNames=simpleIdentifierList? ')' body ;
busDefinition: 'bus' ID '(' argNames=simpleIdentifierList? ')' body ;

publicInputsDefinition: '{' 'public' '[' publicInputs=simpleIdentifierList ']' '}' ;

Expand Down Expand Up @@ -93,24 +93,24 @@ componentMainDeclaration
STATEMENTS
//////////////////////////////////////////////////////////////*/

body: '{' statments* '}';
body: '{' statements* '}';

statments
statements
: declarations ';'
| ifStatments
| regularStatmetns
| regularStatements
| logDefinition ';'
| assertDefinition ';'
;

ifStatments
: 'if' '(' cond=expression ')' ifStatments #IfWithFollowUpIf
| 'if' '(' cond=expression ')' regularStatmetns #IfRegular
| 'if' '(' cond=expression ')' regularStatmetns 'else' ifStatments #IfRegularElseWithFollowUpIf
| 'if' '(' cond=expression ')' regularStatmetns 'else' regularStatmetns #IfRegularElseRegular
| 'if' '(' cond=expression ')' regularStatements #IfRegular
| 'if' '(' cond=expression ')' regularStatements 'else' ifStatments #IfRegularElseWithFollowUpIf
| 'if' '(' cond=expression ')' regularStatements 'else' regularStatements #IfRegularElseRegular
;

regularStatmetns
regularStatements
: body #RStatmentBody
| expression ';' #RStatmentExpression
| substitutions ';' #RStatmentSucstitutions
Expand All @@ -120,9 +120,9 @@ regularStatmetns
;

cycleStatments
: 'for' '(' declarations ';' cond=expression ';' step=substitutions ')' forBody=regularStatmetns #CycleForWithDeclaration
| 'for' '(' substitutions ';' cond=expression ';' step=substitutions ')' forBody=regularStatmetns #CycleForWithoutDeclaration
| 'while' '(' cond=expression ')' stmt=regularStatmetns #CycleWhile
: 'for' '(' declarations ';' cond=expression ';' step=substitutions ')' forBody=regularStatements #CycleForWithDeclaration
| 'for' '(' substitutions ';' cond=expression ';' step=substitutions ')' forBody=regularStatements #CycleForWithoutDeclaration
| 'while' '(' cond=expression ')' stmt=regularStatements #CycleWhile
;

substitutions
Expand All @@ -141,8 +141,8 @@ substitutions
expressionList: (expression ',')* expression ;

expressionListWithNames
: (name=ID ops=(ASSIGNMENT | LEFT_ASSIGNMENT | LEFT_CONSTRAINT) expression ',')*
name=ID ops=(ASSIGNMENT | LEFT_ASSIGNMENT | LEFT_CONSTRAINT) expression
: (ID ops=(ASSIGNMENT | LEFT_ASSIGNMENT | LEFT_CONSTRAINT) expression ',')*
ID ops=(ASSIGNMENT | LEFT_ASSIGNMENT | LEFT_CONSTRAINT) expression
;

expression
Expand Down

0 comments on commit 6604e36

Please sign in to comment.