Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix multifor/lazy list failure (Util++)

  • Loading branch information...
commit fd3c7352a4f2374dc916188dd2423989a346657f 1 parent 52411f8
Stefan O'Rear authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/niecza
23 src/niecza
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.