Skip to content

Commit

Permalink
fix: fixed getChild method of ParserRuleContext class
Browse files Browse the repository at this point in the history
-accepting as the second argument any constructor that returns an object that implements the ParseTree interface

Signed-off-by: AleiynikovPavel <[email protected]>
  • Loading branch information
AleiynikovPavel committed Dec 14, 2023
1 parent 4349324 commit 6ed10a3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ParserRuleContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,9 @@ export class ParserRuleContext extends RuleContext {

public override getChild(i: number): RuleContext | null;
public override getChild<T extends ParseTree>(i: number,
type: new (parent: ParserRuleContext | null, invokingStateNumber: number) => T): T | null;
type: new (...args: unknown[]) => T): T | null;
public override getChild<T extends ParseTree>(i: number,
type: new (symbol: Token) => T): T | null;
public override getChild<T extends ParseTree>(i: number,
type?: (new (parent: ParserRuleContext | null, invokingStateNumber: number) => T)
| (new (symbol: Token) => T)): T | null {
type?: new (...args: unknown[]) => T): T | null {
if (this.children === null || i < 0 || i >= this.children.length) {
return null;
}
Expand Down

0 comments on commit 6ed10a3

Please sign in to comment.