forked from jasder/antlr
workaround current cyclic dependency on nodejs
This commit is contained in:
parent
c8ae1a89a2
commit
d95b3270c4
|
@ -27,7 +27,7 @@
|
|||
|
||||
var RuleNode = require('./tree/Tree').RuleNode;
|
||||
var INVALID_INTERVAL = require('./tree/Tree').INVALID_INTERVAL;
|
||||
var INVALID_ALT_NUMBER = require('./atn/ATN').INVALID_ALT_NUMBER;
|
||||
var INVALID_ALT_NUMBER = require('./atn/ATN').INVALID_ALT_NUMBER || 0; // TODO: solve cyclic dependency to avoid || 0
|
||||
|
||||
function RuleContext(parent, invokingState) {
|
||||
// What context invoked this rule?
|
||||
|
|
|
@ -51,7 +51,7 @@ const Trees = {
|
|||
if(ruleNames!==null) {
|
||||
if (t instanceof RuleContext) {
|
||||
const altNumber = t.getAltNumber();
|
||||
if ( altNumber != ATN.INVALID_ALT_NUMBER ) {
|
||||
if ( altNumber != (ATN.INVALID_ALT_NUMBER || 0) ) { // TODO: solve cyclic dependency to avoid || 0
|
||||
return ruleNames[t.ruleIndex]+":"+altNumber;
|
||||
}
|
||||
return ruleNames[t.ruleIndex];
|
||||
|
|
Loading…
Reference in New Issue