mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Reverse 'type: identifier' to 'identifier: type' in executable
semantics.
This commit is contained in:
@@ -189,8 +189,8 @@ expression:
|
||||
{ $$ = Carbon::Expression::MakeGetField(yylineno, $1, $2); }
|
||||
| expression "[" expression "]"
|
||||
{ $$ = Carbon::Expression::MakeIndex(yylineno, $1, $3); }
|
||||
| expression ":" identifier
|
||||
{ $$ = Carbon::Expression::MakeVarPat(yylineno, $3, $1); }
|
||||
| identifier ":" expression
|
||||
{ $$ = Carbon::Expression::MakeVarPat(yylineno, $1, $3); }
|
||||
| integer_literal
|
||||
{ $$ = Carbon::Expression::MakeInt(yylineno, $1); }
|
||||
| TRUE
|
||||
@@ -340,8 +340,8 @@ function_declaration:
|
||||
FN identifier tuple return_type ";"
|
||||
{ $$ = MakeFunDef(yylineno, $2, $4, $3, 0); }
|
||||
;
|
||||
variable_declaration: expression ":" identifier
|
||||
{ $$ = MakeField(yylineno, $3, $1); }
|
||||
variable_declaration: identifier ":" expression
|
||||
{ $$ = MakeField(yylineno, $1, $3); }
|
||||
;
|
||||
member: VAR variable_declaration ";"
|
||||
{ $$ = $2; }
|
||||
|
||||
Reference in New Issue
Block a user