Support parsing and testing unimplemented expressions (#957)

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
Geoff Romer
2021-11-30 12:29:15 -08:00
committed by GitHub
co-authored by Jon Meow
parent be0c1e9da6
commit dc5e62fc7a
23 changed files with 463 additions and 147 deletions
+7
View File
@@ -190,6 +190,7 @@
TRUE
TYPE
UNDERSCORE
UNIMPL_EXAMPLE
VAR
WHILE
// table-end
@@ -223,6 +224,7 @@
// same precedence as POSTFIX_STAR.
%precedence POSTFIX_STAR UNARY_STAR
%left PERIOD ARROW
%nonassoc UNIMPL_EXAMPLE
%precedence
LEFT_PARENTHESIS
RIGHT_PARENTHESIS
@@ -381,6 +383,11 @@ expression:
}
| FN_TYPE tuple ARROW expression
{ $$ = arena->New<FunctionTypeLiteral>(context.source_loc(), $2, $4); }
| expression UNIMPL_EXAMPLE expression
{
$$ = arena->New<UnimplementedExpression>(context.source_loc(),
"ExampleInfix", $1, $3);
}
;
designator: PERIOD identifier { $$ = $2; }
;