Add builtin symbols

This commit is contained in:
2025-05-08 00:13:07 +02:00
parent 40701008f0
commit 3f11d63a0f
7 changed files with 247 additions and 422 deletions

View File

@@ -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