diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-01-14 19:48:28 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-01-14 19:48:28 +0100 |
| commit | cfef0550ca814ea3cb5740aab662c6cfd9288139 (patch) | |
| tree | 4ba9a4883b4734ce30a3f29a4594720afc2158ee /boot/stage17/cl.elna | |
| parent | 30e18517abf7bfabdedcb62400e2fd148a414a92 (diff) | |
| download | elna-cfef0550ca814ea3cb5740aab662c6cfd9288139.tar.gz | |
Implement array access expressions
Diffstat (limited to 'boot/stage17/cl.elna')
| -rw-r--r-- | boot/stage17/cl.elna | 10 |
1 files changed, 9 insertions, 1 deletions
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; |
