- When throwing an exception when lexing include the current position and column
This commit is contained in:
Tristan B. Velloza Kildaire 2023-01-22 15:04:32 +02:00
parent d716c306a2
commit 078a971a67
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,8 @@ public final class LexerException : TError
this(Lexer offendingInstance, LexerError errType = LexerError.OTHER, string msg = "")
{
super(to!(string)(errType)~(msg.length ? ": "~msg : ""));
string positionString = "("~to!(string)(offendingInstance.line)~", "~to!(string)(offendingInstance.column)~")";
super("LexerException("~to!(string)(errType)~")"~(msg.length ? ": "~msg : "")~" at "~positionString);
this.offendingInstance = offendingInstance;
this.errType = errType;
}