diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-07-09 21:13:32 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-07-09 21:13:32 (GMT) |
commit | 72042fc36f503894741ea4086bb89076b58542dc (patch) | |
tree | 815578c96a569af52228af5376bfd3c54ca4093a /TurtleArt/talogo.py | |
parent | c288a269deee737c34e8b2415da17a75fda82349 (diff) |
fix problem with nested while loops
Diffstat (limited to 'TurtleArt/talogo.py')
-rw-r--r-- | TurtleArt/talogo.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 3e8fb0f..8d957bc 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -803,8 +803,6 @@ class LogoCode: # into trouble if any of these block types (forever, while, # until. ifelse, stopstack, or stack) is changed in tablock.py - # TODO: Detect nesting, e.g., forever while - if b.name == 'while': while_blk = True else: @@ -819,7 +817,7 @@ class LogoCode: self.save_blocks = blocks[:] # Create an action block that will jump to the new stack - action_name = '#s_forever %d' % (len(self.save_while_blks) + 1) + action_name = '_forever %d' % (len(self.save_while_blks) + 1) action_blk = HiddenBlock('stack') action_label_blk = HiddenBlock('string', value=action_name) @@ -841,7 +839,7 @@ class LogoCode: # Create action block(s) to run the code inside the forever loop if until_blk and whileflow is not None: # run until flow at least once - action_flow_name = '#s_flow %d' % (len(self.save_while_blks) + 1) + action_flow_name = '_flow %d' % (len(self.save_while_blks) + 1) action_first = HiddenBlock('stack') first_label_blk = HiddenBlock('string', value=action_flow_name) |