progs/compile-lexer.scala
changeset 704 6d9c960a2b26
parent 323 4ce07c4abdb4
child 906 2bf1516d730f
--- a/progs/compile-lexer.scala	Wed Dec 04 14:39:32 2019 +0000
+++ b/progs/compile-lexer.scala	Sat Dec 07 00:57:23 2019 +0000
@@ -449,10 +449,10 @@
     else env
   case WriteS(s: String) => { println(s); env }
   case Write(s: String) => { println(env(s)); env }
-  case Read(s: String) => tokenizer(Console.readLine) match {
-    case List(T_NUM(n)) => env + (s -> n.toInt)
-    case _ => { println("not a number"); eval_stmt(Read(s: String), env) }
-  }
+  //case Read(s: String) => tokenizer(Console.readLine) match {
+  //  case List(T_NUM(n)) => env + (s -> n.toInt)
+  //  case _ => { println("not a number"); eval_stmt(Read(s: String), env) }
+  //}
 }
 
 def eval_bl(bl: Block, env: Env) : Env = bl match {
@@ -671,5 +671,6 @@
 //examples
 //println(compile("test", p9))
 //compile_run("loops.while")
-compile_run("p.while")
+//compile_run("p.while")
+compile_run("fib.while")
 //compile_run("test.while")