Skip to content

Commit

Permalink
Fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Oct 30, 2024
1 parent 2812f29 commit bd2c734
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 @@ -97,29 +97,29 @@ body: '{' statements* '}';

statements
: declarations ';'
| ifStatments
| ifStatements
| regularStatements
| logDefinition ';'
| assertDefinition ';'
;

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

regularStatements
: body #RStatmentBody
| expression ';' #RStatmentExpression
| substitutions ';' #RStatmentSucstitutions
| cycleStatments #RStatmentCycles
| lhs=expression '===' rhs=expression ';' #RStatmentEqConstraint
| 'return' value=expression ';' #RStatmentReturn
: body #RStatementBody
| expression ';' #RStatementExpression
| substitutions ';' #RStatementSucstitutions
| cycleStatements #RStatementCycles
| lhs=expression '===' rhs=expression ';' #RStatementEqConstraint
| 'return' value=expression ';' #RStatementReturn
;

cycleStatments
cycleStatements
: 'for' '(' declarations ';' cond=expression ';' step=substitutions ')' forBody=regularStatements #CycleForWithDeclaration
| 'for' '(' substitutions ';' cond=expression ';' step=substitutions ')' forBody=regularStatements #CycleForWithoutDeclaration
| 'while' '(' cond=expression ')' stmt=regularStatements #CycleWhile
Expand All @@ -129,9 +129,9 @@ substitutions
: lhs=expression op=(ASSIGNMENT | LEFT_ASSIGNMENT | LEFT_CONSTRAINT) rhs=expression #SubsLeftAssignmet
| lhs=expression op='-->' variable=expression #SubsRightSimpleAssignmet
| lhs=expression op='==>' variable=expression #SubsRightConstrAssignmet
| identifierStatment op=ASSIGNMENT_WITH_OP rhs=expression #SubsAssignmetWithOperation
| identifierStatment SELF_OP #SubsIcnDecOperation
| SELF_OP identifierStatment #SubsInvalidIcnDecOperation
| identifierStatement op=ASSIGNMENT_WITH_OP rhs=expression #SubsAssignmetWithOperation
| identifierStatement SELF_OP #SubsIcnDecOperation
| SELF_OP identifierStatement #SubsInvalidIcnDecOperation
;

/*//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -164,7 +164,7 @@ expression

// Literal, parentheses, function call, array inline, anonymous component call
primaryExpression
: identifierStatment #PIdentifierStatment
: identifierStatement #PIdentifierStatement
| '_' #PUnderscore
| NUMBER #PNumber
| '(' expressionList ')' #PParentheses
Expand Down Expand Up @@ -195,7 +195,7 @@ signalIdentifier

signalIdentifierList: (signalIdentifier ',')* signalIdentifier ;

identifierStatment: ID idetifierAccess* ;
identifierStatement: ID idetifierAccess* ;

identifier: ID arrayDimension* ;

Expand Down

0 comments on commit bd2c734

Please sign in to comment.