thoughts about 'continue/break' bug
This commit is contained in:
parent
63326f19f0
commit
8cf9b48ad4
2 changed files with 5 additions and 0 deletions
|
|
@ -255,6 +255,10 @@ proc hasContinue(n: PNode): bool =
|
||||||
proc transformLoopBody(c: PTransf, n: PNode): PTransNode =
|
proc transformLoopBody(c: PTransf, n: PNode): PTransNode =
|
||||||
# XXX BUG: What if it contains "continue" and "break"? "break" needs
|
# XXX BUG: What if it contains "continue" and "break"? "break" needs
|
||||||
# an explicit label too, but not the same!
|
# 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):
|
if hasContinue(n):
|
||||||
var labl = newSym(skLabel, nil, getCurrOwner(c))
|
var labl = newSym(skLabel, nil, getCurrOwner(c))
|
||||||
labl.name = getIdent(genPrefix & $labl.id)
|
labl.name = getIdent(genPrefix & $labl.id)
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -1,6 +1,7 @@
|
||||||
version 0.9.0
|
version 0.9.0
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
- fix transformLoopBody
|
||||||
- make templates hygienic by default
|
- make templates hygienic by default
|
||||||
- ``bind`` for overloaded symbols does not work apparently
|
- ``bind`` for overloaded symbols does not work apparently
|
||||||
- ``=`` should be overloadable; requires specialization for ``=``
|
- ``=`` should be overloadable; requires specialization for ``=``
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue