Merge pull request #2184 from jkmar/return_result_in_visitor

[Python3] return result instead of None in visitor
This commit is contained in:
Terence Parr 2018-01-01 11:34:50 -08:00 committed by GitHub
commit 4cca8cd68d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -178,3 +178,4 @@ YYYY/MM/DD, github id, Full name, email
2017/12/01, DavidMoraisFerreira, David Morais Ferreira, david.moraisferreira@gmail.com
2017/12/01, SebastianLng, Sebastian Lang, sebastian.lang@outlook.com
2017/12/03, oranoran, Oran Epelbaum, oran / epelbaum me
2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com

View File

@ -40,7 +40,7 @@ class ParseTreeVisitor(object):
n = node.getChildCount()
for i in range(n):
if not self.shouldVisitNextChild(node, result):
return
return result
c = node.getChild(i)
childResult = c.accept(self)

View File

@ -38,7 +38,7 @@ class ParseTreeVisitor(object):
n = node.getChildCount()
for i in range(n):
if not self.shouldVisitNextChild(node, result):
return
return result
c = node.getChild(i)
childResult = c.accept(self)