mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename "PatternVariable" names for clarity (#630)
Pretty much any names will be awkward, since these types represent cases where an `Expression` is not an expression, and a `Value` is not a value, but we can at least be more explicit about the fact that they represent bindings rather than variable usages.
This commit is contained in:
@@ -208,7 +208,7 @@ expression:
|
||||
{ $$ = Carbon::Expression::MakeIndexExpression(yylineno, $1, $3); }
|
||||
| identifier ":" expression
|
||||
{
|
||||
$$ = Carbon::Expression::MakePatternVariableExpression(yylineno, $1, $3);
|
||||
$$ = Carbon::Expression::MakeBindingExpression(yylineno, $1, $3);
|
||||
}
|
||||
| integer_literal
|
||||
{ $$ = Carbon::Expression::MakeIntLiteral(yylineno, $1); }
|
||||
@@ -310,7 +310,7 @@ clause:
|
||||
{ $$ = new std::pair<const Carbon::Expression*, const Carbon::Statement*>($2, $4); }
|
||||
| DEFAULT DBLARROW statement
|
||||
{
|
||||
auto vp = Carbon::Expression::MakePatternVariableExpression(
|
||||
auto vp = Carbon::Expression::MakeBindingExpression(
|
||||
yylineno, "_", Carbon::Expression::MakeAutoTypeLiteral(yylineno));
|
||||
$$ = new std::pair<const Carbon::Expression*, const Carbon::Statement*>(vp, $3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user