From: fred Date: Sun, 1 Dec 1996 21:46:55 +0000 (+0000) Subject: lilypond-0.0.13 X-Git-Tag: release/1.5.59~6708 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bde10ceb64ba182391aed53dc033ececf1f54176;p=lilypond.git lilypond-0.0.13 --- diff --git a/hdr/lexer.hh b/hdr/lexer.hh index e2537da410..f1cddd1e27 100644 --- a/hdr/lexer.hh +++ b/hdr/lexer.hh @@ -7,7 +7,7 @@ void new_input(String s); bool close_input(); int yylex(); void yyerror(const char *s); - +bool busy_parsing(); int lookup_keyword(String s); Identifier* lookup_identifier(String s); diff --git a/src/warn.cc b/src/warn.cc index 6d35d8cad6..230e4bb976 100644 --- a/src/warn.cc +++ b/src/warn.cc @@ -1,6 +1,8 @@ #include "debug.hh" - ostream &warnout (cerr); - ostream *mlog(&cerr); +#include "lexer.hh" + +ostream &warnout (cerr); +ostream *mlog(&cerr); @@ -14,7 +16,19 @@ warning(String s) void error(String s) { - cerr << "\nerror: " << s << "\n"; + if (busy_parsing()) + yyerror(s); + else + cerr << "\nerror: " << s << "\n"; + + exit(1); +} + +void +error_t(String s, Real r) +{ + String e=s+ "(t = " + r + ")"; + error(e); exit(1); }