Skip to content

Commit 427af9c

Browse files
authored
Merge pull request #3 from distributed-lab/fix/g4-grammar
Sync with G4 grammar
2 parents e1323d9 + ca2d563 commit 427af9c

File tree

8 files changed

+911
-759
lines changed

8 files changed

+911
-759
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.1",
4+
"version": "0.1.2",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"files": [

src/ExtendedCircomParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Token } from "antlr4";
22
import * as antlr4 from "antlr4";
33

4+
import { ParserErrorItem } from "./types";
45
import { CircomLexer, CircomParser } from "./generated";
56

67
import ErrorListener from "./errors/ErrorListener";
7-
import { ParserErrorItem } from "./types";
88

99
export class ExtendedCircomParser extends CircomParser {
1010
lexer: CircomLexer | null = null;

src/generated/CircomListener.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { TemplateBlockContext } from "./CircomParser";
2424
import { ComponentMainDeclarationContext } from "./CircomParser";
2525
import { PublicInputsListContext } from "./CircomParser";
2626
import { TemplateStmtContext } from "./CircomParser";
27+
import { ElementContext } from "./CircomParser";
2728
import { ForControlContext } from "./CircomParser";
2829
import { ForInitContext } from "./CircomParser";
2930
import { ForUpdateContext } from "./CircomParser";
@@ -304,6 +305,16 @@ export default class CircomListener extends ParseTreeListener {
304305
* @param ctx the parse tree
305306
*/
306307
exitTemplateStmt?: (ctx: TemplateStmtContext) => void;
308+
/**
309+
* Enter a parse tree produced by `CircomParser.element`.
310+
* @param ctx the parse tree
311+
*/
312+
enterElement?: (ctx: ElementContext) => void;
313+
/**
314+
* Exit a parse tree produced by `CircomParser.element`.
315+
* @param ctx the parse tree
316+
*/
317+
exitElement?: (ctx: ElementContext) => void;
307318
/**
308319
* Enter a parse tree produced by `CircomParser.forControl`.
309320
* @param ctx the parse tree

0 commit comments

Comments
 (0)