Allow assigning variables refering to aggregates

This commit is contained in:
2026-04-29 22:57:01 +02:00
parent 2342dd8429
commit 14d130f285
2 changed files with 18 additions and 7 deletions
+6 -1
View File
@@ -38,6 +38,7 @@ desc 'Convert previous stage language into the current stage language'
task :convert do
File.open('boot/stage22/cl.elna', 'w') do |current_stage|
seen_proc = false
seen_global_var = false
File.readlines('boot/stage21/cl.elna').each do |line|
seen_proc = true if line.start_with? 'proc'
seen_proc = false if line.start_with? 'end'
@@ -46,7 +47,6 @@ task :convert do
proc f();
var
x: ElnaLocation;
y: ElnaLocation;
begin
y.line := 1;
@@ -58,6 +58,11 @@ task :convert do
begin
f();
FUN
elsif line.start_with?('var') && !seen_global_var
current_stage << <<~FUN
var
x: ElnaLocation;
FUN
else
current_stage << line
end