diff -r 24bbe4e4b37b -r f7de0915fff2 progs/token.scala --- a/progs/token.scala Tue Dec 04 00:33:26 2018 +0000 +++ b/progs/token.scala Sat Dec 29 10:30:27 2018 +0000 @@ -291,3 +291,19 @@ } +val fib = """ +write "Fib"; +read n; +minus1 := 0; +minus2 := 1; +while n > 0 do { +temp := minus2; +minus2 := minus1 + minus2; +minus1 := temp; +n := n - 1 +}; +write "Result"; +write minus2 +""" + +println(env(lexing_simp(WHILE_REGS, prog2)).filterNot{_._1 == "w"})