diff options
Diffstat (limited to 'build/lexer.cxx')
-rw-r--r-- | build/lexer.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/build/lexer.cxx b/build/lexer.cxx index 8566788..9e3521a 100644 --- a/build/lexer.cxx +++ b/build/lexer.cxx @@ -56,10 +56,7 @@ namespace build if (!is_eos (c)) return c; - if (!name_.empty ()) - cerr << name_ << ':' << c.line () << ':' << c.column () << ": error: " << - "unterminated escape sequence" << endl; - + error (c) << "unterminated escape sequence" << endl; throw lexer_error (); } @@ -219,4 +216,11 @@ namespace build buf_ = c; unget_ = true; } + + ostream& lexer:: + error (const xchar& c) + { + return diag_ << name_ << ':' << c.line () << ':' << + c.column () << ": error: "; + } } |