Update Trees.swift

This commit is contained in:
janyou 2016-11-11 21:42:05 +08:00 committed by parrt
parent e3cc81bc32
commit 033e5ed136
1 changed files with 4 additions and 0 deletions

View File

@ -121,6 +121,10 @@ public class Trees {
if let ruleNode = t as? RuleNode {
let ruleIndex: Int = ruleNode.getRuleContext().getRuleIndex()
let ruleName: String = ruleNames![ruleIndex]
let altNumber = (t as! RuleContext).getAltNumber()
if altNumber != ATN.INVALID_ALT_NUMBER {
return "\(ruleName):\(altNumber)"
}
return ruleName
} else {
if let errorNode = t as? ErrorNode {