diff options
Diffstat (limited to 'tabulator-mpi/main.cpp')
-rw-r--r-- | tabulator-mpi/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tabulator-mpi/main.cpp b/tabulator-mpi/main.cpp index f76ed70..959cd8c 100644 --- a/tabulator-mpi/main.cpp +++ b/tabulator-mpi/main.cpp @@ -16,14 +16,14 @@ const lib94::warrior *load_warrior(const char *file) { std::string source(std::istreambuf_iterator<char>(stream), {}); - auto w = lib94::compile_warrior(source); + try { + return lib94::compile_warrior(source); + } - if (std::holds_alternative<std::string>(w)) { - fprintf(stderr, "error compiling %s: %s\n", file, std::get<std::string>(w).c_str()); + catch (const lib94::compiler_exception &ex) { + fprintf(stderr, "error in %s on line %u: %s\n", file, ex.line_number, ex.message.c_str()); exit(1); } - - return std::get<lib94::warrior *>(w); } int main(int argc, char **argv) { |