From 078a971a6727921bb6362bfe87e8e40c5196164c Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sun, 22 Jan 2023 15:04:32 +0200 Subject: [PATCH] Lexer - When throwing an exception when lexing include the current position and column --- source/tlang/compiler/lexer.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/lexer.d b/source/tlang/compiler/lexer.d index a80b23b7..206037ae 100644 --- a/source/tlang/compiler/lexer.d +++ b/source/tlang/compiler/lexer.d @@ -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; }