95 references to ChildCount
System.Text.RegularExpressions.Generator (95)
RegexGenerator.cs (1)
378
int childCount = node.
ChildCount
();
RegexGenerator.Emitter.cs (29)
1626
Debug.Assert(node.
ChildCount
() == 1, "Capture nodes should have one child");
1808
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
1810
int childCount = node.
ChildCount
();
2275
Debug.Assert(node.
ChildCount
() == 2, $"Expected 2 children, found {node.
ChildCount
()}");
2448
Debug.Assert(node.
ChildCount
() == 3, $"Expected 3 children, found {node.
ChildCount
()}");
2628
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2721
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2762
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
3031
Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.
ChildCount
() >= 1 : node.
ChildCount
() == 1, $"Unexpected number of children: {node.
ChildCount
()}");
3073
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
3077
int childCount = node.
ChildCount
();
3185
int childCount = node.
ChildCount
();
3829
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4419
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4439
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
5583
RegexNodeKind.Alternate => $"Match with {node.
ChildCount
()} alternative expressions{(rm.Analysis.IsAtomicByAncestor(node) ? ", atomically" : "")}.",
5799
int childCount = node.
ChildCount
();
src\libraries\System.Text.RegularExpressions\src\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
())
src\libraries\System.Text.RegularExpressions\src\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)
src\libraries\System.Text.RegularExpressions\src\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
();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (1)
78
int childCount = node.
ChildCount
();