Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Circom Grammar #4

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion circom-g4-grammar
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@distributedlab/circom-parser",
"description": "Circom circuit parser built with ANTLR4",
"version": "0.1.2",
"version": "0.1.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion src/builtin/CircomExpressionVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export class CircomExpressionVisitor extends CircomVisitor<BigIntOrNestedArray>
column: primary.start.column,
});
} else if (primary.identifier() && this.allowId) {
const id = primary.identifier().ID().getText();
// FIXME: Handle nested components
const id = primary.identifier().ID(0).getText();

if (!(id in this.variablesContext)) {
throw new ParserError({
Expand Down
2 changes: 1 addition & 1 deletion src/builtin/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function parseIdentifier(identifier: IdentifierContext) {
});

return {
name: identifier.ID().getText(),
name: identifier.ID(0).getText(),
dimension: inputDimension,
};
}
Expand Down
Loading
Loading