diff --git a/src/main/wacc/parser.scala b/src/main/wacc/parser.scala index dac9fcd..888fc75 100644 --- a/src/main/wacc/parser.scala +++ b/src/main/wacc/parser.scala @@ -47,7 +47,8 @@ object parser { enum LabelType: case Expr case Pair - + + // Lexer-backed errorBuilder implicit val builder: ErrorBuilder[String] = new DefaultErrorBuilder with LexToken { def tokens = errTokens } @@ -151,8 +152,7 @@ object parser { ) | While("while" ~> ``.labelWithType(LabelType.Expr) <~ "do", `` <~ "done") | Block("begin" ~> `` <~ "end") - | VarDecl(``, `` <~ "=", ``.label("valid initial value for variable")) - // TODO: Can we inline the name of the variable in the message + | VarDecl(``, `` <~ "=", ``) | Assign(`` <~ "=", ``) private lazy val ``: Parsley[LValue] = `` | ``