From 31bb23480b13aba177c922fe229d7ad8ef2c3afd Mon Sep 17 00:00:00 2001 From: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:36:18 +0000 Subject: [PATCH] fix: refactored code to use ident.pos --- src/main/wacc/Error.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/wacc/Error.scala b/src/main/wacc/Error.scala index 724c08f..5aa0ad7 100644 --- a/src/main/wacc/Error.scala +++ b/src/main/wacc/Error.scala @@ -16,13 +16,13 @@ def printError(error: Error)(using errorContent: String): Unit = { println("Semantic error:") error match { case Error.DuplicateDeclaration(ident) => - printPosition(ident.getPosition) + printPosition(ident.pos) println(s"Duplicate declaration of identifier ${ident.v}") - highlight(ident.getPosition, ident.v.length) + highlight(ident.pos, ident.v.length) case Error.UndefinedIdentifier(ident, identType) => - printPosition(ident.getPosition) + printPosition(ident.pos) println(s"Undefined ${identType.toString.toLowerCase()} ${ident.v}") - highlight(ident.getPosition, ident.v.length) + highlight(ident.pos, ident.v.length) case Error.FunctionParamsMismatch(pos, expected, got) => printPosition(pos) println(s"Function expects $expected parameters, got $got")