Fix KeyError in Range#evaluate()

If the key doesn't exist, `evaluate` raises a `KeyError` Exception,
making the tests fail.
This commit is contained in:
Ana María Martínez Gómez
2020-07-02 11:10:28 +02:00
parent aac5ac71d2
commit f8cfb67d02

View File

@@ -158,7 +158,7 @@ class Range(Statement):
if self.min == 0 and count == 0:
return Result(True, self, [])
return Result(self.min <= count <= self.max, self, [], locations=ctx[self.child])
return Result(self.min <= count <= self.max, self, [], locations=ctx.get(self.child))
def __str__(self):
if self.max == (1 << 64 - 1):