summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 1be5d4d8..ccce02ea 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -208,9 +208,14 @@ void textual_parser_t::instance_t::parse()
add_error_context("While parsing file "
<< file_context(pathname, linenum - 1));
- std::cerr << error_context() << std::endl
- << current_context << std::endl
- << "Error: " << err.what() << std::endl;
+ string context = error_context();
+ if (! context.empty())
+ std::cerr << context << std::endl;
+
+ if (! current_context.empty())
+ std::cerr << current_context << std::endl;
+
+ std::cerr << "Error: " << err.what() << std::endl;
errors++;
}
}