equal
deleted
inserted
replaced
128 lazy val Block: Parser[String, Block] = |
128 lazy val Block: Parser[String, Block] = |
129 (("{" ~ Stmts ~ "}") ==> { case ((x, y), z) => y} || |
129 (("{" ~ Stmts ~ "}") ==> { case ((x, y), z) => y} || |
130 (Stmt ==> ((s) => List(s)))) |
130 (Stmt ==> ((s) => List(s)))) |
131 |
131 |
132 |
132 |
133 Stmt.parse_all("x2:=5+3") |
133 Stmts.parse_all("x2:=5+3;") |
134 Block.parse_all("{x:=5;y:=8}") |
134 Block.parse_all("{x:=5;y:=8}") |
135 Block.parse_all("if(false)then{x:=5}else{x:=10}") |
135 Block.parse_all("if(false)then{x:=5}else{x:=10}") |
136 |
136 |
137 val fib = """{n:=10;minus1:=0;minus2:=1;temp:=0;while(n>0)do{temp:=minus2;minus2:=minus1+minus2;minus1:=temp;n:=n-1};result:=minus2}""" |
137 val fib = """{n:=10;minus1:=0;minus2:=1;temp:=0;while(n>0)do{temp:=minus2;minus2:=minus1+minus2;minus1:=temp;n:=n-1};result:=minus2}""" |
138 |
138 |