diff options
| author | Baitinq <[email protected]> | 2025-01-30 00:47:30 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-01-30 00:47:30 +0100 |
| commit | 5c58c0b9de67f14106be1365f2177f990e5b2711 (patch) | |
| tree | e0465ef0581f42d56726bf95136340d6ab7024c6 | |
| parent | Codegen: Support function calls in return statement (diff) | |
| download | pry-lang-5c58c0b9de67f14106be1365f2177f990e5b2711.tar.gz pry-lang-5c58c0b9de67f14106be1365f2177f990e5b2711.tar.bz2 pry-lang-5c58c0b9de67f14106be1365f2177f990e5b2711.zip | |
Examples: Fix example 2
| -rw-r--r-- | examples/2.src | 2 | ||||
| -rw-r--r-- | src/codegen.zig | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/2.src b/examples/2.src index 96b0596..561d626 100644 --- a/examples/2.src +++ b/examples/2.src @@ -3,7 +3,7 @@ let main = () => { test = 7; - printf(test); + print(test); return test; }; 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), |