45 references to Empty
System.Text.RegularExpressions.Generator (45)
parent\src\System\Text\RegularExpressions\RegexNode.cs (32)
189
Kind = RegexNodeKind.
Empty
;
228
Kind = RegexNodeKind.
Empty
;
589
Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.
Empty
or RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
662
0 => new RegexNode(Kind == RegexNodeKind.Alternate ? RegexNodeKind.Nothing : RegexNodeKind.
Empty
, Options),
719
case RegexNodeKind.
Empty
:
759
if (branches[0].Kind == RegexNodeKind.
Empty
)
761
return new RegexNode(RegexNodeKind.
Empty
, child.Options);
770
if (branches[i].Kind == RegexNodeKind.
Empty
)
851
(child.Child(0).Kind is RegexNodeKind.
Empty
|| child.Child(1).Kind is RegexNodeKind.
Empty
); // can be transformed into a ? or ??
866
return child.Kind == RegexNodeKind.
Empty
?
969
case RegexNodeKind.
Empty
:
990
u = u.M == 0 ? new RegexNode(RegexNodeKind.
Empty
, Options) : child;
1102
if (node.Child(1).Kind is RegexNodeKind.
Empty
)
1106
else if (node.Child(0).Kind is RegexNodeKind.
Empty
)
1311
newAlternate.AddChild(new RegexNode(RegexNodeKind.
Empty
, children[i].Options));
1352
case RegexNodeKind.
Empty
when !seenEmpty:
1356
case RegexNodeKind.
Empty
:
1497
node.Kind = RegexNodeKind.
Empty
;
1506
node.Kind = RegexNodeKind.
Empty
;
1748
return new RegexNode(RegexNodeKind.
Empty
, Options);
1844
else if (at.Kind == RegexNodeKind.
Empty
)
2278
child.Kind is RegexNodeKind.
Empty
)
2288
if (child.Kind is RegexNodeKind.
Empty
)
2350
AddChild(new RegexNode(RegexNodeKind.
Empty
, Options));
2368
AddChild(new RegexNode(RegexNodeKind.
Empty
, Options));
2910
case RegexNodeKind.
Empty
:
2937
goto case RegexNodeKind.
Empty
;
3048
case RegexNodeKind.
Empty
:
3074
goto case RegexNodeKind.
Empty
;
3190
else if (child.Kind is RegexNodeKind.
Empty
)
3291
return new RegexNode(RegexNodeKind.
Empty
, Options);
parent\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (7)
100
case RegexNodeKind.
Empty
:
469
case RegexNodeKind.
Empty
:
666
case RegexNodeKind.
Empty
:
1012
case RegexNodeKind.
Empty
:
1293
case RegexNodeKind.
Empty
:
1388
case RegexNodeKind.
Empty
or RegexNodeKind.NegativeLookaround:
1416
if (node.Child(i).Kind is not (RegexNodeKind.
Empty
or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround))
RegexGenerator.Emitter.cs (6)
760
if (root.Kind is RegexNodeKind.
Empty
)
1934
new RegexNode(RegexNodeKind.
Empty
, child.Options)); // single, so removing it yields empty
2287
RegexNode? noBranch = node.Child(1) is { Kind: not RegexNodeKind.
Empty
} childNo ? childNo : null;
2463
RegexNode? noBranch = node.Child(2) is { Kind: not RegexNodeKind.
Empty
} childNo ? childNo : null;
2894
case RegexNodeKind.
Empty
:
5599
RegexNodeKind.
Empty
=> $"Match an empty string.",