X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=ddd6b7adcda7cefc261bbb074316eccc1334d6ab;hb=b7fcb21d8f1a6edba4693c879a2930db6f2fa95e;hp=424404febe492414d4584d9291037e70717837e9;hpb=af9e0b57dac45dc5591f16fb34236b1356cda8a2;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index 424404f..ddd6b7a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -78,9 +77,8 @@ int main(int argc, char **argv) { // std::srand(std::time(0)); try { - std::ifstream file("test-data/test.l2s"); ParsedSource source; - Parser parser(file, source); + Parser parser("test-data/test.l2s", source); parser.Parse(); cout << source; @@ -738,6 +736,9 @@ int main(int argc, char **argv) { app.Run(); return 0; + } catch (Parser::Error &e) { + cerr << "parsing exception in file " << e.File() << " on line " << e.Line() << ": " << e.what() << endl; + return 1; } catch (exception &e) { cerr << "exception in main(): " << e.what() << endl; return 1;