feat: success logging by default

This commit is contained in:
2025-03-14 05:39:42 +00:00
parent 53d47fda63
commit 46f526c680
2 changed files with 4 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ def compile(
val backendEnd = System.nanoTime()
writer.writeTo(asmLines, outputPath) *>
logAction(s"Backend time (${filePath.toRealPath()}): ${(backendEnd - backendStart).toFloat / 1e6} ms") *>
logAction(s"Success: ${outputPath.toAbsolutePath}")
IO.blocking(println(s"Success: ${outputPath.toRealPath()}"))
def processProgram(contents: String, file: File, outDir: Path): IO[Int] =
val frontendStart = System.nanoTime()

View File

@@ -12,11 +12,11 @@ object semantics {
private def checkFunc(
funcDecl: ast.FuncDecl,
scope: Scope
): IO[Chain[(microWacc.FuncDecl, Chain[Error])]] = {
): IO[(microWacc.FuncDecl, Chain[Error])] = {
for {
renamerErrors <- renameFunction(funcDecl, scope)
(microWaccFunc, typeErrors) = checkFuncDecl(funcDecl)
} yield Chain.one(microWaccFunc, renamerErrors ++ typeErrors)
} yield (microWaccFunc, renamerErrors ++ typeErrors)
}
def check(partialProg: ast.PartialProgram): IO[(microWacc.Program, Chain[Error])] = {
@@ -27,7 +27,7 @@ object semantics {
toRename = (main +: chunks).toList
res <- toRename
.zip(scope.subscopes(toRename.size))
.parFoldMapA(checkFunc)
.parTraverse(checkFunc)
(typedChunks, errors) = res.foldLeft((Chain.empty[microWacc.FuncDecl], Chain.empty[Error])) {
case ((acc, err), (funcDecl, errors)) =>
(acc :+ funcDecl, err ++ errors)