Extend description of parser states to show which tokens they consume. (#3378)

Also some minor improvements and typo fixes to the parser code for
issues found while writing these descriptions.
This commit is contained in:
Richard Smith authored and GitHub committed 2023-11-10 22:08:58 +00:00
1 parent b953fbf314
commit 0fb2924c99
5 files changed
+515 -202

No files matched your search

+2 -2
View File
@@ -24,10 +24,10 @@ auto HandleFunctionAfterParameters(Context& context) -> void {
context.PushState(state);
// If there is a return type, parse the expression before adding the return
// type nod.e
// type node.
if (context.PositionIs(Lex::TokenKind::MinusGreater)) {
context.PushState(State::FunctionReturnTypeFinish);
++context.position();
context.ConsumeAndDiscard();
context.PushStateForExpr(PrecedenceGroup::ForType());
}
}