--- a/progs/compile.scala Thu Nov 14 13:50:39 2019 +0000
+++ b/progs/compile.scala Fri Nov 15 14:58:16 2019 +0000
@@ -119,7 +119,7 @@
}
// this allows you to write things like
-// i"add" and l"Lable"
+// i"add" and l"Label"
// environments
@@ -205,7 +205,7 @@
// main compilation function for blocks
def compile(bl: Block, class_name: String) : String = {
val instructions = compile_block(bl, Map.empty)._1
- (beginning ++ instructions.mkString ++ ending).replaceAllLiterally("XXX", class_name)
+ (beginning ++ instructions ++ ending).replaceAllLiterally("XXX", class_name)
}
@@ -257,7 +257,7 @@
// Fibonacci numbers as a bare-bone test-case
val fib_test =
- List(Assign("n", Num(10)), // n := 10;
+ List(Assign("n", Num(9)), // n := 10;
Assign("minus1",Num(0)), // minus1 := 0;
Assign("minus2",Num(1)), // minus2 := 1;
Assign("temp",Num(0)), // temp := 0;