diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-05-08 00:13:07 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-05-08 00:13:07 +0200 |
| commit | 3f11d63a0f86191f010bc0093ee8616c154d9a1b (patch) | |
| tree | 24b2412bab652d6580c77f518806c7bfc1172f94 /boot/stage2.elna | |
| parent | 40701008f04f2242ab69bfb4bc4f376e6b75429a (diff) | |
| download | elna-3f11d63a0f86191f010bc0093ee8616c154d9a1b.tar.gz | |
Add builtin symbols
Diffstat (limited to 'boot/stage2.elna')
| -rw-r--r-- | boot/stage2.elna | 63 |
1 files changed, 9 insertions, 54 deletions
diff --git a/boot/stage2.elna b/boot/stage2.elna index 62bd307..695f52a 100644 --- a/boot/stage2.elna +++ b/boot/stage2.elna @@ -8,7 +8,6 @@ const var source_code: [81920]Byte -(* Ignores the import. *) proc _compile_import() var loca0: Word begin @@ -61,7 +60,7 @@ begin loca24 := _token_compare(loca12, loca20, @loca16); if loca24 = 0 then goto .L_build_binary_expression_minus - end + end; loca16 := 0x2a; loca24 := _token_compare(loca12, loca20, @loca16); @@ -181,7 +180,7 @@ begin _put_char(0x0a); goto .Lcompile_identifier_expression_end - end + end; loca8 := 0x6120616c; _write_out(@loca8, 4); @@ -409,7 +408,7 @@ begin loca0 := _front(loca8) = 0x2c; if loca0 = 0 then goto .Lcompile_call_paren - end + end; loca12 := loca12 + 1; @@ -567,7 +566,7 @@ begin loca0 := _front(loca0); loca4 := loca4 + 1; - if loca0 = 0x3d then + if loca0 = 0x3d then goto .Ltoken_character_single end end; @@ -605,43 +604,6 @@ begin .Lspace_loop_end end -proc _skip_comment(loca84: Word) -var - loca0: ^Byte - loca4: Word - loca8: Int -begin - loca0 := _current(); - - loca4 := 0x2a28; - loca8 := _memcmp(loca0, @loca4, 2); - if loca8 = 0 then - goto .Lskip_comment_continue - end; - goto .Lskip_comment_end; - - .Lskip_comment_continue; - _advance(2); - - loca4 := 0x292a; - - .Lskip_comment_loop; - loca0 := _current(); - loca8 := _memcmp(loca0, @loca4, 2); - if loca8 = 0 then - goto .Lskip_comment_close - end; - - _advance(1); - - goto .Lskip_comment_loop; - - .Lskip_comment_close; - _advance(2); - - .Lskip_comment_end -end - proc _compile_assembly(loca84: Word) var loca0: ^Byte begin @@ -748,9 +710,11 @@ begin .Lcompile_variable_section_item; _skip_spaces(); loca4 := _current(); - loca0 := _front(loca4); - if _is_lower(loca0) = 0 then + loca0 := 0x636f7270; + loca0 := _memcmp(@loca0, loca4, 4); + + if loca0 = 0 then goto .Lcompile_variable_section_end end; _compile_variable(); @@ -1096,7 +1060,7 @@ proc _compile_return() begin _advance(6); _skip_spaces(); - _build_binary_expression(); + _build_binary_expression() end proc _compile_if() @@ -1164,10 +1128,6 @@ begin loca16 := _current(); loca0 := _front(loca16); - if loca0 = 0x28 then - goto .Lcompile_line_comment - end; - loca16 := _current(); loca12 := 0x676f7270; loca4 := _memcmp(loca16, @loca12, 4); @@ -1308,10 +1268,6 @@ begin _compile_program(); goto .Lcompile_line_section; - .Lcompile_line_comment; - _skip_comment(loca84); - goto .Lcompile_line_section; - .Lcompile_line_empty; _advance(1); goto .Lcompile_line_section; @@ -1325,7 +1281,6 @@ begin .Lcompile_line_end; _skip_spaces(); - _skip_comment(); return loca8 end |
