mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
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:
co-authored by
Jon Ross-Perkins
parent
8f685b6953
commit
4f10735751
@@ -97,8 +97,8 @@ TEST_F(TreeTest, PrintPostorderAsYAML) {
|
||||
Yaml::Mapping(ElementsAre(Pair("kind", "FileStart"), Pair("text", ""))),
|
||||
Yaml::Mapping(
|
||||
ElementsAre(Pair("kind", "FunctionIntroducer"), Pair("text", "fn"))),
|
||||
Yaml::Mapping(
|
||||
ElementsAre(Pair("kind", "IdentifierName"), Pair("text", "F"))),
|
||||
Yaml::Mapping(ElementsAre(Pair("kind", "IdentifierNameBeforeParams"),
|
||||
Pair("text", "F"))),
|
||||
Yaml::Mapping(
|
||||
ElementsAre(Pair("kind", "TuplePatternStart"), Pair("text", "("))),
|
||||
Yaml::Mapping(ElementsAre(Pair("kind", "TuplePattern"), Pair("text", ")"),
|
||||
@@ -131,7 +131,7 @@ TEST_F(TreeTest, PrintPreorderAsYAML) {
|
||||
Pair("kind", "FunctionIntroducer"),
|
||||
Pair("text", "fn"))),
|
||||
Yaml::Mapping(ElementsAre(Pair("node_index", "2"),
|
||||
Pair("kind", "IdentifierName"),
|
||||
Pair("kind", "IdentifierNameBeforeParams"),
|
||||
Pair("text", "F"))),
|
||||
Yaml::Mapping(ElementsAre(Pair("node_index", "4"),
|
||||
Pair("kind", "TuplePattern"), Pair("text", ")"),
|
||||
|
||||
Reference in New Issue
Block a user