Implement cast expressions

This commit is contained in:
2026-05-13 22:52:07 +02:00
parent eaa7fc2ca2
commit 1802aa21d8
3 changed files with 229 additions and 32 deletions
+4 -11
View File
@@ -46,18 +46,11 @@ task :convert do
current_stage << <<~FUN
proc f();
var
x: ElnaLocation;
y: ElnaPosition;
x: ^ElnaLocation;
begin
x.line := 5;
x.column := 3;
y.end_location := x;
(* y.end_location.line := 5;
y.end_location.column := 3;
x := y.end_location; *)
printf("# %i %i %i %i\\n\\0", x.line, x.column, y.end_location.line, y.end_location.column)
x := malloc(#size(ElnaLocation));
x^.line := 5;
x^.column := cast(3: Word)
end;
begin