Fix off by one error in getChild

This commit is contained in:
Ralu 2019-02-06 10:41:38 +01:00 committed by GitHub
parent de316ff5ce
commit de58c28a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ class ParserRuleContext(RuleContext):
def getChild(self, i:int, ttype:type = None):
if ttype is None:
return self.children[i] if len(self.children)>=i else None
return self.children[i] if len(self.children)>i else None
else:
for child in self.getChildren():
if not isinstance(child, ttype):