Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildGrammar v2.2.0 #1281

Merged
merged 1 commit into from
Mar 5, 2025
Merged

Conversation

Nigel-Ecma
Copy link
Contributor

• Add new MS Rules to provide actions & predicates for a number of C#’s
non-grammar rules:
- adjacency requirement for tokens in >> & >>=
- restrict places declaration expressions can be used – as the grammar for them is very loose
- type argument list disambiguation
- report semantic error if null-forgiving is applied to null-forgiving
- tweak order of choices in a couple of rules so Antlr picks the right one • Samples:

  • Reorganise
  • Spilt the large AllInOneNoPreproccesor-v6 into parts
  • Add new samples for new constructs
  • Switch them all to use the new Rules MS

Note: versioning plan for BuildGrammar vX.Y.Z, increment when:
X – the BuildGrammar tool or other tools change
Y – new modification sets added
Z – samples added
So this is version 2.2.0 as a new MS Rules was added along with new samples

 • Add new MS Rules to provide actions & predicates for a number of C#’s
   non-grammar rules:
    - adjacency requirement for tokens in >> & >>=
    - restrict places declaration expressions can be used – as the
      grammar for them is very loose
    - type argument list disambiguation
    - report semantic error if null-forgiving is applied to null-forgiving
    - tweak order of choices in a couple of rules so Antlr picks the right one
• Samples:
   - Reorganise
   - Spilt the large AllInOneNoPreproccesor-v6 into parts
   - Add new samples for new constructs
   - Switch them all to use the new Rules MS
@Nigel-Ecma Nigel-Ecma added this to the C# 8.0 milestone Mar 3, 2025
@Nigel-Ecma Nigel-Ecma requested review from jskeet and BillWagner March 3, 2025 01:44
@Nigel-Ecma Nigel-Ecma self-assigned this Mar 3, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

I went through this in some detail. I admit I got lost in a couple places, but overall it looks good.

What should we be looking for that will run differently once this is merged?

@Nigel-Ecma
Copy link
Contributor Author

@BillWagner – Thanks Bill.

Nothing should obviously run differently, unless we break the grammar moving forward – and it now tests for more things, including for the first time things that are expected not to parse.

Developing it did uncover some issues in the Standard and it will form the basis for tests for a few upcoming issues/PRs to fix those – I'm currently working on §6.2.5 Grammar Ambiguities which is no longer correct…

@BillWagner
Copy link
Member

I would still like @jskeet to take a look, just so he's familiar with this, but I'll merge today to keep our ANTLR testing moving forward.

@BillWagner BillWagner merged commit 046b37a into dotnet:draft-v8 Mar 5, 2025
5 checks passed
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.

2 participants