2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-19 00:16:29 +08:00

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

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)