diff options
| author | mryouse | 2023-06-08 21:08:51 -0400 |
|---|---|---|
| committer | mryouse | 2023-06-08 21:08:51 -0400 |
| commit | 2fffd9457fb294e1de04e60792ff525ae5065c0b (patch) | |
| tree | d0c78b6b68df5a81077d58382f2f302bbb30a761 | |
| parent | 90cb7bac9bab65a3816cf9e04f247c04fc445bfe (diff) | |
bugfix: reduce function takes accumulator first
| -rw-r--r-- | compiler.d | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -443,6 +443,9 @@ class Compiler { this.func.chunk.writeOp(to!ubyte(3), args[0].line); // | [ fn ] [ list ] [ item ] [ acc ] [ fn ] this.func.chunk.writeOp(OpCode.OP_ROTATE_N, args[0].line); this.func.chunk.writeOp(to!ubyte(3), args[0].line); // | [ fn ] [ list ] [ fn ] [ item ] [ acc ] + this.func.chunk.writeOp(OpCode.OP_ROTATE_N, args[0].line); + this.func.chunk.writeOp(to!ubyte(2), args[0].line); // | [ fn ] [ list ] [ fn ] [ acc ] [ item ] + // call the function this.func.chunk.writeOp(OpCode.OP_CALL, args[0].line); |
