Add support for not followed by await expression

pull/904/head
Nathan Lovato 2025-09-28 16:44:32 +07:00
parent 55d1b51f9a
commit c6c60a0a87
2 changed files with 16 additions and 6 deletions

@ -562,12 +562,7 @@ module.exports = grammar({
// - Expressions - // - Expressions -
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
_expression: ($) => _expression: ($) => choice($._primary_expression, $.conditional_expression),
choice(
$._primary_expression,
$.conditional_expression,
$.await_expression,
),
_primary_expression: ($) => _primary_expression: ($) =>
choice( choice(
@ -590,6 +585,7 @@ module.exports = grammar({
$.array, $.array,
$.dictionary, $.dictionary,
$.parenthesized_expression, $.parenthesized_expression,
$.await_expression,
), ),
_rhs_expression: ($) => choice($._expression, $.lambda), _rhs_expression: ($) => choice($._expression, $.lambda),

@ -245,6 +245,20 @@ func x():
(variable_statement (name) (variable_statement (name)
(await_expression (attribute (get_node) (identifier))))))))) (await_expression (attribute (get_node) (identifier)))))))))
=====================================
Await Not Expression
=====================================
not await test()
---
(source
(expression_statement
(unary_operator
(await_expression
(call (identifier) (arguments))))))
===================================== =====================================
Breakpoint Statement Breakpoint Statement
===================================== =====================================