97 references to ChildCount
System.Text.RegularExpressions (97)
System\Text\RegularExpressions\RegexCompiler.cs (27)
1433
Debug.Assert(node.
ChildCount
() == 1, "Capture nodes should have one child");
1649
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
1651
int childCount = node.
ChildCount
();
2029
Debug.Assert(node.
ChildCount
() == 2, $"Expected 2 children, found {node.
ChildCount
()}");
2188
Debug.Assert(node.
ChildCount
() == 3, $"Expected 3 children, found {node.
ChildCount
()}");
2388
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2514
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2565
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2830
Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.
ChildCount
() >= 1 : node.
ChildCount
() == 1, $"Unexpected number of children: {node.
ChildCount
()}");
2892
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
2895
int childCount = node.
ChildCount
();
2945
int childCount = node.
ChildCount
();
3853
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4700
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4738
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
System\Text\RegularExpressions\RegexNode.cs (42)
139
ChildCount
() > 1)
252
int childCount = node.
ChildCount
();
374
Debug.Assert(rootNode.
ChildCount
() == 1);
497
RegexNode existingChild = node.Child(node.
ChildCount
() - 1);
503
node.ReplaceChild(node.
ChildCount
() - 1, atomic);
515
int branches = node.
ChildCount
();
613
return
ChildCount
() switch
634
Debug.Assert(u.
ChildCount
() == 1);
658
Debug.Assert(
ChildCount
() == 1);
795
child.
ChildCount
() == 2 &&
834
while (u.
ChildCount
() > 0)
902
if (u.
ChildCount
() == 1)
1020
switch (
ChildCount
())
1045
if (node.Kind is RegexNodeKind.Alternate && node.
ChildCount
() == 2)
1208
if (child.Kind != RegexNodeKind.Concatenate || child.
ChildCount
() < 2)
1295
Debug.Assert(node.
ChildCount
() >= 2);
1487
return alternation.
ChildCount
() == 1 ? alternation.Child(0) : alternation;
1625
switch (
ChildCount
())
1634
int childCount =
ChildCount
();
1939
int childCount =
ChildCount
();
1975
node = node.Child(node.
ChildCount
() - 1);
2027
loopChild = loopChild.Child(loopChild.
ChildCount
() - 1);
2080
int alternateBranches = node.
ChildCount
();
2096
Debug.Assert(
ChildCount
() == 1);
2124
int childCount = node.
ChildCount
();
2196
int childCount = node.
ChildCount
();
2212
Debug.Assert(
ChildCount
() is 1 or 2);
2218
if (
ChildCount
() == 1)
2230
Debug.Assert(
ChildCount
() is 2 or 3);
2236
if (
ChildCount
() == 2)
2276
node = node.Child(node.
ChildCount
() - 1);
2327
int childCount = subsequent.
ChildCount
();
2618
int childCount =
ChildCount
();
2640
int childCount =
ChildCount
();
2652
Debug.Assert(
ChildCount
() == 1);
2735
int childCount =
ChildCount
();
2769
int childCount =
ChildCount
();
2790
Debug.Assert(
ChildCount
() == 1);
2961
int childCount =
ChildCount
();
3061
Debug.Assert(index <
ChildCount
());
3129
int childCount = node.
ChildCount
();
3162
if (curChild < curNode!.
ChildCount
())
System\Text\RegularExpressions\RegexParser.cs (3)
2052
if (_group.Kind == RegexNodeKind.ExpressionConditional && _group.
ChildCount
() == 0)
2096
if (_group.Kind == RegexNodeKind.BackreferenceConditional && _group.
ChildCount
() > 2 || _group.
ChildCount
() > 3)
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (14)
214
int childCount = node.
ChildCount
();
246
int childCount = node.
ChildCount
();
365
int childCount = node.
ChildCount
();
379
int childCount = node.
ChildCount
();
498
node.TryGetOrdinalCaseInsensitiveString(0, node.
ChildCount
(), out _, out string? caseInsensitiveString, consumeZeroWidthNodes: true);
698
int childCount = node.
ChildCount
();
711
int childCount = node.
ChildCount
();
1052
int childCount = node.
ChildCount
();
1083
int childCount = node.
ChildCount
();
1153
Debug.Assert(node.
ChildCount
() >= 2);
1169
if (node.
ChildCount
() == 2)
1311
int childCount = node.
ChildCount
();
1378
int childCount = node.
ChildCount
();
1489
int childCount = node.
ChildCount
();
System\Text\RegularExpressions\RegexReplacement.cs (1)
43
int childCount = concat.
ChildCount
();
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (1)
82
int childCount = node.
ChildCount
();
System\Text\RegularExpressions\RegexWriter.cs (3)
82
int curNodeChildCount = curNode.
ChildCount
();
221
if (curIndex < node.
ChildCount
() - 1)
230
if (curIndex < node.
ChildCount
() - 1)
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (6)
38
stack.Push((root, rootResult, CreateChildResultArray(root.
ChildCount
())));
90
Debug.Assert(childResults is not null && childResults.Length == node.
ChildCount
());
96
for (int i = 0; i < node.
ChildCount
(); ++i)
99
stack.Push((node.Child(i), childResults[i], CreateChildResultArray(node.Child(i).
ChildCount
())));
204
Debug.Assert(node.
ChildCount
() > 0);
206
Debug.Assert(childResults.Length == node.
ChildCount
());