feat: merge labts fixes

This commit is contained in:
Connolly, Guy
2025-02-27 21:58:01 +00:00
committed by Guy C
3 changed files with 15 additions and 23 deletions

View File

@@ -82,9 +82,11 @@ def compile(filename: String, outFile: Option[File] = None)(using
def main(args: Array[String]): Unit =
OParser.parse(cliParser, args, CliConfig()) match {
case Some(config) =>
compile(
config.file.getAbsolutePath,
outFile = Some(File(".", config.file.getName.stripSuffix(".wacc") + ".s"))
System.exit(
compile(
config.file.getAbsolutePath,
outFile = Some(File(".", config.file.getName.stripSuffix(".wacc") + ".s"))
)
)
case None =>
}

View File

@@ -180,8 +180,8 @@ object typeChecker {
microWacc.Builtin.Read,
List(
destTy match {
case KnownType.Int => "%d".toMicroWaccCharArray
case KnownType.Char | _ => "%c".toMicroWaccCharArray
case KnownType.Int => " %d".toMicroWaccCharArray
case KnownType.Char | _ => " %c".toMicroWaccCharArray
},
destTyped
)