Merge pull request #1508 from janyou/Fixes-1298

Fixes #1298 for Swift target
This commit is contained in:
Terence Parr 2016-12-14 13:25:27 -08:00 committed by GitHub
commit fd3bd91828
2 changed files with 13 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|Node");
return !targetName.matches("Java|Python2|Python3|Node|Swift");
}
}

View File

@ -79,6 +79,18 @@ open class ParserRuleContext: RuleContext {
self.start = ctx.start
self.stop = ctx.stop
// copy any error nodes to alt label node
if ctx.children != nil{
self.children = Array<ParseTree>()
// reset parent pointer for any error nodes
for child: ParseTree in ctx.children! {
if child is ErrorNode{
self.children?.append(child)
( (child as! ErrorNode)).parent = self
}
}
}
}
public init(_ parent: ParserRuleContext?, _ invokingStateNumber: Int) {