mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:51:16 +01:00
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:
@@ -6,7 +6,6 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
%{
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
#include "common/check.h"
|
||||
#include "executable_semantics/common/tracing_flag.h"
|
||||
@@ -215,11 +214,10 @@ operator and its operand, leading to three more cases:
|
||||
if (Carbon::tracing_output) {
|
||||
// Print a newline because tracing prints an incomplete line
|
||||
// "Reading a token: ".
|
||||
std::cerr << std::endl;
|
||||
llvm::errs() << "\n";
|
||||
}
|
||||
std::cerr << context.current_token_position << ": invalid character '\\x"
|
||||
<< llvm::toHex(llvm::StringRef(yytext, 1)) << "' in source file." << std::endl;
|
||||
std::exit(1);
|
||||
FATAL_COMPILATION_ERROR(yylineno) << "invalid character '\\x"
|
||||
<< llvm::toHex(llvm::StringRef(yytext, 1)) << "' in source file.";
|
||||
}
|
||||
|
||||
<<EOF>> {
|
||||
|
||||
Reference in New Issue
Block a user