summaryrefslogtreecommitdiff
path: root/boot/stage14.elna
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-10-24 16:07:57 +0200
committerEugen Wissner <belka@caraus.de>2025-10-24 16:07:57 +0200
commitb20632245560b70f0605c0df1e56d766f22b4938 (patch)
treed175376c9f71898e853e315c83c87b1febf175a5 /boot/stage14.elna
parent70eab55cdefafa877ef9488182fbf7d680902259 (diff)
downloadelna-b20632245560b70f0605c0df1e56d766f22b4938.tar.gz
Parse type declarations and variable part
Diffstat (limited to 'boot/stage14.elna')
-rw-r--r--boot/stage14.elna14
1 files changed, 9 insertions, 5 deletions
diff --git a/boot/stage14.elna b/boot/stage14.elna
index e7e8811..5566518 100644
--- a/boot/stage14.elna
+++ b/boot/stage14.elna
@@ -1593,18 +1593,22 @@ begin
_lexer_skip_token();
_lexer_read_token(@token_kind);
_lexer_skip_token();
- _read_type_expression();
_lexer_read_token(@token_kind);
+ name := _lexer_global_get_start();
+ name_length := _lexer_global_get_end() + -name;
+ _lexer_skip_token();
+ _lexer_read_token(@token_kind);
- if token_kind <> _lexer_token_kind_assignment() then
+ if _lexer_compare_keyword("Array", 5, name, name_length) = 1 then
(* Else we assume this is a zeroed 819200 bytes big array. *)
_write_z(" .zero 819200\0")
- else
+ elsif token_kind = _lexer_token_kind_assignment() then
(* Skip the assignment sign with surrounding whitespaces. *)
_lexer_skip_token();
- _compile_global_initializer();
- _lexer_read_token(@token_kind)
+ _compile_global_initializer()
+ else
+ _write_z(" .word 0\n\0")
end;
(* Skip semicolon and newline. *)