feat: success logging by default
This commit is contained in:
@@ -105,7 +105,7 @@ def compile(
|
|||||||
val backendEnd = System.nanoTime()
|
val backendEnd = System.nanoTime()
|
||||||
writer.writeTo(asmLines, outputPath) *>
|
writer.writeTo(asmLines, outputPath) *>
|
||||||
logAction(s"Backend time (${filePath.toRealPath()}): ${(backendEnd - backendStart).toFloat / 1e6} ms") *>
|
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] =
|
def processProgram(contents: String, file: File, outDir: Path): IO[Int] =
|
||||||
val frontendStart = System.nanoTime()
|
val frontendStart = System.nanoTime()
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ object semantics {
|
|||||||
private def checkFunc(
|
private def checkFunc(
|
||||||
funcDecl: ast.FuncDecl,
|
funcDecl: ast.FuncDecl,
|
||||||
scope: Scope
|
scope: Scope
|
||||||
): IO[Chain[(microWacc.FuncDecl, Chain[Error])]] = {
|
): IO[(microWacc.FuncDecl, Chain[Error])] = {
|
||||||
for {
|
for {
|
||||||
renamerErrors <- renameFunction(funcDecl, scope)
|
renamerErrors <- renameFunction(funcDecl, scope)
|
||||||
(microWaccFunc, typeErrors) = checkFuncDecl(funcDecl)
|
(microWaccFunc, typeErrors) = checkFuncDecl(funcDecl)
|
||||||
} yield Chain.one(microWaccFunc, renamerErrors ++ typeErrors)
|
} yield (microWaccFunc, renamerErrors ++ typeErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
def check(partialProg: ast.PartialProgram): IO[(microWacc.Program, Chain[Error])] = {
|
def check(partialProg: ast.PartialProgram): IO[(microWacc.Program, Chain[Error])] = {
|
||||||
@@ -27,7 +27,7 @@ object semantics {
|
|||||||
toRename = (main +: chunks).toList
|
toRename = (main +: chunks).toList
|
||||||
res <- toRename
|
res <- toRename
|
||||||
.zip(scope.subscopes(toRename.size))
|
.zip(scope.subscopes(toRename.size))
|
||||||
.parFoldMapA(checkFunc)
|
.parTraverse(checkFunc)
|
||||||
(typedChunks, errors) = res.foldLeft((Chain.empty[microWacc.FuncDecl], Chain.empty[Error])) {
|
(typedChunks, errors) = res.foldLeft((Chain.empty[microWacc.FuncDecl], Chain.empty[Error])) {
|
||||||
case ((acc, err), (funcDecl, errors)) =>
|
case ((acc, err), (funcDecl, errors)) =>
|
||||||
(acc :+ funcDecl, err ++ errors)
|
(acc :+ funcDecl, err ++ errors)
|
||||||
|
|||||||
Reference in New Issue
Block a user