aboutsummaryrefslogtreecommitdiff
path: root/compiler.d
diff options
context:
space:
mode:
authormryouse2023-05-27 01:48:18 +0000
committermryouse2023-05-27 01:48:18 +0000
commitea424bbc160ba84c4069a2889689be8685d35a1d (patch)
treea4e829437d99e94a9dcdb8b6f8f9ce1632157192 /compiler.d
parent334eafaff25014b0326b2b42e62e9b4f486736e6 (diff)
fix empty (list)
Diffstat (limited to 'compiler.d')
-rw-r--r--compiler.d6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler.d b/compiler.d
index 5b06f4c..a436323 100644
--- a/compiler.d
+++ b/compiler.d
@@ -615,6 +615,12 @@ class Compiler {
}
void compileList(Form[] args) {
+ if (args.length == 0) {
+ this.func.chunk.writeOp(OpCode.OP_LIST, -1);
+ this.func.chunk.writeOp(to!ubyte(0), -1);
+ this.advance();
+ return;
+ }
int length = to!int(args.length);
foreach (Form arg ; args) {
resolve(arg, ValueType.ANY); // resolve everything onto the stack