diff options
Diffstat (limited to 'src/system.yy')
-rw-r--r-- | src/system.yy | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/system.yy b/src/system.yy index cd6ddc9..0727213 100644 --- a/src/system.yy +++ b/src/system.yy @@ -27,6 +27,7 @@ bool legacy = true; #include <cstdint> #include "lexer.h" #include "location.h" +#include "util.h" } //%locations @@ -69,7 +70,8 @@ block_end: ofstream f(p, ios_base::out | ios_base::binary); msg.SerializeToOstream(&f); f.close(); - } + } else + throw syntax_error(string_format("Block EPOCH mismatch: begin:%llu, end:%llu", msg.epoch(), $ULONG)); msg.Clear(); } @@ -275,7 +277,7 @@ namespace yy // Report an error to the user. auto parser::error (const std::string& msg) -> void { - std::cerr << msg << " on line " << lexer.lineno() << '\n'; + std::cerr << "\nERROR: " << msg << " on line " << lexer.lineno() - 1<< '\n'; } } |