diff options
Diffstat (limited to 'src/Compiler/Language.java')
-rw-r--r-- | src/Compiler/Language.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Compiler/Language.java b/src/Compiler/Language.java index bb7e235..9d2f3f0 100644 --- a/src/Compiler/Language.java +++ b/src/Compiler/Language.java @@ -63,11 +63,17 @@ public class Language { cExecutor.compileAndExecuteC(code, outName); } - //Basic error reporting - static void displayError(String message){ + static void displayError(int line,String message){ + hadError=true; + System.out.println("An error was encountered on line: "+line); + System.out.println(message); + } + //Basic error reporting + static void displayError(Token token,String message){ hadError=true; - System.out.println("An error was encountered"); + System.out.println("An error was encountered on line: "+token.line); + System.out.println("ERROR: "+token.text); System.out.println(message); } } |