aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode/compiler.h')
-rwxr-xr-xsrc/bytecode/compiler.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bytecode/compiler.h b/src/bytecode/compiler.h
index 44f03fc..995a5c1 100755
--- a/src/bytecode/compiler.h
+++ b/src/bytecode/compiler.h
@@ -350,8 +350,6 @@ compile_fun_op(Chunk *chunk, Compiler *compiler, Token start) {
350 350
351void 351void
352compile_call_op(Chunk *chunk, Compiler *compiler, Token start, Token name) { 352compile_call_op(Chunk *chunk, Compiler *compiler, Token start, Token name) {
353 // FIXME: skipping arguments for now. Assuming nil.
354
355 // Compile body. 353 // Compile body.
356 size_t n = 0; 354 size_t n = 0;
357 while (has_next_token(compiler)) { 355 while (has_next_token(compiler)) {
@@ -370,12 +368,14 @@ compile_call_op(Chunk *chunk, Compiler *compiler, Token start, Token name) {
370 break; 368 break;
371 } 369 }
372 parse_tree(chunk, compiler); 370 parse_tree(chunk, compiler);
371 n++;
373 } 372 }
374 if (name.type == TOKEN_SYMBOL) { 373 if (name.type == TOKEN_SYMBOL) {
375 Object obj = make_symbol(name.value); 374 Object obj = make_symbol(name.value);
376 emit_constant(chunk, start, obj); 375 emit_constant(chunk, start, obj);
377 add_code(chunk, OP_GET, start.line, start.column); 376 add_code(chunk, OP_GET, start.line, start.column);
378 } 377 }
378 emit_constant(chunk, start, FIXNUM_VAL(n));
379 add_code(chunk, OP_CALL, start.line, start.column); 379 add_code(chunk, OP_CALL, start.line, start.column);
380} 380}
381 381