forked from jasder/antlr
Merge pull request #1508 from janyou/Fixes-1298
Fixes #1298 for Swift target
This commit is contained in:
commit
fd3bd91828
|
@ -112,7 +112,7 @@ public class ParseTreesDescriptors {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean ignore(String targetName) {
|
public boolean ignore(String targetName) {
|
||||||
return !targetName.matches("Java|Python2|Python3|Node");
|
return !targetName.matches("Java|Python2|Python3|Node|Swift");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,18 @@ open class ParserRuleContext: RuleContext {
|
||||||
|
|
||||||
self.start = ctx.start
|
self.start = ctx.start
|
||||||
self.stop = ctx.stop
|
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) {
|
public init(_ parent: ParserRuleContext?, _ invokingStateNumber: Int) {
|
||||||
|
|
Loading…
Reference in New Issue