feat: implement all runtime errors #32

Merged
jt2622 merged 16 commits from runtime-errors into master 2025-02-28 00:23:13 +00:00
3 changed files with 15 additions and 23 deletions
Showing only changes of commit c31dd9de25 - Show all commits

View File

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

View File

@@ -81,7 +81,7 @@ class ParallelExamplesSpec extends AnyFlatSpec with BeforeAndAfterAll {
.replaceAll("0x[0-9a-f]+", "#addrs#") .replaceAll("0x[0-9a-f]+", "#addrs#")
.replaceAll("fatal error:.*", "#runtime_error#\n\u0000") .replaceAll("fatal error:.*", "#runtime_error#\n\u0000")
.takeWhile(_ != '\u0000') .takeWhile(_ != '\u0000')
== expectedOutput == expectedOutput
) )
} }
} }