about summary refs log tree commit diff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-05-31 23:26:13 +0200
committerBaitinq <[email protected]>2025-05-31 23:54:43 +0200
commit89d2927116ea7bee0f3cedfcf17bf32827697f4a (patch)
tree38791f44546048636c9f83f32affc7b0e9535afc /src/codegen.zig
parentBootstrap: Tokenizer: Start rewriting with token type (diff)
downloadpry-lang-89d2927116ea7bee0f3cedfcf17bf32827697f4a.tar.gz
pry-lang-89d2927116ea7bee0f3cedfcf17bf32827697f4a.tar.bz2
pry-lang-89d2927116ea7bee0f3cedfcf17bf32827697f4a.zip
Boostrap: Tokenizer: Fix allocation
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index 152572f..30ef293 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -248,7 +248,7 @@ pub const CodeGen = struct {
 
         for (0.., function_call_statement.arguments) |i, argument| {
             const arg = try self.generate_expression_value(argument, null);
-            const expected_type = function.node_type.TYPE.FUNCTION_TYPE.parameters[i];
+            const expected_type = function.node_type.TYPE.FUNCTION_TYPE.parameters[i]; //TODO: If varargs we shouldnt do this
             std.debug.print("2 TYP {s}: {any} vs {any}\n", .{ function_call_statement.expression.PRIMARY_EXPRESSION.IDENTIFIER.name, expected_type.TYPE, arg.node_type.TYPE });
             std.debug.assert(self.compare_types(expected_type, arg.node_type, false));
             try arguments.append(arg.value);
@@ -1066,6 +1066,7 @@ const Environment = struct {
     }
 
     fn add_variable(self: *Environment, name: []const u8, variable: *Variable) !void {
+        // TODO: Dont allow shadowing if value != value or type != type (across things)
         try self.scope_stack.getLast().variables.put(name, variable);
     }