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 authored and GitHub committed 2021-11-29 13:56:55 -08:00
1 parent b14c97d0d7
commit 3e188c8562
9 files changed
+106 -38

No files matched your search

+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>(