forked from M-Labs/artiq
1
0
Fork 0

compiler.validators.constness: take AugAssign into account.

This commit is contained in:
whitequark 2017-06-09 07:31:08 +00:00
parent ad2ee714c2
commit f7254dd3ce
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,12 @@ class ConstnessValidator(algorithm.Visitor):
self.visit(node.targets) self.visit(node.targets)
self.in_assign = False self.in_assign = False
def visit_AugAssign(self, node):
self.visit(node.value)
self.in_assign = True
self.visit(node.target)
self.in_assign = False
def visit_SubscriptT(self, node): def visit_SubscriptT(self, node):
old_in_assign, self.in_assign = self.in_assign, False old_in_assign, self.in_assign = self.in_assign, False
self.visit(node.value) self.visit(node.value)