Merge pull request #2486 from ralucado/master
Fix Index Error in Python3 GetChild
This commit is contained in:
commit
1c6c62afc7
|
@ -212,3 +212,4 @@ YYYY/MM/DD, github id, Full name, email
|
||||||
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
|
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
|
||||||
2018/12/20, WalterCouto, Walter Couto, WalterCouto@users.noreply.github.com
|
2018/12/20, WalterCouto, Walter Couto, WalterCouto@users.noreply.github.com
|
||||||
2018/12/23, youkaichao, Kaichao You, youkaichao@gmail.com
|
2018/12/23, youkaichao, Kaichao You, youkaichao@gmail.com
|
||||||
|
2019/02/06, ralucado, Cristina Raluca Vijulie, ralucris.v[at]gmail[dot]com
|
||||||
|
|
|
@ -113,7 +113,7 @@ class ParserRuleContext(RuleContext):
|
||||||
|
|
||||||
def getChild(self, i:int, ttype:type = None):
|
def getChild(self, i:int, ttype:type = None):
|
||||||
if ttype is 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:
|
else:
|
||||||
for child in self.getChildren():
|
for child in self.getChildren():
|
||||||
if not isinstance(child, ttype):
|
if not isinstance(child, ttype):
|
||||||
|
|
Loading…
Reference in New Issue