|
|
|
@ -129,8 +129,8 @@ class Scanner(in: Reader[Char]) extends Reader[Tokens.Token] with Reporter {
|
|
|
|
|
*/
|
|
|
|
|
def getNum() = {
|
|
|
|
|
val buf = new java.lang.StringBuilder
|
|
|
|
|
while (in.hasNext(isNum)) {
|
|
|
|
|
buf += in.next
|
|
|
|
|
while (in.hasNext(isDigit)) {
|
|
|
|
|
buf += in.next()
|
|
|
|
|
}
|
|
|
|
|
Number(buf.toString().toInt)
|
|
|
|
|
}
|
|
|
|
@ -589,7 +589,7 @@ class VariableParser(in: Scanner) extends BranchParser(in) {
|
|
|
|
|
val rhs = parseSimpleExpression
|
|
|
|
|
accept(';')
|
|
|
|
|
val body = parseExpression
|
|
|
|
|
Var(name, rhs, body).withPos(pos)
|
|
|
|
|
VarDec(name, rhs, body).withPos(pos)
|
|
|
|
|
case _ => parseSimpleExpression
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|