diff -r 0cb4bf2469d1 -r ae5c03560d4d progs/while-arrays/compile_bfc.sc --- 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")