Refactor state construction and change how the decl loop makes state. (#3467)

Building on #3463. The PushState+PopState to construct a state feels
worth cleanup. The rest is just kind of making it easier to do without
adding another PushState overload.
This commit is contained in:
Jon Ross-Perkins
2023-12-08 17:29:23 +00:00
committed by GitHub
parent 3b0923c81d
commit 50071532fe
5 changed files with 62 additions and 58 deletions
+5
View File
@@ -15,6 +15,11 @@
namespace Carbon::Parse {
auto HandleInvalid(Context& context) -> void {
CARBON_FATAL() << "The Invalid state shouldn't be on the stack: "
<< context.PopState();
}
auto Tree::Parse(Lex::TokenizedBuffer& tokens, DiagnosticConsumer& consumer,
llvm::raw_ostream* vlog_stream) -> Tree {
Lex::TokenLocationTranslator translator(&tokens);