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
2023-11-10 22:08:58 +00:00
committed by GitHub
parent b953fbf314
commit 0fb2924c99
5 changed files with 515 additions and 202 deletions
+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());
}
}