Skip to content

Commit

Permalink
[Milestone] (#1281)
Browse files Browse the repository at this point in the history
• 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

Co-authored-by: Nigel-Ecma <Nigel-Ecma@users.noreply.github.com>
  • Loading branch information
Nigel-Ecma and Nigel-Ecma authored Mar 5, 2025
1 parent f885375 commit 046b37a
Show file tree
Hide file tree
Showing 192 changed files with 83,091 additions and 3 deletions.
Binary file modified .github/workflows/dependencies/GrammarTestingEnv.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/GrammarTesting/Tests/Parsing/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ The second set, in `Demo`, exist to demonstrate the system and are run when `Set
or `DoParsingTests` are passed the `-d` option.

If `Demo` is not here it will be in the environment parallel which can be located using the
environment variable `BG_LIB_PARSINGTESTS`.
environment variable `BG_LIB_PARSINGTESTS`.

This file was deleted.

6 changes: 6 additions & 0 deletions tools/GrammarTesting/Tests/Parsing/Samples/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Parsing Samples

Sub-directories are used to group related (in some way) tests.

The “v*n*” folders typically contain samples testing features introduced
in *or before* that version of C# – though nothing is enforced.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
extern alias Foo;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using M = System.Math;

using ConsoleApplication2.Test;

/**/
/* the previous comment is an empty delimited comment and not a document comment */
/** this is a document comment */
// this one is a single line comment

using X = int1;
using Y = ABC.X<int>;

using static System.Math;
using static System.DayOfWeek;
using static System.Linq.Enumerable;

[assembly: System.Copyright(@"(C)""
2009")]
[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")]

class TopLevelType : IDisposable
{
void IDisposable.Dispose() { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Sample: AllInOneNoPreprocessor-v6-*

This is a standard sample based off a test file originating with the Roslyn project.

The AllInOneNoPreprocessor-v6-* combined contain samples of most of the C# constructs up to C# v6.
Loading

0 comments on commit 046b37a

Please sign in to comment.