Commit 7ae4de5e authored by Alastair Robertson's avatar Alastair Robertson

Don't exit(-1) on parsing errors

parent f0f978d2
......@@ -46,4 +46,14 @@ int Driver::parse_file(const std::string &f)
return result;
}
void Driver::error(const location &l, const std::string &m)
{
std::cerr << l << ": " << m << std::endl;
}
void Driver::error(const std::string &m)
{
std::cerr << m << std::endl;
}
} // namespace bpftrace
......@@ -20,17 +20,8 @@ public:
int parse_stdin();
int parse_str(const std::string &script);
int parse_file(const std::string &f);
void error(const location &l, const std::string &m)
{
std::cerr << l << ": " << m << std::endl;
exit(-1);
}
void error(const std::string &m)
{
std::cerr << m << std::endl;
}
void error(const location &l, const std::string &m);
void error(const std::string &m);
ast::Program *root_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment