From 4cbf1ca75b4dfae5de7eef5e68316b3477559e86 Mon Sep 17 00:00:00 2001 From: Selfhosting Dev Date: Thu, 25 Sep 2025 06:37:27 +0900 Subject: [PATCH] =?UTF-8?q?parser(cursor):=20Step=E2=80=912=20cont.=20?= =?UTF-8?q?=E2=80=93=20add=20'await'=20unary=20in=20TokenCursor=20path=20(?= =?UTF-8?q?env=E2=80=91guarded);=20no=20default=20behavior=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parser/expr_cursor.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/parser/expr_cursor.rs b/src/parser/expr_cursor.rs index b6cf8aa4..1e8bb461 100644 --- a/src/parser/expr_cursor.rs +++ b/src/parser/expr_cursor.rs @@ -157,6 +157,15 @@ impl ExprParserWithCursor { span: Span::new(op_line, 0, op_line, 0), }) } + TokenType::AWAIT => { + let op_line = cursor.current().line; + cursor.advance(); + let expression = Self::parse_unary_expr(cursor)?; + Ok(ASTNode::AwaitExpression { + expression: Box::new(expression), + span: Span::new(op_line, 0, op_line, 0), + }) + } _ => Self::parse_postfix_expr(cursor), } }