Add support for _ placeholder. (#661)

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
Geoff Romer
2021-07-19 10:33:06 -07:00
committed by GitHub
co-authored by Jon Meow
parent c3c89a77a4
commit def98d1182
15 changed files with 88 additions and 20 deletions
+2
View File
@@ -56,6 +56,7 @@ CONTINUATION_TYPE "__Continuation"
CONTINUATION "__continuation"
RUN "__run"
AWAIT "__await"
UNDERSCORE "_"
identifier [A-Za-z_][A-Za-z0-9_]*
integer_literal [0-9]+
@@ -116,6 +117,7 @@ operand_start [(A-Za-z0-9_"]
{CONTINUATION} { return yy::parser::make_CONTINUATION(context.current_token_position); }
{RUN} { return yy::parser::make_RUN(context.current_token_position); }
{AWAIT} { return yy::parser::make_AWAIT(context.current_token_position); }
{UNDERSCORE} { return yy::parser::make_UNDERSCORE(context.current_token_position); }
"=" return yy::parser::make_EQUAL(context.current_token_position);
"-" return yy::parser::make_MINUS(context.current_token_position);