98 references to ChildCount
System.Text.RegularExpressions (98)
System\Text\RegularExpressions\RegexCompiler.cs (27)
1453
Debug.Assert(node.
ChildCount
() == 1, "Capture nodes should have one child");
1669
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
1671
int childCount = node.
ChildCount
();
2291
Debug.Assert(node.
ChildCount
() == 2, $"Expected 2 children, found {node.
ChildCount
()}");
2450
Debug.Assert(node.
ChildCount
() == 3, $"Expected 3 children, found {node.
ChildCount
()}");
2643
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2769
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2813
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
3072
Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.
ChildCount
() >= 1 : node.
ChildCount
() == 1, $"Unexpected number of children: {node.
ChildCount
()}");
3136
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
3139
int childCount = node.
ChildCount
();
3189
int childCount = node.
ChildCount
();
4097
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4944
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4982
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)
1287
Debug.Assert(node.
ChildCount
() >= 2);
1479
return alternation.
ChildCount
() == 1 ? alternation.Child(0) : alternation;
1524
int childCount =
ChildCount
();
1687
switch (
ChildCount
())
1696
int childCount =
ChildCount
();
2001
int childCount =
ChildCount
();
2037
node = node.Child(node.
ChildCount
() - 1);
2089
loopChild = loopChild.Child(loopChild.
ChildCount
() - 1);
2148
int alternateBranches = node.
ChildCount
();
2164
Debug.Assert(
ChildCount
() == 1);
2196
int childCount = node.
ChildCount
();
2268
int childCount = node.
ChildCount
();
2284
Debug.Assert(
ChildCount
() is 1 or 2);
2290
if (
ChildCount
() == 1)
2302
Debug.Assert(
ChildCount
() is 2 or 3);
2308
if (
ChildCount
() == 2)
2348
node = node.Child(node.
ChildCount
() - 1);
2399
int childCount = subsequent.
ChildCount
();
2629
int childCount = node.
ChildCount
();
2736
int childCount =
ChildCount
();
2758
int childCount =
ChildCount
();
2770
Debug.Assert(
ChildCount
() == 1);
2853
int childCount =
ChildCount
();
2887
int childCount =
ChildCount
();
2908
Debug.Assert(
ChildCount
() == 1);
3079
int childCount =
ChildCount
();
3179
Debug.Assert(index <
ChildCount
());
3247
int childCount = node.
ChildCount
();
3280
if (curChild < curNode!.
ChildCount
())
System\Text\RegularExpressions\RegexParser.cs (3)
2081
if (_group.Kind == RegexNodeKind.ExpressionConditional && _group.
ChildCount
() == 0)
2125
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)
78
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
());