From 1809ebf99e13ef047d2b35fc70bd3d0ee57b93e4 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sat, 6 Mar 2021 18:00:14 +0900 Subject: [PATCH] Okay quite a bit was wrong with that, but now it's right --- src/compiler.c | 1 + src/obj_gen.c | 10 +- src/vm.c | 3 + test/testComplicatedGeneratorFunction.krk | 16 + ...estComplicatedGeneratorFunction.krk.expect | 1851 +++++++++++++++++ 5 files changed, 1879 insertions(+), 2 deletions(-) create mode 100644 test/testComplicatedGeneratorFunction.krk create mode 100644 test/testComplicatedGeneratorFunction.krk.expect diff --git a/src/compiler.c b/src/compiler.c index 1e0b701..4a1f5e4 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -2322,6 +2322,7 @@ static void generatorInner(KrkScanner scannerBefore, Parser parserBefore) { emitLoop(loopStart); patchJump(exitJump); + emitByte(OP_POP); } /** diff --git a/src/obj_gen.c b/src/obj_gen.c index d632f5c..fcf0a11 100644 --- a/src/obj_gen.c +++ b/src/obj_gen.c @@ -90,6 +90,11 @@ KRK_METHOD(generator,__call__,{ size_t stackAfter = krk_currentThread.stackTop - krk_currentThread.stack; self->running = 0; + if (IS_KWARGS(result) && AS_INTEGER(result) == 0) { + _set_generator_done(self); + return OBJECT_VAL(self); + } + /* Was there an exception? */ if (krk_currentThread.flags & KRK_THREAD_HAS_EXCEPTION) { _set_generator_done(self); @@ -102,8 +107,9 @@ KRK_METHOD(generator,__call__,{ self->args = realloc(self->args, sizeof(KrkValue) * (self->argCount + newArgs)); self->argCount += newArgs; } else if (stackAfter < stackBefore) { - _set_generator_done(self); - return OBJECT_VAL(self); + size_t deadArgs = stackBefore - stackAfter; + self->args = realloc(self->args, sizeof(KrkValue) * (self->argCount - deadArgs)); + self->argCount -= deadArgs; } /* Save stack entries */ diff --git a/src/vm.c b/src/vm.c index abef6cc..1c5d188 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1870,6 +1870,9 @@ _resumeHook: (void)0; } krk_currentThread.stackTop = &krk_currentThread.stack[frame->outSlots]; if (krk_currentThread.frameCount == (size_t)krk_currentThread.exitOnFrame) { + if (frame->closure->function->isGenerator) { + return KWARGS_VAL(0); + } return result; } krk_push(result); diff --git a/test/testComplicatedGeneratorFunction.krk b/test/testComplicatedGeneratorFunction.krk new file mode 100644 index 0000000..996ae69 --- /dev/null +++ b/test/testComplicatedGeneratorFunction.krk @@ -0,0 +1,16 @@ +def agenerator(a=42): + print("First yield") + yield 1 + if True: + yield 2 + yield 3 + print("Into the loops") + for i in range(a): + yield i + print("nest loop", i, a) + for j in range(a): + print("yielding",j) + yield j + print("Done with inner nest from",i) + +print(list(agenerator())) diff --git a/test/testComplicatedGeneratorFunction.krk.expect b/test/testComplicatedGeneratorFunction.krk.expect new file mode 100644 index 0000000..e975b7c --- /dev/null +++ b/test/testComplicatedGeneratorFunction.krk.expect @@ -0,0 +1,1851 @@ +First yield +Into the loops +nest loop 0 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 0 +nest loop 1 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 1 +nest loop 2 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 2 +nest loop 3 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 3 +nest loop 4 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 4 +nest loop 5 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 5 +nest loop 6 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 6 +nest loop 7 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 7 +nest loop 8 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 8 +nest loop 9 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 9 +nest loop 10 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 10 +nest loop 11 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 11 +nest loop 12 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 12 +nest loop 13 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 13 +nest loop 14 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 14 +nest loop 15 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 15 +nest loop 16 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 16 +nest loop 17 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 17 +nest loop 18 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 18 +nest loop 19 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 19 +nest loop 20 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 20 +nest loop 21 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 21 +nest loop 22 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 22 +nest loop 23 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 23 +nest loop 24 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 24 +nest loop 25 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 25 +nest loop 26 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 26 +nest loop 27 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 27 +nest loop 28 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 28 +nest loop 29 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 29 +nest loop 30 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 30 +nest loop 31 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 31 +nest loop 32 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 32 +nest loop 33 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 33 +nest loop 34 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 34 +nest loop 35 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 35 +nest loop 36 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 36 +nest loop 37 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 37 +nest loop 38 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 38 +nest loop 39 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 39 +nest loop 40 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 40 +nest loop 41 42 +yielding 0 +yielding 1 +yielding 2 +yielding 3 +yielding 4 +yielding 5 +yielding 6 +yielding 7 +yielding 8 +yielding 9 +yielding 10 +yielding 11 +yielding 12 +yielding 13 +yielding 14 +yielding 15 +yielding 16 +yielding 17 +yielding 18 +yielding 19 +yielding 20 +yielding 21 +yielding 22 +yielding 23 +yielding 24 +yielding 25 +yielding 26 +yielding 27 +yielding 28 +yielding 29 +yielding 30 +yielding 31 +yielding 32 +yielding 33 +yielding 34 +yielding 35 +yielding 36 +yielding 37 +yielding 38 +yielding 39 +yielding 40 +yielding 41 +Done with inner nest from 41 +[1, 2, 3, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 13, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 17, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 18, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 21, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 22, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 25, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 27, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 28, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 29, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 33, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 34, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 35, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 36, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 37, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 38, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 39, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 40, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41]