forked from jasder/antlr
Merge pull request #1471 from renatahodovan/visit-error-node
Call visitErrorNodes properly in Python targets.
This commit is contained in:
commit
c7e27664c2
|
@ -328,7 +328,10 @@ class Parser (Recognizer):
|
|||
node = self._ctx.addTokenNode(o)
|
||||
if hasListener:
|
||||
for listener in self._parseListeners:
|
||||
listener.visitTerminal(node)
|
||||
if isinstance(node, ErrorNode):
|
||||
listener.visitErrorNode(node)
|
||||
elif isinstance(node, TerminalNode):
|
||||
listener.visitTerminal(node)
|
||||
return o
|
||||
|
||||
def addContextToParseTree(self):
|
||||
|
|
|
@ -335,7 +335,10 @@ class Parser (Recognizer):
|
|||
node = self._ctx.addTokenNode(o)
|
||||
if hasListener:
|
||||
for listener in self._parseListeners:
|
||||
listener.visitTerminal(node)
|
||||
if isinstance(node, ErrorNode):
|
||||
listener.visitErrorNode(node)
|
||||
elif isinstance(node, TerminalNode):
|
||||
listener.visitTerminal(node)
|
||||
return o
|
||||
|
||||
def addContextToParseTree(self):
|
||||
|
|
Loading…
Reference in New Issue