mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 17:31:07 +01:00
Switch Statement to std::variant (#639)
Aligns Assign/Assignment, If/IfStatement naming to favor the name in the enum.
This commit is contained in:
@@ -327,9 +327,9 @@ statement:
|
||||
expression "=" expression ";"
|
||||
{ $$ = Carbon::Statement::MakeAssign(yylineno, $1, $3); }
|
||||
| VAR pattern "=" expression ";"
|
||||
{ $$ = Carbon::Statement::MakeVarDef(yylineno, $2, $4); }
|
||||
{ $$ = Carbon::Statement::MakeVariableDefinition(yylineno, $2, $4); }
|
||||
| expression ";"
|
||||
{ $$ = Carbon::Statement::MakeExpStmt(yylineno, $1); }
|
||||
{ $$ = Carbon::Statement::MakeExpressionStatement(yylineno, $1); }
|
||||
| IF "(" expression ")" statement optional_else
|
||||
{ $$ = Carbon::Statement::MakeIf(yylineno, $3, $5, $6); }
|
||||
| WHILE "(" expression ")" statement
|
||||
@@ -360,7 +360,7 @@ statement_list:
|
||||
// Empty
|
||||
{ $$ = 0; }
|
||||
| statement statement_list
|
||||
{ $$ = Carbon::Statement::MakeSeq(yylineno, $1, $2); }
|
||||
{ $$ = Carbon::Statement::MakeSequence(yylineno, $1, $2); }
|
||||
;
|
||||
return_type:
|
||||
// Empty
|
||||
|
||||
Reference in New Issue
Block a user