antlr4-tool
antlr4-tool copied to clipboard
Sub-rules are missing in Parser.d.ts
Hi! First of all, thank for this amazing package, it's very nice to have antlr available in browser side 😃
I just have some little mismatches between the PslParser.js and the PslParser.d.ts files.
Here my repro steps and bit more details:
Command
antlr4-tool -l ts -o src/parser Grammar.g4
The grammar
grammar Grammar;
schema: 'schema' (schemaParams);
schemaParams: '(' (schemaParam (',' schemaParam)*)? ')';
schemaParam: ('a' | 'b' | 'c')*;
GrammarParser.js
SchemaParamsContext.prototype.schemaParam = function(i) {
if(i===undefined) {
i = null;
}
if(i===null) {
return this.getTypedRuleContexts(SchemaParamContext);
} else {
return this.getTypedRuleContext(SchemaParamContext,i);
}
};
GrammarParser.d.ts (actual)
export declare class SchemaParamsContext extends ParserRuleContext {
}
GrammarParser.d.ts (expected)
export declare class SchemaParamsContext extends ParserRuleContext {
+ schemaParam(): SchemaParamContext;
}
@fabien0102 I'll see what I can do to fix these issues soon. Thanks again your patience and for reporting.