1.1 --- a/micropython/ast.py Tue Jul 10 01:36:34 2012 +0200
1.2 +++ b/micropython/ast.py Tue Jul 10 18:54:33 2012 +0200
1.3 @@ -67,8 +67,8 @@
1.4
1.5 # Status flags.
1.6
1.7 - self.in_exception_handler = 0
1.8 - self.in_assignment = 0 # for slicing and subscript
1.9 + self.in_exception_handler = False
1.10 + self.in_assignment = False # for slicing and subscript
1.11
1.12 # Reset the assembler.
1.13
1.14 @@ -512,12 +512,12 @@
1.15
1.16 self.record_value(self.has_immediate_usage(node.nodes))
1.17
1.18 - self.in_assignment = 1
1.19 + self.in_assignment = True
1.20
1.21 for n in node.nodes:
1.22 self.dispatch(n)
1.23
1.24 - self.in_assignment = 0
1.25 + self.in_assignment = False
1.26 self.discard_value()
1.27
1.28 def visitAssAttr(self, node):
1.29 @@ -729,7 +729,7 @@
1.30 self._endFor(node, temp_iterator, next_block, exit_block, else_block, node.else_)
1.31
1.32 def visitIf(self, node):
1.33 - first = 1
1.34 + first = True
1.35 next_block = None
1.36 exit_block = self.new_block()
1.37
1.38 @@ -756,7 +756,7 @@
1.39 self.new_op(JumpIfFalse(next_block, working="status"))
1.40
1.41 self.dispatch(body)
1.42 - first = 0
1.43 + first = False
1.44
1.45 if next_block is not None:
1.46 self.set_block(next_block)
1.47 @@ -863,9 +863,9 @@
1.48
1.49 # Produce the handler code, then jump to the exit.
1.50
1.51 - self.in_exception_handler = 1
1.52 + self.in_exception_handler = True
1.53 self.dispatch(handler)
1.54 - self.in_exception_handler = 0
1.55 + self.in_exception_handler = False
1.56
1.57 self.new_op(Jump(exit_block))
1.58