Support tuple patterns outside parameter lists (#4923)

Parameter lists need substantially different treatment than tuple
patterns in other contexts, so this change splits them into separate
parse node kinds.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Geoff RomerandJon Ross-Perkins authored and GitHub committed 2025-02-20 03:17:45 +00:00
1 parent 35f5a7f115
commit 74e1a9949f
201 files changed
+1680 -860

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ auto HandleChoiceAlternative(Context& context) -> void {
if (context.PositionIs(Lex::TokenKind::OpenParen)) {
context.AddLeafNode(NodeKind::IdentifierNameBeforeParams, *token);
context.PushState(State::PatternListAsTuple);
context.PushState(State::PatternListAsExplicit);
} else {
context.AddLeafNode(NodeKind::IdentifierNameNotBeforeParams, *token);
}