Express prelude using Carbon syntax (#955)

This should be clearer, more maintainable, and more scalable than building the prelude AST by hand.
This commit is contained in:
Geoff Romer
2021-11-29 13:56:55 -08:00
committed by GitHub
parent b14c97d0d7
commit 3e188c8562
9 changed files with 106 additions and 38 deletions
+3
View File
@@ -89,6 +89,7 @@
%token <int> integer_literal
%token <std::string> identifier
%token <std::string> intrinsic_identifier
%token <std::string> sized_type_literal
%token <std::string> string_literal
%type <std::string> designator
@@ -302,6 +303,8 @@ expression:
| paren_expression { $$ = $1; }
| struct_literal { $$ = $1; }
| struct_type_literal { $$ = $1; }
| intrinsic_identifier tuple
{ $$ = arena->New<IntrinsicExpression>($1, $2, context.source_loc()); }
| expression EQUAL_EQUAL expression
{
$$ = arena->New<PrimitiveOperatorExpression>(