Skip to content

Incorporate using_declaration#1632

Open
BillWagner wants to merge 4 commits intodotnet:draft-v8from
BillWagner:using-declaration-grammar
Open

Incorporate using_declaration#1632
BillWagner wants to merge 4 commits intodotnet:draft-v8from
BillWagner:using-declaration-grammar

Conversation

@BillWagner
Copy link
Copy Markdown
Member

Fixes #1606.

Add the using_declaration to the ANTLR grammar for declaration_statement, In addition, add a sentence in the clause that points to the correct clause for the declaration.

Fixes dotnet#1606.

Add the using_declaration to the ANTLR grammar for *declaration_statement*, In addition, add a sentence in the clause that points to the correct clause for the declaration.
@BillWagner BillWagner requested review from Nigel-Ecma and jskeet April 9, 2026 18:07
Copy link
Copy Markdown
Contributor

@Nigel-Ecma Nigel-Ecma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grammar is fine (I have suggested a cosmetic rule name change), and this is a good place to link this in.

Unfortunately the using declaration differs from the others wrt to declaration spaces so adding it requires more prose work. The existing text for using statements & declarations in §13.14 itself does not directly discuss declaration spaces, instead relying on the reader to deduce this detail from the semantic equivalent code – that choice should be reviewed in light of this PR.

Comment thread standard/statements.md Outdated
Comment thread standard/statements.md Outdated
Comment thread standard/statements.md Outdated
Comment thread standard/statements.md Outdated
@BillWagner BillWagner added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label May 1, 2026
BillWagner added 3 commits May 1, 2026 13:44
§13.6.1 first sentence — added "or a local using scope" + switch_block carve-out.
§13.6.1 declaration-space sentence — added "Except for a using_declaration, …" qualifier and the new-scope explanation.
§13.14.2 — added the explicit declaration-space/scope sentence after the lifetime sentence.
§13.14.2 — fixed switch_label → switch_block.
Change *using_declaration* to *local_using_declaration*
Respond to feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meeting: discuss This issue should be discussed at the next TC49-TG2 meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EBNF error with declaration_statement or embedded_statement (draft-v8).

2 participants