feat: success logging by default
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user