Skip to content

fix: allow async as a contextual identifier - #442

Closed
DavidBakerEffendi wants to merge 1 commit into
tree-sitter:masterfrom
BrokkAi:fix-async-contextual-identifier
Closed

DavidBakerEffendi wants to merge 1 commit into
tree-sitter:masterfrom
BrokkAi:fix-async-contextual-identifier

Conversation

@DavidBakerEffendi

Copy link
Copy Markdown

Treat async as a contextual identifier in ordinary expression positions while preserving its structured modifier role for methods, local functions, lambdas, and anonymous methods.

For example, this valid C# currently produces a parse error because the argument is tokenized as a modifier instead of an identifier:

class C
{
    void M(bool async)
    {
        Use(async);
    }
}

The grammar now permits that identifier use while explicitly preferring the modifier interpretation where required. The corpus regression also keeps genuine async methods and lambdas structured.

Fixes part of #276

Treat async as an identifier outside modifier positions while preserving async methods, local functions, lambdas, and anonymous methods through explicit precedence. Add a focused corpus regression covering an async parameter used as an invocation argument alongside genuine async constructs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant