From 9a186053a690f2216b43355549c8aa7e2959583c Mon Sep 17 00:00:00 2001
From: Ferenc Szontágh <szf@fsociety.hu>
Date: Fri, 18 Apr 2025 20:53:59 +0000
Subject: [PATCH] better error reporting
---
src/Parser/Parser.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp
index c802a9d..c3241c2 100644
--- a/src/Parser/Parser.cpp
+++ b/src/Parser/Parser.cpp
@@ -1,4 +1,6 @@
#include "Parser/Parser.hpp"
+// Static filename for unified error reporting in Parser::Exception
+std::string Parser::Parser::Exception::current_filename_;
#include <stack>
@@ -781,6 +783,7 @@
void Parser::parseScript(const std::vector<Lexer::Tokens::Token> & tokens, std::string_view input_string,
const std::string & filename) {
+ ::Parser::Parser::Exception::current_filename_ = filename;
tokens_ = tokens;
input_str_view_ = input_string;
current_token_index_ = 0;
--
Gitblit v1.9.3