Replace throw 0 with real exceptions or assertions.

This commit is contained in:
2020-09-09 17:19:23 -07:00
parent e337992410
commit 9769b3e396
6 changed files with 46 additions and 22 deletions

View File

@@ -26,9 +26,9 @@ struct parse_driver {
parse_driver(const std::string& file)
: file_name(file), file_offset(0) {}
void run_parse() {
bool run_parse() {
file_stream.open(file_name);
if(!file_stream.good()) throw 0;
if(!file_stream.good()) return false;
line_offsets.push_back(0);
yyscan_t scanner;
scanner_init(this, &scanner);
@@ -36,6 +36,7 @@ struct parse_driver {
parser();
scanner_destroy(&scanner);
read_file = string_stream.str();
return true;
}
int get() {