Skip to content

Commit

Permalink
Do not output line number in error message after end
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Jan 26, 2023
1 parent 4ad685e commit 83971f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/InputParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 83971f6

Please sign in to comment.