diff -r 8fb3b6d3be70 -r 81ee93b87258 solution/cw4/lexer.sc --- a/solution/cw4/lexer.sc Thu Jan 20 08:58:38 2022 +0000 +++ b/solution/cw4/lexer.sc Mon Jan 24 00:00:33 2022 +0000 @@ -205,13 +205,14 @@ val SYM : Rexp = LET | RANGE(Set('.', '_', '>', '<', '=', ';', ',', ':')) val PARENS : Rexp = "(" | "{" | ")" | "}" val SEMI : Rexp = ";" -val WHITESPACE : Rexp = PLUS(" ") | "\n" | "\t" +val WHITESPACE : Rexp = PLUS(" ") | "\n" | "\t" | "\r" val DIGIT : Rexp = RANGE(('0' to '9').toSet) val DIGIT1 : Rexp = RANGE(('1' to '9').toSet) val STRING : Rexp = "\"" ~ (SYM | " " | "\\n" | DIGIT).% ~ "\"" val ID : Rexp = LET ~ (LET | "_" | DIGIT).% val NUM : Rexp = "0" | (DIGIT1 ~ DIGIT.%) -val COMMENT : Rexp = "//" ~ (SYM | " " | DIGIT).% ~ "\n" +val EOL : Rexp = "\n" | "\r\n" +val COMMENT : Rexp = "//" ~ (SYM | PARENS | " " | DIGIT).% ~ EOL val WHILE_REGS = (("k" $ KEYWORD) | ("o" $ OP) |