From b0524a0b18eec9d5e5c3f6ce30b6cecdd02a6306 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Jan 2015 17:18:09 +0200 Subject: Diagnostic infrastructure revamp --- build/lexer.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'build/lexer.cxx') diff --git a/build/lexer.cxx b/build/lexer.cxx index a1aa375..ea11680 100644 --- a/build/lexer.cxx +++ b/build/lexer.cxx @@ -4,8 +4,6 @@ #include -#include - using namespace std; namespace build @@ -56,8 +54,7 @@ namespace build if (!is_eos (c)) return c; - error (c) << "unterminated escape sequence" << endl; - throw lexer_error (); + fail (c) << "unterminated escape sequence"; } void lexer:: @@ -217,10 +214,10 @@ namespace build unget_ = true; } - ostream& lexer:: - error (const xchar& c) + location_prologue lexer::fail_mark_base:: + operator() (const xchar& c) const { - return diag_ << name_ << ':' << c.line () << ':' << - c.column () << ": error: "; + return build::fail_mark_base::operator() ( + location (name_.c_str (), c.line (), c.column ())); } } -- cgit v1.1