Permalink
Browse files

Fix multifor/lazy list failure (Util++)

  • Loading branch information...
1 parent 52411f8 commit fd3c7352a4f2374dc916188dd2423989a346657f @sorear committed Dec 29, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/niecza
View
23 src/niecza
@@ -25,6 +25,29 @@ use STD;
# }
# }
+augment class Op::ImmedForLoop {
+ method code_labelled($body, $l) {
+ my $id = ::GLOBAL::NieczaActions.genid;
+
+ CgOp.rnull(CgOp.letn(
+ "!iter$id", CgOp.start_iter($.source.cgop($body)),
+ (map { $_, CgOp.null('var') }, @$.var),
+ CgOp.label("again$id"),
+ (map {
+ CgOp.ncgoto("last$id",
+ CgOp.iter_hasflat(CgOp.letvar("!iter$id"))),
+ CgOp.letvar($_, CgOp.vvarlist_shift(CgOp.letvar("!iter$id")))
+ }, @$.var),
+ CgOp.sink(CgOp.xspan("redo$id", "next$id", 0,
+ $.sink.cgop($body),
+ 1, $l, "next$id",
+ 2, $l, "last$id",
+ 3, $l, "redo$id")),
+ CgOp.goto("again$id"),
+ CgOp.label("last$id")));
+ }
+}
+
augment class NieczaActions {
method post_backslash($/) {
# XXX confine $/ resetting

0 comments on commit fd3c735

Please sign in to comment.