Commit 2edd97ec authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2377] Prepare MasterLoader::pushSource for future

When we support $INCLUDE, it should report reasonable place of error,
not :0.
parent b70d80fc
......@@ -63,8 +63,15 @@ public:
void pushSource(const std::string& filename) {
std::string error;
if (!lexer_.pushSource(filename.c_str(), &error)) {
reportError("", 0, error);
ok_ = false;
if (initialized_) {
// $INCLUDE file
reportError(lexer_.getSourceName(), lexer_.getSourceLine(),
} else {
// Top-level file
reportError("", 0, error);
ok_ = false;
initialized_ = true;
......@@ -66,6 +66,10 @@ public:
/// \param zone_class The class of zone to be expected inside the
/// master file.
/// \param callbacks The callbacks by which it should report problems.
/// Usually, the callback carries a filename and line number of the
/// input where the problem happens. There's a special case of empty
/// filename and zero line in case the opening of the top-level master
/// file fails.
/// \param add_callback The callback which would be called with each
/// loaded RR.
/// \param options Options for the parsing, which is bitwise-or of
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment