Merge pull request #1494 from ericvergnaud/fix-#1298-for-JavaScript

Fix #1298 for JavaScript
This commit is contained in:
Terence Parr 2016-12-12 16:08:47 -08:00 committed by GitHub
commit e279cd699e
2 changed files with 12 additions and 1 deletions

View File

@ -112,7 +112,7 @@ public class ParseTreesDescriptors {
@Override
public boolean ignore(String targetName) {
return !targetName.matches("Java|Python2|Python3");
return !targetName.matches("Java|Python2|Python3|Node");
}
}

View File

@ -64,6 +64,17 @@ ParserRuleContext.prototype.copyFrom = function(ctx) {
this.children = null;
this.start = ctx.start;
this.stop = ctx.stop;
// copy any error nodes to alt label node
if(ctx.children) {
this.children = [];
// reset parent pointer for any error nodes
ctx.children.map(function(child) {
if (child instanceof ErrorNodeImpl) {
this.children.push(child);
child.parentCtx = this;
}
}, this);
}
};
// Double dispatch methods for listeners