102 references to ChildCount
System.Text.RegularExpressions (102)
System\Text\RegularExpressions\RegexCompiler.cs (27)
1458
Debug.Assert(node.
ChildCount
() == 1, "Capture nodes should have one child");
1674
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
1676
int childCount = node.
ChildCount
();
2296
Debug.Assert(node.
ChildCount
() == 2, $"Expected 2 children, found {node.
ChildCount
()}");
2455
Debug.Assert(node.
ChildCount
() == 3, $"Expected 3 children, found {node.
ChildCount
()}");
2648
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2774
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2818
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
3077
Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.
ChildCount
() >= 1 : node.
ChildCount
() == 1, $"Unexpected number of children: {node.
ChildCount
()}");
3141
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
3144
int childCount = node.
ChildCount
();
3194
int childCount = node.
ChildCount
();
4161
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
5009
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
5047
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
System\Text\RegularExpressions\RegexNode.cs (46)
139
ChildCount
() > 1)
252
int childCount = node.
ChildCount
();
374
Debug.Assert(rootNode.
ChildCount
() == 1);
467
int childCount =
ChildCount
();
544
RegexNode existingChild = node.Child(node.
ChildCount
() - 1);
550
node.ReplaceChild(node.
ChildCount
() - 1, atomic);
562
int branches = node.
ChildCount
();
660
return
ChildCount
() switch
681
Debug.Assert(u.
ChildCount
() == 1);
705
Debug.Assert(
ChildCount
() == 1);
850
child.
ChildCount
() == 2 &&
889
while (u.
ChildCount
() > 0)
957
if (u.
ChildCount
() == 1)
1075
switch (
ChildCount
())
1100
if (node.Kind is RegexNodeKind.Alternate && node.
ChildCount
() == 2)
1342
Debug.Assert(node.
ChildCount
() >= 2);
1537
return alternation.
ChildCount
() == 1 ? alternation.Child(0) : alternation;
1582
int childCount =
ChildCount
();
1745
switch (
ChildCount
())
1754
int childCount =
ChildCount
();
2059
int childCount =
ChildCount
();
2095
node = node.Child(node.
ChildCount
() - 1);
2147
loopChild = loopChild.Child(loopChild.
ChildCount
() - 1);
2206
int alternateBranches = node.
ChildCount
();
2222
Debug.Assert(
ChildCount
() == 1);
2254
int childCount = node.
ChildCount
();
2326
int childCount = node.
ChildCount
();
2342
Debug.Assert(
ChildCount
() is 1 or 2);
2348
if (
ChildCount
() == 1)
2360
Debug.Assert(
ChildCount
() is 2 or 3);
2366
if (
ChildCount
() == 2)
2464
node = node.Child(node.
ChildCount
() - 1);
2515
int childCount = subsequent.
ChildCount
();
2766
int childCount = node.
ChildCount
();
2873
int childCount =
ChildCount
();
2895
int childCount =
ChildCount
();
2907
Debug.Assert(
ChildCount
() == 1);
2990
int childCount =
ChildCount
();
3024
int childCount =
ChildCount
();
3045
Debug.Assert(
ChildCount
() == 1);
3175
!child.TryGetOrdinalCaseInsensitiveString(0, child.
ChildCount
(), out int innerNodesConsumed, out string? innerStr, consumeZeroWidthNodes, forPrefixAnalysis))
3184
if (innerNodesConsumed < child.
ChildCount
())
3259
int childCount =
ChildCount
();
3359
Debug.Assert(index <
ChildCount
());
3435
int childCount = node.
ChildCount
();
3468
if (curChild < curNode!.
ChildCount
())
System\Text\RegularExpressions\RegexParser.cs (4)
1075
if (_group!.Kind != RegexNodeKind.ExpressionConditional || _group.
ChildCount
() > 0)
2228
if (_group.Kind == RegexNodeKind.ExpressionConditional && _group.
ChildCount
() == 0)
2272
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, forPrefixAnalysis: 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
());