From 4e50ed35ba89b46411d64c9a483a68c54c25077d Mon Sep 17 00:00:00 2001 From: Guy C Date: Tue, 4 Feb 2025 03:32:52 +0000 Subject: [PATCH] feat: more error messages --- src/main/wacc/ast.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/wacc/ast.scala b/src/main/wacc/ast.scala index c6e743e..7e84b14 100644 --- a/src/main/wacc/ast.scala +++ b/src/main/wacc/ast.scala @@ -119,9 +119,13 @@ object ast { case class Print(expr: Expr, newline: Boolean) extends Stmt object Print extends ParserBridge2[Expr, Boolean, Print] case class If(cond: Expr, thenStmt: NonEmptyList[Stmt], elseStmt: NonEmptyList[Stmt]) extends Stmt - object If extends ParserBridge3[Expr, NonEmptyList[Stmt], NonEmptyList[Stmt], If] + object If extends ParserBridge3[Expr, NonEmptyList[Stmt], NonEmptyList[Stmt], If] { + override def labels = List("if statement") + } case class While(cond: Expr, body: NonEmptyList[Stmt]) extends Stmt - object While extends ParserBridge2[Expr, NonEmptyList[Stmt], While] + object While extends ParserBridge2[Expr, NonEmptyList[Stmt], While] { + override def labels = List("while statement") + } case class Block(stmt: NonEmptyList[Stmt]) extends Stmt object Block extends ParserBridge1[NonEmptyList[Stmt], Block]