Skip to content

Commit

Permalink
Fixed bug with constraint assignment to parenthesis identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR committed Sep 7, 2024
1 parent 4724b90 commit 34b4bc2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions grammar/Circom.g4
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ templateStmt
| blockInstantiation ';'
| (identifier ('.' ID)?) ASSIGNMENT expression ';'
| expression CONSTRAINT_EQ expression ';'
| (primary | (identifier '.' identifier)) (LEFT_ASSIGNMENT | ASSIGNMENT_OP) expression ';'
| expression RIGHT_ASSIGNMENT (identifier ('.' identifier)?) ';'
| element (LEFT_ASSIGNMENT | ASSIGNMENT_OP) expression ';'
| '(' element (',' element)* ')' LEFT_ASSIGNMENT expression ';'
| expression RIGHT_ASSIGNMENT element ';'
| expression RIGHT_ASSIGNMENT '(' element (',' element)* ')' ';'
| '_' (ASSIGNMENT | LEFT_ASSIGNMENT) (expression | blockInstantiation) ';'
| (expression | blockInstantiation) RIGHT_ASSIGNMENT '_' ';'
| '(' argsWithUnderscore ')' (ASSIGNMENT | LEFT_ASSIGNMENT) (blockInstantiation | expression) ';'
Expand All @@ -81,6 +83,8 @@ templateStmt
| logStmt ';'
;

element: (identifier ('.' identifier)?) ;

forControl: forInit ';' expression ';' forUpdate ;

forInit: 'var'? identifier (ASSIGNMENT rhsValue)? ;
Expand Down

0 comments on commit 34b4bc2

Please sign in to comment.