Create Error type (#1137)

Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Jon Meow
2022-03-17 10:22:02 -07:00
committed by GitHub
co-authored by Geoff Romer Chandler Carruth
parent 31fa2608d4
commit c546c81d07
7 changed files with 203 additions and 38 deletions
+4 -3
View File
@@ -314,10 +314,11 @@ string_literal \"([^\\\"\n\v\f\r]|\\.)*\"
break;
}
}
llvm::Expected<std::string> block_string = Carbon::ParseBlockStringLiteral(s);
if (!block_string) {
Carbon::ErrorOr<std::string> block_string =
Carbon::ParseBlockStringLiteral(s);
if (!block_string.ok()) {
FATAL_SYNTAX_ERROR(context)
<< "Invalid block string: " << toString(block_string.takeError());
<< "Invalid block string: " << block_string.error();
}
return ARG_TOKEN(string_literal, *block_string);
}