feat: microwacc type checker implementation #22

Merged
gk1623 merged 3 commits from microwacc-type-checker-implementation into master 2025-02-18 17:29:11 +00:00
2 changed files with 51 additions and 46 deletions
Showing only changes of commit b7e442b269 - Show all commits

View File

@@ -39,8 +39,15 @@ def compile(contents: String): Int = {
typeChecker.check(prog)
if (errors.result.nonEmpty) {
given errorContent: String = contents
errors.result.foreach(printError)
200
errors.result
.map { error =>
printError(error)
error match {
case _: Error.InternalError => 201
case _ => 200
}
}
.max()
} else 0
case Failure(msg) =>
println(msg)