From 9515e2f77e8e26590e7ca00ef18a6637d4fb156a Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 19 Jun 2026 12:29:18 +0200 Subject: Use buffered I/O --- Rakefile | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index c9a255f..6778780 100644 --- a/Rakefile +++ b/Rakefile @@ -36,28 +36,18 @@ end desc 'Convert previous stage language into the current stage language' task :convert do - File.open('boot/stage23/cl.elna', 'w') do |current_stage| + File.open('boot/stage24/cl.elna', 'w') do |current_stage| seen_proc = false - File.readlines('boot/stage22/cl.elna').each do |line| - if line.start_with? 'proc' + File.readlines('boot/stage23/cl.elna').each do |line| + if line.start_with?('proc') && !seen_proc seen_proc = true - current_stage << line - elsif seen_proc && line.start_with?('begin') - seen_proc = false - current_stage << line - elsif !seen_proc && line.start_with?('begin') current_stage << <<~CODE - proc f() - begin - \tprintf("# %.*s %p %i\\n\\0".ptr, "location".length, "location".ptr, "location".ptr, "location".length) - end + proc sprintf(buffer: Pointer, format: ^Char, number: Word) + extern CODE current_stage << line - current_stage << <<~CODE - \tf(); - CODE else current_stage << line end -- cgit v1.2.3