From 83971f61a2539776e9dde3bdb2bd92705b837445 Mon Sep 17 00:00:00 2001 From: houmain Date: Thu, 26 Jan 2023 19:32:10 +0100 Subject: [PATCH] Do not output line number in error message after end --- src/InputParser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/InputParser.cpp b/src/InputParser.cpp index 2b92dbf..d8ce292 100644 --- a/src/InputParser.cpp +++ b/src/InputParser.cpp @@ -455,12 +455,15 @@ void InputParser::parse(std::istream& input) try { autocomplete_space = { }; } } + m_line_number = 0; pop_scope_stack(-1); assert(m_not_applied_definitions.empty()); } catch (const std::exception& ex) { auto ss = std::stringstream(); - ss << ex.what() << " in line " << m_line_number; + ss << ex.what(); + if (m_line_number > 0) + ss << " in line " << m_line_number; throw std::runtime_error(ss.str()); }