X-Git-Url: https://git.llucax.com/software/bife/bife%20%20.git/blobdiff_plain/efa6c9315719fc0b98483abdc26341d061b4a4b4..993710aae023efaccb75b56eee2347c340bdc71d:/parser_test.cpp/software/bife/bife++.git/blobdiff_plain/efa6c9315719fc0b98483abdc26341d061b4a4b4..993710aae023efaccb75b56eee2347c340bdc71d:/parser_test.cpp?ds=inline diff --git a/parser_test.cpp b/parser_test.cpp index 7a073ce..5cf9ddb 100644 --- a/parser_test.cpp +++ b/parser_test.cpp @@ -1,6 +1,6 @@ // vim: set expandtab tabstop=4 shiftwidth=4: -//#include "chit.h" +#include "libbife/chit.h" #include "parser.h" #include #include @@ -16,15 +16,26 @@ int main(int argc, char* argv[]) { } else { file = argv[1]; } - //CHIT tpl; + CHIT tpl; cout << "Parser example:" << endl; cout << "===============" << endl; try { - Parser parser; + Parser parser("translate.translate"); parser.parse_file(file); + // Text is returned in utf-8 encoding. + cout << parser.root->render(tpl) << endl; } catch (exception e) { cerr << "Error: " << e.what() << endl; return 1; + } catch (string e) { + cerr << "Error: " << e << endl; + return 2; + } catch (const char* e) { + cerr << "Error: " << e << endl; + return 3; + } catch (...) { + cerr << "Unknown error!!!" << endl; + return -1; } return 0; }