refactor: bringing in ast and error changes
This commit is contained in:
@@ -28,11 +28,11 @@ def printError(error: Error)(using errorContent: String): Unit = {
|
||||
s"Undefined ${identType.toString.toLowerCase()} ${ident.v}"
|
||||
)
|
||||
highlight(ident.getPosition, ident.v.length)
|
||||
case Error.FunctionParamsMismatch(ident, expected, got) =>
|
||||
printPosition(ident.getPosition)
|
||||
println(s"Function ${ident.v} expects $expected parameters, got $got")
|
||||
highlight(ident.getPosition, ident.v.length)
|
||||
case Error.TypeMismatch(expected, got) =>
|
||||
case Error.FunctionParamsMismatch(pos, expected, got) =>
|
||||
printPosition(pos)
|
||||
println(s"Function expects $expected parameters, got $got")
|
||||
highlight(pos, 1)
|
||||
case Error.TypeMismatch(pos, expected, got, msg) =>
|
||||
println(s"Type mismatch: expected $expected, got $got")
|
||||
case Error.SemanticError(pos, msg) =>
|
||||
printPosition(pos)
|
||||
|
||||
Reference in New Issue
Block a user