Switch Statement to std::variant (#639)

Aligns Assign/Assignment, If/IfStatement naming to favor the name in the enum.
This commit is contained in:
Jon Meow
2021-07-13 13:54:38 -07:00
committed by GitHub
parent b03d3cdbb0
commit 0960c51d20
5 changed files with 156 additions and 147 deletions
+3 -3
View File
@@ -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