From cb96e96aee2e1f862797d4abe30075849f3d2929 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 13 Jul 2025 11:08:50 +0200 Subject: Boostrap: Support assigning to ptrs --- src/bootstrap/codegen.pry | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/bootstrap/codegen.pry b/src/bootstrap/codegen.pry index b627114..57f5472 100644 --- a/src/bootstrap/codegen.pry +++ b/src/bootstrap/codegen.pry @@ -789,6 +789,18 @@ let codegen_generate_assignment_statement = (c: *codegen, stmt: *NODE_ASSIGNMENT return 0; }; + + if (lhs.type == NODE_UNARY_EXPRESSION) { + let xd = (*cast(*NODE_UNARY_EXPRESSION_DATA, lhs.data)).expression; + let a = codegen_generate_expression_value(c, xd, cast(*i8, null)); + assert(a != cast(*Variable, null)); + let variable = codegen_generate_expression_value(c, prhs, cast(*i8, null)); + assert(variable != cast(*Variable, null)); + /* TODO: Check type */ + LLVMBuildStore((*c).builder, (*variable).value, (*a).value); + + return 0; + }; printf("ASSERT 2 %d\n", lhs.type); assert(false); -- cgit 1.4.1