25 writes to Kind
System.Text.RegularExpressions (25)
System\Text\RegularExpressions\RegexNode.cs (25)
53
Kind
= kind;
59
Kind
= kind;
66
Kind
= kind;
73
Kind
= kind;
80
Kind
= kind;
152
Kind
+= kind - RegexNodeKind.One;
172
Kind
+= RegexNodeKind.Oneloopatomic - RegexNodeKind.Oneloop;
179
Kind
+= RegexNodeKind.Oneloopatomic - RegexNodeKind.Onelazy;
189
Kind
= RegexNodeKind.Empty;
197
Kind
= RegexNodeKind.Multi;
208
Kind
= RegexNodeKind.Atomic;
228
Kind
= RegexNodeKind.Empty;
963
Kind
= RegexNodeKind.Nothing;
970
Kind
=
980
Kind
=
1155
prev.
Kind
= RegexNodeKind.Set;
1438
node.
Kind
= RegexNodeKind.Empty;
1447
node.
Kind
= RegexNodeKind.Empty;
1452
node.
Kind
= RegexNodeKind.One;
1777
prev.
Kind
= RegexNodeKind.Multi;
1922
nextNode.
Kind
= RegexNodeKind.One;
1945
currentNode.
Kind
= nextNode.Kind;
2067
node.
Kind
-= RegexNodeKind.Onelazy - RegexNodeKind.Oneloop; // lazy to greedy
2225
Kind
= RegexNodeKind.Nothing;
3070
Kind
= RegexNodeKind.Multi;
314 references to Kind
System.Text.RegularExpressions (314)
System\Text\RegularExpressions\RegexCompiler.cs (70)
1268
Debug.Assert(target.LoopNode.
Kind
is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic);
1451
Debug.Assert(node.
Kind
== RegexNodeKind.Capture, "Every generated tree should begin with a capture node");
1459
switch (node.
Kind
)
1467
int length = node.
Kind
== RegexNodeKind.Multi ? node.Str!.Length : 1;
1667
Debug.Assert(node.
Kind
is RegexNodeKind.Alternate, $"Unexpected type: {node.
Kind
}");
2025
switch (child.
Kind
)
2039
case RegexNodeKind.Concatenate when child.Child(0) == startingLiteralNode && (startingLiteralNode.
Kind
is RegexNodeKind.One or RegexNodeKind.Set or RegexNodeKind.Multi):
2049
child.Child(0).
Kind
is RegexNodeKind.Multi ?
2089
Debug.Assert(multi.
Kind
is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.
Kind
}");
2099
Debug.Assert(node.
Kind
is RegexNodeKind.Backreference, $"Unexpected type: {node.
Kind
}");
2274
Debug.Assert(node.
Kind
is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.
Kind
}");
2288
RegexNode? noBranch = node.Child(1) is {
Kind
: not RegexNodeKind.Empty } childNo ? childNo : null;
2433
Debug.Assert(node.
Kind
is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.
Kind
}");
2449
RegexNode? noBranch = node.Child(2) is {
Kind
: not RegexNodeKind.Empty } childNo ? childNo : null;
2626
Debug.Assert(node.
Kind
is RegexNodeKind.Capture, $"Unexpected type: {node.
Kind
}");
2752
Debug.Assert(node.
Kind
is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.
Kind
}");
2796
Debug.Assert(node.
Kind
is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.
Kind
}");
2945
switch (node.
Kind
)
3049
Debug.Fail($"Unexpected node type: {node.
Kind
}");
3055
Debug.Assert(node.
Kind
is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.
Kind
}");
3056
Debug.Assert(node.
Kind
is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}");
3062
if (node.
Kind
is RegexNodeKind.Atomic && !analysis.MayBacktrack(child))
3099
Debug.Assert(node.
Kind
is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.
Kind
}");
3119
Debug.Assert(node.
Kind
is RegexNodeKind.Concatenate, $"Unexpected type: {node.
Kind
}");
3177
if (next.
Kind
is not RegexNodeKind.UpdateBumpalong) // skip node types that don't have a semantic impact
3190
Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.
Kind
}");
3265
Debug.Assert(node.
Kind
is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected type: {node.
Kind
}");
3281
switch (node.
Kind
)
3297
if (node.
Kind
is RegexNodeKind.Boundary)
3310
if (node.
Kind
is RegexNodeKind.ECMABoundary)
3325
Debug.Assert(node.
Kind
is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.
Kind
}");
3330
switch (node.
Kind
)
3344
if (node.
Kind
== RegexNodeKind.Beginning)
3463
Debug.Assert(node.
Kind
is RegexNodeKind.Multi, $"Unexpected type: {node.
Kind
}");
3515
Debug.Assert(node.
Kind
is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.
Kind
}");
3731
Debug.Assert(node.
Kind
is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.
Kind
}");
3832
node.
Kind
is RegexNodeKind.Notonelazy &&
3973
node.
Kind
is RegexNodeKind.Setlazy &&
4078
Debug.Assert(node.
Kind
is RegexNodeKind.Lazyloop, $"Unexpected type: {node.
Kind
}");
4440
Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.
Kind
}");
4589
Debug.Assert(node.
Kind
is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.
Kind
}");
4836
Debug.Assert(node.
Kind
is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.
Kind
}");
4925
Debug.Assert(node.
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.
Kind
}");
4929
Debug.Assert(!analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.
Kind
}");
4963
Debug.Assert(node.
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.
Kind
}");
5361
if (node.
Kind
== RegexNodeKind.Multi)
5394
if (node.
Kind
== RegexNodeKind.Multi)
5587
if (root.
Kind
is RegexNodeKind.Multi or RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set)
5605
Ldc((root.
Kind
== RegexNodeKind.Multi ? root.Str!.Length : 1) * (!rtl ? 1 : -1));
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
822
Debug.Assert(loopNode.
Kind
is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic);
System\Text\RegularExpressions\RegexNode.cs (181)
89
Debug.Assert(
Kind
is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or
95
new RegexNode(
Kind
, Options, Str!) :
96
new RegexNode(
Kind
, Options, Ch);
138
Kind
== RegexNodeKind.Concatenate &&
167
switch (
Kind
)
193
else if (
Kind
== RegexNodeKind.Oneloopatomic && N is >= 2 and <= MultiVsRepeaterLimit)
205
if (Parent is not {
Kind
: RegexNodeKind.Atomic })
233
Debug.Fail($"Unexpected type: {
Kind
}");
243
Debug.Assert(
Kind
== RegexNodeKind.Capture, "Every generated tree should begin with a capture node");
262
Debug.Assert(
Kind
!= RegexNodeKind.Group, "All Group nodes should have been removed.");
265
switch (node.
Kind
)
298
Debug.Assert(childCount == 0, $"Expected zero children for {node.
Kind
}, got {childCount}.");
307
Debug.Assert(childCount == 1, $"Expected one and only one child for {node.
Kind
}, got {childCount}.");
311
Debug.Assert(childCount == 2, $"Expected two children for {node.
Kind
}, got {childCount}");
315
Debug.Assert(childCount == 3, $"Expected three children for {node.
Kind
}, got {childCount}");
320
Debug.Assert(childCount >= 2, $"Expected at least two children for {node.
Kind
}, got {childCount}.");
324
Debug.Fail($"Unexpected node type: {node.
Kind
}");
329
switch (node.
Kind
)
340
Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.
Kind
}.");
344
Debug.Assert(node.Str is null, $"Expected null string for {node.
Kind
}, got \"{node.Str}\".");
349
switch (node.
Kind
)
355
Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.
Kind
} node should not have RegexOptions.IgnoreCase");
372
Debug.Assert(rootNode.
Kind
== RegexNodeKind.Capture);
413
switch (node.
Kind
)
426
if (node.Parent is {
Kind
: RegexNodeKind.Concatenate } parent)
471
switch (node.
Kind
)
498
if ((existingChild.
Kind
is RegexNodeKind.Alternate or RegexNodeKind.BackreferenceConditional or RegexNodeKind.ExpressionConditional or RegexNodeKind.Loop or RegexNodeKind.Lazyloop) &&
499
node.Parent is not {
Kind
: RegexNodeKind.Atomic }) // validate grandparent isn't atomic
521
if (node.
Kind
!= RegexNodeKind.ExpressionConditional) // ReduceExpressionConditional will have already applied ending backtracking removal
542
Debug.Assert(node.
Kind
is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
544
if (node.
Kind
is RegexNodeKind.Atomic)
547
Debug.Assert(node.
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
550
if (node.
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop)
577
switch (
Kind
)
589
return
Kind
switch
612
Debug.Assert(
Kind
is RegexNodeKind.Alternate or RegexNodeKind.Concatenate);
615
0 => new RegexNode(
Kind
== RegexNodeKind.Alternate ? RegexNodeKind.Nothing : RegexNodeKind.Empty, Options),
629
Debug.Assert(
Kind
== RegexNodeKind.Group);
632
while (u.
Kind
== RegexNodeKind.Group)
657
Debug.Assert(
Kind
== RegexNodeKind.Atomic);
662
while (child.
Kind
== RegexNodeKind.Atomic)
668
switch (child.
Kind
)
704
if (branches[0].
Kind
== RegexNodeKind.Empty)
715
if (branches[i].
Kind
== RegexNodeKind.Empty)
796
(child.Child(0).
Kind
is RegexNodeKind.Empty || child.Child(1).
Kind
is RegexNodeKind.Empty); // can be transformed into a ? or ??
811
return child.
Kind
== RegexNodeKind.Empty ?
826
Debug.Assert(
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
829
RegexNodeKind kind =
Kind
;
839
if (child.
Kind
!= kind)
844
switch (child.
Kind
)
858
switch (child.
Kind
)
905
switch (child.
Kind
)
910
child.MakeRep(u.
Kind
== RegexNodeKind.Lazyloop ? RegexNodeKind.Onelazy : RegexNodeKind.Oneloop, u.M, u.N);
958
Debug.Assert(
Kind
is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy);
971
Kind
== RegexNodeKind.Set ? RegexNodeKind.One :
972
Kind
== RegexNodeKind.Setloop ? RegexNodeKind.Oneloop :
973
Kind
== RegexNodeKind.Setloopatomic ? RegexNodeKind.Oneloopatomic :
981
Kind
== RegexNodeKind.Set ? RegexNodeKind.Notone :
982
Kind
== RegexNodeKind.Setloop ? RegexNodeKind.Notoneloop :
983
Kind
== RegexNodeKind.Setloopatomic ? RegexNodeKind.Notoneloopatomic :
1018
Debug.Assert(
Kind
== RegexNodeKind.Alternate);
1031
if (node.
Kind
== RegexNodeKind.Alternate)
1034
if (node.
Kind
== RegexNodeKind.Alternate)
1037
if (node.
Kind
== RegexNodeKind.Alternate)
1045
if (node.
Kind
is RegexNodeKind.Alternate && node.ChildCount() == 2)
1047
if (node.Child(1).
Kind
is RegexNodeKind.Empty)
1051
else if (node.Child(0).
Kind
is RegexNodeKind.Empty)
1088
if (at.
Kind
== RegexNodeKind.Alternate)
1106
else if (at.
Kind
is RegexNodeKind.Set or RegexNodeKind.One)
1111
if (at.
Kind
== RegexNodeKind.Set)
1135
if (prev.
Kind
== RegexNodeKind.One)
1145
if (at.
Kind
== RegexNodeKind.One)
1162
else if (at.
Kind
== RegexNodeKind.Nothing)
1186
Debug.Assert(alternation.
Kind
== RegexNodeKind.Alternate);
1199
if (child.
Kind
!= RegexNodeKind.Concatenate || child.ChildCount() < 2)
1214
switch (required.
Kind
)
1234
if (required.
Kind
!= other.
Kind
||
1260
if (alternation.Parent is RegexNode {
Kind
: RegexNodeKind.Atomic })
1285
Debug.Assert(node.
Kind
== RegexNodeKind.Alternate);
1294
switch (child.
Kind
)
1328
Debug.Assert(alternation.
Kind
== RegexNodeKind.Alternate);
1355
if (startingNode.
Kind
== RegexNodeKind.One)
1375
if (startingNode.
Kind
== RegexNodeKind.One)
1389
Debug.Assert(startingNode.
Kind
== RegexNodeKind.Multi);
1426
ProcessOneOrMulti(branch.
Kind
== RegexNodeKind.Concatenate ? branch.Child(0) : branch, startingSpan);
1434
if (node.
Kind
== RegexNodeKind.One)
1443
Debug.Assert(node.
Kind
== RegexNodeKind.Multi);
1464
if (alternation.Parent is RegexNode parent && parent.
Kind
== RegexNodeKind.Atomic)
1491
RegexNode branch =
Kind
== RegexNodeKind.Concatenate ? Child(0) : this;
1492
return branch.
Kind
is RegexNodeKind.One or RegexNodeKind.Multi ? branch : null;
1498
Debug.Assert(
Kind
is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0));
1513
Debug.Assert(
Kind
is RegexNodeKind.Alternate);
1537
if (startingLiteralNode.IsOneFamily || startingLiteralNode.
Kind
is RegexNodeKind.Multi)
1581
switch (node.
Kind
)
1616
switch (node.
Kind
)
1683
Debug.Assert(
Kind
== RegexNodeKind.Concatenate);
1699
if (child.
Kind
== RegexNodeKind.Nothing)
1725
Debug.Assert(
Kind
== RegexNodeKind.Concatenate);
1742
if (at.
Kind
== RegexNodeKind.Concatenate &&
1761
else if (at.
Kind
is RegexNodeKind.Multi or RegexNodeKind.One)
1775
if (prev.
Kind
== RegexNodeKind.One)
1782
((at.
Kind
== RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) :
1783
((at.
Kind
== RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str);
1785
else if (at.
Kind
== RegexNodeKind.Empty)
1808
Debug.Assert(
Kind
== RegexNodeKind.Concatenate);
1843
switch (currentNode.
Kind
)
1846
case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy when nextNode.
Kind
== currentNode.
Kind
&& currentNode.Ch == nextNode.Ch:
1847
case RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy when nextNode.
Kind
== currentNode.
Kind
&& currentNode.Str == nextNode.Str:
1849
currentNode.
Kind
is RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloopatomic)
1872
case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.
Kind
== RegexNodeKind.One && currentNode.Ch == nextNode.Ch:
1873
case RegexNodeKind.Notoneloop or RegexNodeKind.Notonelazy when nextNode.
Kind
== RegexNodeKind.Notone && currentNode.Ch == nextNode.Ch:
1874
case RegexNodeKind.Setloop or RegexNodeKind.Setlazy when nextNode.
Kind
== RegexNodeKind.Set && currentNode.Str == nextNode.Str:
1889
nextNode.
Kind
== RegexNodeKind.Multi &&
1940
case RegexNodeKind.One when (nextNode.
Kind
is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch:
1941
case RegexNodeKind.Notone when (nextNode.
Kind
is RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy) && currentNode.Ch == nextNode.Ch:
1942
case RegexNodeKind.Set when (nextNode.
Kind
is RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) && currentNode.Str == nextNode.Str:
1945
currentNode.Kind = nextNode.
Kind
;
1955
case RegexNodeKind.Notone when nextNode.
Kind
== currentNode.
Kind
&& currentNode.Ch == nextNode.Ch:
1956
case RegexNodeKind.Set when nextNode.
Kind
== RegexNodeKind.Set && currentNode.Str == nextNode.Str:
1967
when nextNode.
Kind
== currentNode.
Kind
:
2010
if (
Kind
is not RegexNodeKind.Concatenate)
2034
while (node.
Kind
is RegexNodeKind.Capture or RegexNodeKind.Concatenate)
2040
switch (node.
Kind
)
2086
while (loopChild.
Kind
is RegexNodeKind.Capture or RegexNodeKind.Concatenate)
2091
if (loopChild.
Kind
is
2099
else if (node.
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop)
2142
for (int b = node.
Kind
== RegexNodeKind.ExpressionConditional ? 1 : 0; b < alternateBranches; b++)
2156
Debug.Assert(
Kind
is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround);
2164
if (
Kind
is RegexNodeKind.NegativeLookaround && ContainsKind(Child(0), [RegexNodeKind.Backreference, RegexNodeKind.BackreferenceConditional]) is false)
2179
if (node is {
Kind
: RegexNodeKind.Capture, N: -1 })
2210
if (
Kind
is RegexNodeKind.PositiveLookaround)
2212
if (((Options & RegexOptions.RightToLeft) == 0 && IsZeroWidthAssertion(child.
Kind
)) ||
2213
child.
Kind
is RegexNodeKind.Empty)
2218
else if (
Kind
is RegexNodeKind.NegativeLookaround)
2223
if (child.
Kind
is RegexNodeKind.Empty)
2248
if (node.
Kind
== kind)
2276
Debug.Assert(
Kind
== RegexNodeKind.BackreferenceConditional);
2294
Debug.Assert(
Kind
== RegexNodeKind.ExpressionConditional);
2312
if (condition.
Kind
== RegexNodeKind.PositiveLookaround && (condition.Options & RegexOptions.RightToLeft) == 0)
2339
while (node.
Kind
is RegexNodeKind.Capture or RegexNodeKind.Concatenate)
2353
switch (subsequent.
Kind
)
2393
switch (subsequent.
Kind
)
2409
switch (node.
Kind
)
2413
switch (subsequent.
Kind
)
2443
switch (subsequent.
Kind
)
2462
switch (subsequent.
Kind
)
2509
switch (subsequent.
Kind
)
2551
switch (parent?.
Kind
)
2598
Debug.Assert(node.
Kind
is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation.");
2609
switch (parent.
Kind
)
2651
switch (
Kind
)
2746
Debug.Fail($"Unknown node: {
Kind
}");
2764
switch (
Kind
)
2824
int i =
Kind
== RegexNodeKind.BackreferenceConditional ? 0 : 1;
2883
Debug.Fail($"Unknown node: {
Kind
}");
2907
Debug.Assert(
Kind
== RegexNodeKind.Concatenate, $"Expected Concatenate, got {
Kind
}");
2920
if (child.
Kind
is RegexNodeKind.One)
2933
else if (child.
Kind
is RegexNodeKind.Multi)
2945
else if (child.
Kind
is RegexNodeKind.Set ||
2946
(child.
Kind
is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.M == child.N))
2955
vsb.Append((char)(twoChars[0] | 0x20), child.
Kind
is RegexNodeKind.Set ? 1 : child.M);
2957
else if (child.
Kind
is RegexNodeKind.Empty)
2962
else if (consumeZeroWidthNodes && IsZeroWidthAssertion(child.
Kind
))
3008
Debug.Assert(
Kind
== RegexNodeKind.Concatenate, $"Expected Concatenate, got {
Kind
}");
3010
static bool CanJoinLengthCheck(RegexNode node) => node.
Kind
switch
3064
case <= MultiVsRepeaterLimit when
Kind
== RegexNodeKind.One:
3077
switch (
Kind
)
3209
public bool IsSetFamily =>
Kind
is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy;
3212
public bool IsOneFamily =>
Kind
is RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy;
3215
public bool IsNotoneFamily =>
Kind
is RegexNodeKind.Notone or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy;
3254
var sb = new StringBuilder(
Kind
.ToString());
3264
switch (
Kind
)
3303
switch (
Kind
)
System\Text\RegularExpressions\RegexParser.cs (6)
1004
if (_group!.
Kind
!= RegexNodeKind.ExpressionConditional)
1142
if (result != null && result.
Kind
== RegexNodeKind.Backreference && (result.Options & RegexOptions.IgnoreCase) != 0)
2034
if (_group.
Kind
== RegexNodeKind.ExpressionConditional && _group.ChildCount() == 0)
2059
if (_group!.
Kind
is RegexNodeKind.ExpressionConditional or RegexNodeKind.BackreferenceConditional)
2074
if (_group!.
Kind
is RegexNodeKind.ExpressionConditional or RegexNodeKind.BackreferenceConditional)
2078
if (_group.
Kind
== RegexNodeKind.BackreferenceConditional && _group.ChildCount() > 2 || _group.ChildCount() > 3)
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (27)
80
switch (node.
Kind
)
114
int reps = node.
Kind
is RegexNodeKind.One ? 1 : Math.Min(node.M, MaxPrefixLength);
119
return node.
Kind
is RegexNodeKind.One || reps == node.N;
164
int reps = node.
Kind
is RegexNodeKind.Set ? 1 : Math.Min(node.M, MaxPrefixLength);
209
return node.
Kind
is RegexNodeKind.Set || reps == node.N;
360
switch (node.
Kind
)
489
switch (node.
Kind
)
598
switch (node.
Kind
)
950
switch (node.
Kind
)
959
return node.
Kind
is RegexNodeKind.One || node.M > 0 ? true : null;
977
return node.
Kind
is RegexNodeKind.Notone || node.M > 0 ? true : null;
996
node.
Kind
is RegexNodeKind.Set || node.M > 0 ? true :
1104
int branchStart = node.
Kind
is RegexNodeKind.BackreferenceConditional ? 0 : 1;
1118
Debug.Fail($"Unexpected node {node.
Kind
}");
1138
while (node.
Kind
is RegexNodeKind.Atomic or RegexNodeKind.Capture)
1142
if (node.
Kind
!= RegexNodeKind.Concatenate)
1155
while (firstChild.
Kind
is RegexNodeKind.Atomic or RegexNodeKind.Capture)
1159
if (firstChild.
Kind
is not (RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) || firstChild.N != int.MaxValue)
1167
if (nextChild.
Kind
== RegexNodeKind.UpdateBumpalong)
1224
while ((nextChild.
Kind
is RegexNodeKind.Atomic or RegexNodeKind.Capture or RegexNodeKind.Concatenate) ||
1225
(nextChild.
Kind
is RegexNodeKind.Loop or RegexNodeKind.Lazyloop && nextChild.M >= 1))
1233
(nextChild.
Kind
is RegexNodeKind.Set || nextChild.M >= 1))
1277
switch (node.
Kind
)
1349
switch (node.
Kind
)
1358
return node.
Kind
;
1386
switch (tmpChild.
Kind
)
1416
if (node.Child(i).
Kind
is not (RegexNodeKind.Empty or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround))
System\Text\RegularExpressions\RegexReplacement.cs (4)
36
Debug.Assert(concat.
Kind
== RegexNodeKind.Concatenate, $"Expected Concatenate, got {concat.
Kind
}");
48
switch (child.
Kind
)
77
Debug.Fail($"Unexpected child kind {child.
Kind
}");
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (3)
47
switch (node.
Kind
)
59
switch (node.
Kind
)
90
bool treatChildAsAtomic = (isAtomicByAncestor | isAtomicBySelf) && node.
Kind
switch
System\Text\RegularExpressions\RegexWriter.cs (11)
85
EmitFragment(curNode.
Kind
, curNode, 0);
89
EmitFragment(curNode.
Kind
| BeforeChild, curNode, curChild);
105
EmitFragment(curNode.
Kind
| AfterChild, curNode, curChild);
383
Emit((RegexOpcode)node.
Kind
| bits, node.Ch);
394
Emit(((node.
Kind
is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) ?
399
Emit((RegexOpcode)node.
Kind
| bits, node.Ch, node.N == int.MaxValue ? int.MaxValue : node.N - node.M);
414
Emit((RegexOpcode)node.
Kind
| bits, stringCode, (node.N == int.MaxValue) ? int.MaxValue : node.N - node.M);
420
Emit((RegexOpcode)node.
Kind
| bits, StringCode(node.Str!));
424
Emit((RegexOpcode)node.
Kind
| bits, StringCode(node.Str!));
428
Emit((RegexOpcode)node.
Kind
| bits, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping));
443
Emit((RegexOpcode)node.
Kind
);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (11)
53
switch (node.
Kind
)
117
result.AddLast(_builder.CreateLoop(_builder.CreateSingleton(bdd), node.
Kind
is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy, node.M, node.N));
128
result.AddLast(_builder.CreateLoop(_builder.CreateSingleton(setBdd), node.
Kind
== RegexNodeKind.Setlazy, node.M, node.N));
178
throw new NotSupportedException(SR.Format(SR.NotSupported_NonBacktrackingConflictingExpression, node.
Kind
switch
195
string description = $"Unexpected ({nameof(RegexNodeKind)}: {node.
Kind
})";
209
switch (node.
Kind
)
260
result.AddLast(_builder.CreateLoop(body, node.
Kind
== RegexNodeKind.Lazyloop, node.M, node.N));
267
Debug.Assert(node.
Kind
== RegexNodeKind.Capture && node.N == -1);
285
Debug.Assert(rootResult.Count == 1 || root.
Kind
== RegexNodeKind.Concatenate || root.
Kind
== RegexNodeKind.Capture);
312
Debug.Assert(node.
Kind
== RegexNodeKind.Set);