mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 02:28:33 +00:00
Add support for _ binding patterns (#5097)
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
1 parent
d8d2da4ea0
commit
a584ee120e
15 files changed
+423
-45
No files matched your search
@@ -46,6 +46,9 @@ auto HandleBindingPattern(Context& context) -> void {
|
||||
// parameter list of a function.
|
||||
context.AddLeafNode(NodeKind::SelfValueName, *self);
|
||||
has_name = true;
|
||||
} else if (auto underscore = context.ConsumeIf(Lex::TokenKind::Underscore)) {
|
||||
context.AddLeafNode(NodeKind::UnderscoreName, *underscore);
|
||||
has_name = true;
|
||||
}
|
||||
if (!has_name) {
|
||||
// Add a placeholder for the name.
|
||||
|
||||
Reference in new issue
Block a user