From 8cf9b48ad4ca7fbff674f76d0a30f676ae28fc26 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 10 May 2012 23:26:38 +0200 Subject: [PATCH] thoughts about 'continue/break' bug --- compiler/transf.nim | 4 ++++ todo.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/compiler/transf.nim b/compiler/transf.nim index ff42ff5928..569210f2cc 100755 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -255,6 +255,10 @@ proc hasContinue(n: PNode): bool = proc transformLoopBody(c: PTransf, n: PNode): PTransNode = # XXX BUG: What if it contains "continue" and "break"? "break" needs # an explicit label too, but not the same! + + # We fix this here by making every 'break' belong to its enclosing loop + # and changing all breaks that belong to a 'block' by annotating it with + # a label (if it hasn't one already). if hasContinue(n): var labl = newSym(skLabel, nil, getCurrOwner(c)) labl.name = getIdent(genPrefix & $labl.id) diff --git a/todo.txt b/todo.txt index c5a7214e51..4561be5778 100755 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,7 @@ version 0.9.0 ============= +- fix transformLoopBody - make templates hygienic by default - ``bind`` for overloaded symbols does not work apparently - ``=`` should be overloadable; requires specialization for ``=``