diff --git a/src/main.cpp b/src/main.cpp index ecfef8c..45e511a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,10 +36,18 @@ int main(int argc, char* argv[]) { EvalResult res = eval(ast); cout << get(res) << endl; + } catch (const TokenError& e) { + pretty_print_error(input, e.pos); + cout << BOLD RED "Token Error: " RESET << e.what() << endl; + } catch (const SyntaxError& e) { pretty_print_error(input, e.pos); cout << BOLD RED "Syntax Error: " RESET << e.what() << endl; + } catch (const RuntimeError& e) { + pretty_print_error(input, e.pos); + cout << BOLD RED "Runtime Error: " RESET << e.what() << endl; + } catch (const ParseException& e) { cout << RED "ParsingError" RESET << endl; }