Skip to content

Commit

Permalink
Merge pull request #3 from distributed-lab/fix/g4-grammar
Browse files Browse the repository at this point in the history
Sync with G4 grammar
  • Loading branch information
Arvolear authored Sep 9, 2024
2 parents e1323d9 + ca2d563 commit 427af9c
Show file tree
Hide file tree
Showing 8 changed files with 911 additions and 759 deletions.
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.1",
"version": "0.1.2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/ExtendedCircomParser.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Token } from "antlr4";
import * as antlr4 from "antlr4";

import { ParserErrorItem } from "./types";
import { CircomLexer, CircomParser } from "./generated";

import ErrorListener from "./errors/ErrorListener";
import { ParserErrorItem } from "./types";

export class ExtendedCircomParser extends CircomParser {
lexer: CircomLexer | null = null;
Expand Down
11 changes: 11 additions & 0 deletions src/generated/CircomListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { TemplateBlockContext } from "./CircomParser";
import { ComponentMainDeclarationContext } from "./CircomParser";
import { PublicInputsListContext } from "./CircomParser";
import { TemplateStmtContext } from "./CircomParser";
import { ElementContext } from "./CircomParser";
import { ForControlContext } from "./CircomParser";
import { ForInitContext } from "./CircomParser";
import { ForUpdateContext } from "./CircomParser";
Expand Down Expand Up @@ -304,6 +305,16 @@ export default class CircomListener extends ParseTreeListener {
* @param ctx the parse tree
*/
exitTemplateStmt?: (ctx: TemplateStmtContext) => void;
/**
* Enter a parse tree produced by `CircomParser.element`.
* @param ctx the parse tree
*/
enterElement?: (ctx: ElementContext) => void;
/**
* Exit a parse tree produced by `CircomParser.element`.
* @param ctx the parse tree
*/
exitElement?: (ctx: ElementContext) => void;
/**
* Enter a parse tree produced by `CircomParser.forControl`.
* @param ctx the parse tree
Expand Down
Loading

0 comments on commit 427af9c

Please sign in to comment.