90 references to ChildCount
System.Text.RegularExpressions.Generator (90)
RegexGenerator.cs (1)
339
int childCount = node.
ChildCount
();
RegexGenerator.Emitter.cs (29)
1583
Debug.Assert(node.
ChildCount
() == 1, "Capture nodes should have one child");
1765
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
1767
int childCount = node.
ChildCount
();
2284
Debug.Assert(node.
ChildCount
() == 2, $"Expected 2 children, found {node.
ChildCount
()}");
2457
Debug.Assert(node.
ChildCount
() == 3, $"Expected 3 children, found {node.
ChildCount
()}");
2644
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2737
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
2785
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
3060
Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.
ChildCount
() >= 1 : node.
ChildCount
() == 1, $"Unexpected number of children: {node.
ChildCount
()}");
3101
Debug.Assert(node.
ChildCount
() >= 2, $"Expected at least 2 children, found {node.
ChildCount
()}");
3105
int childCount = node.
ChildCount
();
3213
int childCount = node.
ChildCount
();
3817
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4407
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
4427
Debug.Assert(node.
ChildCount
() == 1, $"Expected 1 child, found {node.
ChildCount
()}");
5571
RegexNodeKind.Alternate => $"Match with {node.
ChildCount
()} alternative expressions{(rm.Analysis.IsAtomicByAncestor(node) ? ", atomically" : "")}.",
5787
int childCount = node.
ChildCount
();
src\libraries\System.Text.RegularExpressions\src\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
())
src\libraries\System.Text.RegularExpressions\src\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)
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);
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)
82
int childCount = node.
ChildCount
();