From 9d0eb307e15d5b5c7cc4a5691aba5514b86cca15 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 9 Jul 2016 22:50:18 +0200 Subject: [PATCH] Explain the purpose of PushScope() in loops when breakcont is active. --- lslopt/lslparse.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lslopt/lslparse.py b/lslopt/lslparse.py index c079654..06be761 100644 --- a/lslopt/lslparse.py +++ b/lslopt/lslparse.py @@ -1652,6 +1652,14 @@ list lazy_list_set(list L, integer i, list v) # we always do and open a new scope for it. At worst it will be # empty. At least it is not reflected as braces in the code if # braces are not used. + # + # This is designed to deal with cases like: + # if (a) while (b) { ... break; } + # + # This works by adding braces around the while and the newly + # added label, like this: + # if (a) { while (b) { ... jump label; } @label; } + # # FIXME: This causes issues with this code that should work: # default{timer(){ jump x; while(1) @x; }} self.PushScope()