diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-23 19:47:50 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-23 19:47:50 +0200 |
commit | b271ce1d9098c9057fccdca6eba6b0ee0a5245a2 (patch) | |
tree | e7b5a5f55e317f7ef6cd090eb12edc421f68504a /src/bytecode/compiler.h | |
parent | b07ece568d8d62ca80a8ba3b43fb46a98e117d5a (diff) | |
download | bdl-b271ce1d9098c9057fccdca6eba6b0ee0a5245a2.tar.gz bdl-b271ce1d9098c9057fccdca6eba6b0ee0a5245a2.zip |
Change relevant OPs to use list operations
Diffstat (limited to 'src/bytecode/compiler.h')
-rwxr-xr-x | src/bytecode/compiler.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/bytecode/compiler.h b/src/bytecode/compiler.h index 6f43416..7a25678 100755 --- a/src/bytecode/compiler.h +++ b/src/bytecode/compiler.h | |||
@@ -80,21 +80,15 @@ compile_list_binary_op(Chunk *chunk, Visitor *vs, Token list_start, Ops op) { | |||
80 | .line = list_start.line, | 80 | .line = list_start.line, |
81 | .col = list_start.column, | 81 | .col = list_start.column, |
82 | }); | 82 | }); |
83 | return; | ||
83 | } | 84 | } |
84 | return; | 85 | break; |
85 | } | 86 | } |
86 | parse_tree(chunk, vs); | 87 | parse_tree(chunk, vs); |
87 | n++; | 88 | n++; |
88 | if (n > 1) { | ||
89 | add_code(chunk, op, list_start.line, list_start.column); | ||
90 | } | ||
91 | } | 89 | } |
92 | error_push((Error){ | 90 | emit_constant(chunk, list_start, FIXNUM_VAL(n)); |
93 | .type = ERR_TYPE_COMPILER, | 91 | add_code(chunk, op, list_start.line, list_start.column); |
94 | .value = ERR_NOT_ENOUGH_ARGS, | ||
95 | .line = list_start.line, | ||
96 | .col = list_start.column, | ||
97 | }); | ||
98 | } | 92 | } |
99 | 93 | ||
100 | void | 94 | void |