fix: dont destructure so early to avoid circular dependency problems

This commit is contained in:
Camilo Roca 2020-02-16 18:34:34 +01:00
parent 66c652142c
commit 1eafbf9286
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ const {Token} = require('./../Token');
const {ErrorNode, TerminalNode} = require('./Tree');
const {ParserRuleContext} = require('./../ParserRuleContext');
const {RuleContext} = require('./../RuleContext');
const {ATN: {INVALID_ALT_NUMBER}} = require('./../atn/ATN');
const {ATN} = require('./../atn/ATN');
/** A set of utility routines useful for all kinds of ANTLR trees. */
const Trees = {
@ -51,7 +51,7 @@ const Trees = {
if(ruleNames!==null) {
if (t instanceof RuleContext) {
const altNumber = t.getAltNumber();
if ( altNumber!=INVALID_ALT_NUMBER ) {
if ( altNumber != ATN.INVALID_ALT_NUMBER ) {
return ruleNames[t.ruleIndex]+":"+altNumber;
}
return ruleNames[t.ruleIndex];