98 references to ChildCount
System.Text.RegularExpressions (98)
System\Text\RegularExpressions\RegexCompiler.cs (27)
1452
Debug.Assert(node.
ChildCount
() == 1, "Capture nodes should have one child");
1668
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
1670
int childCount = node.
ChildCount
();
2275
Debug.Assert(node.
ChildCount
() == 2, $"Expected 2 children, found {node.
ChildCount
()}");
2434
Debug.Assert(node.
ChildCount
() == 3, $"Expected 3 children, found {node.
ChildCount
()}");
2627
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2753
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2797
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
3056
Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.
ChildCount
() >= 1 : node.
ChildCount
() == 1, $"Unexpected number of children: {node.
ChildCount
()}");
3120
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
3123
int childCount = node.
ChildCount
();
3173
int childCount = node.
ChildCount
();
4081
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4928
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4966
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
System\Text\RegularExpressions\RegexNode.cs (43)
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)
1199
if (child.Kind != RegexNodeKind.Concatenate || child.
ChildCount
() < 2)
1286
Debug.Assert(node.
ChildCount
() >= 2);
1478
return alternation.
ChildCount
() == 1 ? alternation.Child(0) : alternation;
1523
int childCount =
ChildCount
();
1686
switch (
ChildCount
())
1695
int childCount =
ChildCount
();
2000
int childCount =
ChildCount
();
2036
node = node.Child(node.
ChildCount
() - 1);
2088
loopChild = loopChild.Child(loopChild.
ChildCount
() - 1);
2141
int alternateBranches = node.
ChildCount
();
2157
Debug.Assert(
ChildCount
() == 1);
2189
int childCount = node.
ChildCount
();
2261
int childCount = node.
ChildCount
();
2277
Debug.Assert(
ChildCount
() is 1 or 2);
2283
if (
ChildCount
() == 1)
2295
Debug.Assert(
ChildCount
() is 2 or 3);
2301
if (
ChildCount
() == 2)
2341
node = node.Child(node.
ChildCount
() - 1);
2392
int childCount = subsequent.
ChildCount
();
2683
int childCount =
ChildCount
();
2705
int childCount =
ChildCount
();
2717
Debug.Assert(
ChildCount
() == 1);
2800
int childCount =
ChildCount
();
2834
int childCount =
ChildCount
();
2855
Debug.Assert(
ChildCount
() == 1);
3026
int childCount =
ChildCount
();
3126
Debug.Assert(index <
ChildCount
());
3194
int childCount = node.
ChildCount
();
3227
if (curChild < curNode!.
ChildCount
())
System\Text\RegularExpressions\RegexParser.cs (3)
2034
if (_group.Kind == RegexNodeKind.ExpressionConditional && _group.
ChildCount
() == 0)
2078
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
());