Added: AS1/2 - underline errors in the code (also in edit mode)

This commit is contained in:
Jindra Petřík
2025-05-28 17:51:05 +02:00
parent d3dd8224d4
commit 479b61a7f1
10 changed files with 721 additions and 380 deletions
@@ -27,6 +27,11 @@ public abstract class ParseException extends Exception {
* Line number where the exception occurred.
*/
public long line;
/**
* Position in the code where the exception occured. -1 where unknown
*/
public long position = -1;
/**
* Text of the exception.
@@ -43,5 +48,19 @@ public abstract class ParseException extends Exception {
super("ParseException:" + text + " on line " + line);
this.line = line;
this.text = text;
this.position = -1;
}
/**
* Constructs a new parse exception.
*
* @param text Text of the exception
* @param line Line number where the exception occurred
*/
public ParseException(String text, long line, long position) {
super("ParseException:" + text + " on line " + line);
this.line = line;
this.text = text;
this.position = position;
}
}