mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:11:11 +01:00
Switch Member to variant in anticipation of more kinds. (#656)
Note this overlaps a little with #644's Member changes, but not too badly.
This commit is contained in:
@@ -384,7 +384,7 @@ function_declaration:
|
||||
{ $$ = Carbon::FunctionDefinition(yylineno, $2, $3, $4, 0); }
|
||||
;
|
||||
variable_declaration: identifier ":" expression
|
||||
{ $$ = MakeField(yylineno, $1, $3); }
|
||||
{ $$ = Carbon::Member::MakeFieldMember(yylineno, $1, $3); }
|
||||
;
|
||||
member: VAR variable_declaration ";"
|
||||
{ $$ = $2; }
|
||||
@@ -433,7 +433,8 @@ declaration:
|
||||
| VAR variable_declaration "=" expression ";"
|
||||
{
|
||||
$$ = Carbon::Declaration(
|
||||
Carbon::VariableDeclaration(yylineno, *$2->u.field.name, $2->u.field.type, $4));
|
||||
Carbon::VariableDeclaration(yylineno, $2->GetFieldMember().name,
|
||||
$2->GetFieldMember().type, $4));
|
||||
}
|
||||
;
|
||||
declaration_list:
|
||||
|
||||
Reference in New Issue
Block a user