diff --git a/src/main/wacc/parser.scala b/src/main/wacc/parser.scala index 7d76969..d8b52b4 100644 --- a/src/main/wacc/parser.scala +++ b/src/main/wacc/parser.scala @@ -175,7 +175,15 @@ object parser { ``.label("valid initial value for variable") ) // TODO: Can we inline the name of the variable in the message - | Assign(`` <~ "=", ``) + | Assign( + `` <~ ("=" | "(".verifiedExplain( + "function calls must use the 'call' keyword and the result must be assigned to a variable" + )), + `` + ) | + ("call" ~> ``).verifiedExplain( + "function calls' results must be assigned to a variable" + ) private lazy val ``: Parsley[LValue] = `` | `` private lazy val ``: Parsley[RValue] =