summaryrefslogtreecommitdiffstats
path: root/src/Compiler/Language.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compiler/Language.java')
-rw-r--r--src/Compiler/Language.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Compiler/Language.java b/src/Compiler/Language.java
index 7326d10..1d95555 100644
--- a/src/Compiler/Language.java
+++ b/src/Compiler/Language.java
@@ -113,9 +113,16 @@ public class Language {
}
//Basic error reporting
- static void displayError(String message){
+ static void displayError(int line,String message){
hadError=true;
- System.out.println("An error was encountered");
+ 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 on line: "+token.line);
+ System.out.println("ERROR: "+token.text);
System.out.println(message);
}