Track params in the parser (#4777)

This change splits `NodeKind::IdentifierName` into separate node kinds
depending on whether the identifier is followed by parameters, and
similarly splits `NameQualifier` based on whether the qualifier has
parameters. This enables us to only push a pattern block when it's
actually needed, rather than "defensively" pushing one when it might be
needed.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Geoff Romer
2025-01-10 22:11:07 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 8f685b6953
commit 4f10735751
297 changed files with 942 additions and 905 deletions
@@ -14,7 +14,7 @@ fn foo[]();
// CHECK:STDOUT: parse_tree: [
// CHECK:STDOUT: {kind: 'FileStart', text: ''},
// CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
// CHECK:STDOUT: {kind: 'IdentifierName', text: 'foo'},
// CHECK:STDOUT: {kind: 'IdentifierNameBeforeParams', text: 'foo'},
// CHECK:STDOUT: {kind: 'ImplicitParamListStart', text: '['},
// CHECK:STDOUT: {kind: 'ImplicitParamList', text: ']', subtree_size: 2},
// CHECK:STDOUT: {kind: 'TuplePatternStart', text: '('},