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 authored and GitHub committed 2021-08-26 10:07:16 -07:00
1 parent 33daf64329
commit 3ec550a85f
46 files changed
+607 -518

No files matched your search

+3 -3
View File
@@ -130,9 +130,9 @@ void Statement::PrintDepth(int depth, llvm::raw_ostream& out) const {
}
}
Return::Return(int line_num, const Expression* exp, bool is_omitted_exp)
: Statement(Kind::Return, line_num),
exp(exp != nullptr ? exp : global_arena->RawNew<TupleLiteral>(line_num)),
Return::Return(SourceLocation loc, const Expression* exp, bool is_omitted_exp)
: Statement(Kind::Return, loc),
exp(exp != nullptr ? exp : global_arena->RawNew<TupleLiteral>(loc)),
is_omitted_exp(is_omitted_exp) {
CHECK(exp != nullptr || is_omitted_exp);
}