summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-04-29 22:57:01 +0200
committerEugen Wissner <belka@caraus.de>2026-04-29 22:57:01 +0200
commit14d130f2854a119de69475e6f48f51ed6659953a (patch)
tree9b9232187bc375c82d74772bb00aa3b7e8ffa1bd /Rakefile
parent2342dd8429e4e6243c820c187664113557edd336 (diff)
downloadelna-14d130f2854a119de69475e6f48f51ed6659953a.tar.gz
Allow assigning variables refering to aggregates
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index c2f5be5..fe96b49 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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