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,6 +328,9 @@ class Parser (Recognizer):
|
|||
node = self._ctx.addTokenNode(o)
|
||||
if hasListener:
|
||||
for listener in self._parseListeners:
|
||||
if isinstance(node, ErrorNode):
|
||||
listener.visitErrorNode(node)
|
||||
elif isinstance(node, TerminalNode):
|
||||
listener.visitTerminal(node)
|
||||
return o
|
||||
|
||||
|
|
|
@ -335,6 +335,9 @@ class Parser (Recognizer):
|
|||
node = self._ctx.addTokenNode(o)
|
||||
if hasListener:
|
||||
for listener in self._parseListeners:
|
||||
if isinstance(node, ErrorNode):
|
||||
listener.visitErrorNode(node)
|
||||
elif isinstance(node, TerminalNode):
|
||||
listener.visitTerminal(node)
|
||||
return o
|
||||
|
||||
|
|
Loading…
Reference in New Issue