diff options
Diffstat (limited to 'Rakefile')
| -rw-r--r-- | Rakefile | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -36,22 +36,25 @@ end desc 'Convert previous stage language into the current stage language' task :convert do - File.open('boot/stage21/cl.elna', 'w') do |current_stage| - File.readlines('boot/stage20/cl.elna').each do |line| + File.open('boot/stage22/cl.elna', 'w') do |current_stage| + seen_proc = 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' + if line.start_with?('begin') && !seen_proc + current_stage << <<~FUN + + proc f(); + var + x: ElnaLocation; + y: ElnaLocation; + begin + x := y; + end; + + FUN + end current_stage << line end -# current_stage << <<~FUN -# -# proc f(m: ElnaInstructionModule); -# begin -# end; -# -# proc g(); -# var -# x: ElnaInstructionModule; -# begin -# f(x) -# end; -# FUN end end |
