Replace int lines with file-associated SourceLocations (#779)

Most interesting changes should be ast/source_location.h and syntax/parse_and_lex_context.h
This commit is contained in:
Jon Meow
2021-08-26 10:07:16 -07:00
committed by GitHub
parent 33daf64329
commit 3ec550a85f
46 changed files with 607 additions and 518 deletions
@@ -6,14 +6,11 @@
namespace Carbon {
// Writes a syntax error diagnostic, containing message, for the input file at
// the given line, to standard error.
auto ParseAndLexContext::PrintDiagnostic(const std::string& message,
int line_num) -> void {
auto ParseAndLexContext::PrintDiagnostic(const std::string& message) -> void {
// TODO: Do we really want this to be fatal? It makes the comment and the
// name a lie, and renders some of the other yyparse() result propagation code
// moot.
FATAL_COMPILATION_ERROR(line_num) << message;
FATAL_COMPILATION_ERROR(SourceLoc()) << message;
}
} // namespace Carbon