Migrate remaining exits to FATAL_*_ERROR calls (#704)

Adds FATAL for things that are most likely programming errors in executable_semantics.
This commit is contained in:
Jon Meow
2021-08-06 13:06:25 -07:00
committed by GitHub
parent 5749413b28
commit 2e9e4f4cb3
23 changed files with 99 additions and 150 deletions
+2 -4
View File
@@ -4,8 +4,6 @@
#include "executable_semantics/syntax/parse.h"
#include <iostream>
#include "common/check.h"
#include "executable_semantics/common/error.h"
#include "executable_semantics/common/tracing_flag.h"
@@ -23,8 +21,8 @@ auto parse(const std::string& input_file_name)
-> std::variant<AST, SyntaxErrorCode> {
yyin = fopen(input_file_name.c_str(), "r");
if (yyin == nullptr) {
FATAL_USER_ERROR_NO_LINE() << "Error opening '" << input_file_name
<< "': " << std::strerror(errno);
FATAL_PROGRAM_ERROR_NO_LINE() << "Error opening '" << input_file_name
<< "': " << std::strerror(errno);
}
std::optional<AST> parsed_input = std::nullopt;