diff --git a/src/main/wacc/Main.scala b/src/main/wacc/Main.scala index 9c59215..d4b070a 100644 --- a/src/main/wacc/Main.scala +++ b/src/main/wacc/Main.scala @@ -31,14 +31,18 @@ val cliParser = { def compile(contents: String): Int = { parser.parse(contents) match { - case Success(x) => 0 - case Failure(msg) => 100 + case Success(ast) => + // TODO: Do semantics things + 0 + case Failure(msg) => + println(msg) + 100 } } def main(args: Array[String]): Unit = OParser.parse(cliParser, args, CliConfig()) match { case Some(config) => - System.exit(scala.util.Random.between(0, 3) * 100) + System.exit(compile(os.read(os.Path(config.file.getAbsolutePath)))) case None => }