summary refs log tree commit diff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-30 00:47:30 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-30 00:47:30 +0100
commitb5b65d491f98fe4a5162baa222557392c6ff5581 (patch)
treee0465ef0581f42d56726bf95136340d6ab7024c6 /src/codegen.zig
parentCodegen: Support function calls in return statement (diff)
downloadinterpreter-b5b65d491f98fe4a5162baa222557392c6ff5581.tar.gz
interpreter-b5b65d491f98fe4a5162baa222557392c6ff5581.tar.bz2
interpreter-b5b65d491f98fe4a5162baa222557392c6ff5581.zip
Examples: Fix example 2
Diffstat (limited to '')
-rw-r--r--src/codegen.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index cb94f3e..b60ffa6 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -214,6 +214,7 @@ pub const CodeGen = struct {
 
         const expression = statement.RETURN_STATEMENT.expression;
 
+        // TODO: Abstract this as we also need this for decls
         const num_argument: types.LLVMValueRef = switch (expression.*) {
             .PRIMARY_EXPRESSION => |primary_expression| switch (primary_expression) {
                 .NUMBER => |n| core.LLVMConstInt(core.LLVMInt64Type(), @intCast(n.value), 0),