From e7720e2d9e1319712f85cb0527e17f1251bd7d2c Mon Sep 17 00:00:00 2001 From: Elias Haugsbakk Date: Mon, 21 Sep 2026 14:36:59 +0200 Subject: add position info to semantic and IRgen exceptions --- src/main/java/no/eliashaugsbakk/kompilator/Main.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/no/eliashaugsbakk/kompilator/Main.java') diff --git a/src/main/java/no/eliashaugsbakk/kompilator/Main.java b/src/main/java/no/eliashaugsbakk/kompilator/Main.java index bdd1b1e..512682c 100644 --- a/src/main/java/no/eliashaugsbakk/kompilator/Main.java +++ b/src/main/java/no/eliashaugsbakk/kompilator/Main.java @@ -43,7 +43,7 @@ public class Main { try { inputProgram = fileReaderWriter.readFile(inputFileName); } catch (FileReaderWriterException e) { - IO.println("Could not read input file: " + inputFileName + "\n\n" + e.getMessage()); + IO.println("err: Could not read input file: " + inputFileName + "\n\n" + e.getMessage()); System.exit(1); } @@ -52,14 +52,14 @@ public class Main { try { ast = new Parser(tokens).parse(); } catch (ParserException e) { - IO.println("Error while parsing: " + e.getMessage()); + IO.println(e.getMessage()); System.exit(1); } try { new Analyzer(ast).analyze(); } catch (SemanticException e) { - IO.println("Semantic error: " + e.getMessage()); + IO.println(e.getMessage()); System.exit(1); } -- cgit v1.2.3