diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-01-30 23:21:19 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-01-30 23:21:19 +0100 |
| commit | a00f0d57b843736d603d749fc269d0208cec4e76 (patch) | |
| tree | 612ef7f8f4c3940ff1d90c10df6903d891a7a66d /Rakefile | |
| parent | 08b5325f58842933e80dfd6e290e1459af29bfa5 (diff) | |
| download | elna-a00f0d57b843736d603d749fc269d0208cec4e76.tar.gz | |
Lower global static array and record access
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 45 |
1 files changed, 6 insertions, 39 deletions
@@ -38,47 +38,14 @@ end desc 'Convert previous stage language into the current stage language' task :convert do - File.open('boot/stage19/cl.elna', 'w') do |current_stage| - File.readlines('boot/stage18/cl.elna').each do |line| - current_stage << "\tf();\n" if line.include? "if _compile() then" + File.open('boot/stage20/cl.elna', 'w') do |current_stage| + File.readlines('boot/stage19/cl.elna').each do |line| + if line.include? "_assign_at(@classification, 1, ElnaLexerClass.eof)" + current_stage << "\tclassification[1] := ElnaLexerClass.eof;\n" + else current_stage << line - if line == "type\n" - current_stage << <<-RECORD - Pair = record - first: Word; - second: Word - end; - R1 = record - field1: Word; - field2: [4]Word; - field3: Word - end; - R2 = record - field1: Word; - field3: Word; - field4: Word; - field5: Word; - field6: Word; - field2: Word - end; - - RECORD - end + end end - current_stage << <<~EPILOGUE - - proc f(); - var - v1: Word; - r: ^R1; - begin - r := malloc(#size(R1)); - - v1 := r^.field2[2]; - - printf("# %i\\n\\0", v1) - end; - EPILOGUE end end |
