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:
Geoff Romer
2021-07-09 10:11:01 -07:00
committed by GitHub
parent 4f1b2198ff
commit b3d4c56ef2
7 changed files with 44 additions and 46 deletions
+2 -2
View File
@@ -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);
}