progs/while-arrays/compile_bfc.sc
changeset 974 06148fc63273
parent 973 db987b9717a4
child 1004 04353d465dfb
--- a/progs/while-arrays/compile_bfc.sc	Fri Nov 22 12:42:07 2024 +0000
+++ b/progs/while-arrays/compile_bfc.sc	Fri Nov 29 18:58:18 2024 +0000
@@ -71,10 +71,12 @@
 import os.*
 
 
-def compile_to_file(bl: Block, class_name: String) : Unit = 
-  os.write.over(os.pwd / s"$class_name.j", compile(bl, class_name))  
+def compile_to_file(bl: Block, class_name: String) : Unit = { 
+  write.over(pwd / s"$class_name.while", bl.toString)  // maybe we should pretty-print the AST
+  write.over(pwd / s"$class_name.j", compile(bl, class_name))  
+}
 
-def compile_and_run(bl: Block, class_name: String) : Unit = {
+def compile_and_run(bl: Block, class_name: String) : Unit = { 
   println(s"Start of compilation")
   compile_to_file(bl, class_name)
   println(s"generated $class_name.j file")