From cfef0550ca814ea3cb5740aab662c6cfd9288139 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Wed, 14 Jan 2026 19:48:28 +0100 Subject: Implement array access expressions --- boot/stage17/cl.elna | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'boot/stage17/cl.elna') diff --git a/boot/stage17/cl.elna b/boot/stage17/cl.elna index 70c0348..ec0f656 100644 --- a/boot/stage17/cl.elna +++ b/boot/stage17/cl.elna @@ -2707,7 +2707,15 @@ begin if parser_node^.kind = ElnaTreeKind.dereference_expression then dereference_expression := parser_node; first_instruction := elna_tac_designator(dereference_expression^.pointer, symbol_table, is_address, operand_type, operand_value, operand_length); - is_address^ := 1 + if is_address^ = 1 then + last_instruction := _elna_tac_instruction_create(ElnaTacOperator.load); + _elna_tac_instruction_set_operand(last_instruction, 1, operand_type^, operand_value^, operand_length^); + _elna_tac_instruction_set_operand(last_instruction, 2, operand_type^, operand_value^, operand_length^); + + first_instruction := elna_instruction_list_concatenate(first_instruction, last_instruction) + else + is_address^ := 1 + end elsif parser_node^.kind = ElnaTreeKind.field_access_expression then field_access_expression := parser_node; expression_type := field_access_expression^.type_decoration; -- cgit v1.2.3