Skip to content

Commit 5df1e95

Browse files
authored
Merge pull request #4 from distributed-lab/fix/grammar
2 parents 427af9c + 1dda49e commit 5df1e95

File tree

7 files changed

+460
-363
lines changed

7 files changed

+460
-363
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@distributedlab/circom-parser",
33
"description": "Circom circuit parser built with ANTLR4",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"files": [

src/builtin/CircomExpressionVisitor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export class CircomExpressionVisitor extends CircomVisitor<BigIntOrNestedArray>
5353
column: primary.start.column,
5454
});
5555
} else if (primary.identifier() && this.allowId) {
56-
const id = primary.identifier().ID().getText();
56+
// FIXME: Handle nested components
57+
const id = primary.identifier().ID(0).getText();
5758

5859
if (!(id in this.variablesContext)) {
5960
throw new ParserError({

src/builtin/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function parseIdentifier(identifier: IdentifierContext) {
1515
});
1616

1717
return {
18-
name: identifier.ID().getText(),
18+
name: identifier.ID(0).getText(),
1919
dimension: inputDimension,
2020
};
2121
}

0 commit comments

Comments
 (0)