25 writes to Kind
System.Text.RegularExpressions.Generator (25)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (25)
53Kind = kind; 59Kind = kind; 66Kind = kind; 73Kind = kind; 80Kind = kind; 152Kind += kind - RegexNodeKind.One; 172Kind += RegexNodeKind.Oneloopatomic - RegexNodeKind.Oneloop; 179Kind += RegexNodeKind.Oneloopatomic - RegexNodeKind.Onelazy; 189Kind = RegexNodeKind.Empty; 197Kind = RegexNodeKind.Multi; 208Kind = RegexNodeKind.Atomic; 228Kind = RegexNodeKind.Empty; 963Kind = RegexNodeKind.Nothing; 970Kind = 980Kind = 1155prev.Kind = RegexNodeKind.Set; 1439node.Kind = RegexNodeKind.Empty; 1448node.Kind = RegexNodeKind.Empty; 1453node.Kind = RegexNodeKind.One; 1778prev.Kind = RegexNodeKind.Multi; 1923nextNode.Kind = RegexNodeKind.One; 1946currentNode.Kind = nextNode.Kind; 2068node.Kind -= RegexNodeKind.Onelazy - RegexNodeKind.Oneloop; // lazy to greedy 2232Kind = RegexNodeKind.Nothing; 3123Kind = RegexNodeKind.Multi;
300 references to Kind
System.Text.RegularExpressions.Generator (300)
RegexGenerator.cs (1)
373if (node.Kind is RegexNodeKind.Backreference && (node.Options & RegexOptions.IgnoreCase) != 0)
RegexGenerator.Emitter.cs (80)
759if (root.Kind is RegexNodeKind.Empty) 768else if (root.Kind is RegexNodeKind.Nothing) 774else if (root.Kind is RegexNodeKind.Multi or RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set) 783writer.WriteLine($"int end = base.runtextpos = start {(!rtl ? "+" : "-")} {(root.Kind == RegexNodeKind.Multi ? root.Str!.Length : 1)};"); 1502Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1623Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1805Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1905switch (child.Kind) 1920case RegexNodeKind.Concatenate when child.Child(0) == startingLiteralNode && (startingLiteralNode.Kind is RegexNodeKind.One or RegexNodeKind.Set or RegexNodeKind.Multi): 1930child.Child(0).Kind is RegexNodeKind.Multi ? 1976Debug.Assert(multi.Kind is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.Kind}"); 2203Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2272Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2285RegexNode? noBranch = node.Child(1) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null; 2445Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2461RegexNode? noBranch = node.Child(2) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null; 2625Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2718Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2759Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2889switch (node.Kind) 2917switch (node.Kind) 2954switch (node.Kind) 3022Debug.Fail($"Unexpected node type: {node.Kind}"); 3028Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 3029Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 3031Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional || rm.Analysis.MayBacktrack(node.Child(0)), "Expected lookaround/conditional or a child that may backtrack"); 3058Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 3070Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 3118else if (child.Kind is RegexNodeKind.Multi) 3129int repeatCount = child.Kind is RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set ? 1 : child.M; 3187if (next.Kind is not RegexNodeKind.UpdateBumpalong) // skip node types that don't have a semantic impact 3200Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 3244Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}"); 3246string negation = node.Kind is RegexNodeKind.Boundary or RegexNodeKind.ECMABoundary ? "!" : ""; 3249switch (node.Kind) 3284Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}"); 3288switch (node.Kind) 3300using (EmitBlock(writer, node.Kind == RegexNodeKind.Beginning ? 3350Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3399Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3537Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3638node.Kind is RegexNodeKind.Notonelazy && 3705node.Kind is RegexNodeKind.Setlazy && 3784Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4084Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4204Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4336Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4374Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4378Debug.Assert(!rm.Analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4394Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 5016if (node.Kind == RegexNodeKind.Multi) 5539return node.Kind switch 5555RegexNodeKind.Loop or RegexNodeKind.Lazyloop => node.M == 0 && node.N == 1 ? $"Optional ({(node.Kind is RegexNodeKind.Loop ? "greedy" : "lazy")})." : $"Loop {DescribeLoop(node, rm)}{direction}.", 5573_ => $"Unknown node type {node.Kind}", 5719bool skip = node.Kind switch 5723RegexNodeKind.Concatenate when node.Parent is not { Kind: RegexNodeKind.Alternate or RegexNodeKind.BackreferenceConditional or RegexNodeKind.ExpressionConditional } => true, 5726RegexNodeKind.Atomic when node.Child(0).Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop or RegexNodeKind.Alternate => true, 5737string tag = node.Parent?.Kind switch 5781string style = node.Kind switch
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (184)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 95new RegexNode(Kind, Options, Str!) : 96new RegexNode(Kind, Options, Ch); 138Kind == RegexNodeKind.Concatenate && 167switch (Kind) 193else if (Kind == RegexNodeKind.Oneloopatomic && N is >= 2 and <= MultiVsRepeaterLimit) 205if (Parent is not { Kind: RegexNodeKind.Atomic }) 233Debug.Fail($"Unexpected type: {Kind}"); 243Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 262Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 265switch (node.Kind) 298Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}."); 307Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}."); 311Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}"); 315Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}"); 320Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}."); 324Debug.Fail($"Unexpected node type: {node.Kind}"); 329switch (node.Kind) 340Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 344Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 349switch (node.Kind) 355Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 372Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 413switch (node.Kind) 426if (node.Parent is { Kind: RegexNodeKind.Concatenate } parent) 471switch (node.Kind) 498if ((existingChild.Kind is RegexNodeKind.Alternate or RegexNodeKind.BackreferenceConditional or RegexNodeKind.ExpressionConditional or RegexNodeKind.Loop or RegexNodeKind.Lazyloop) && 499node.Parent is not { Kind: RegexNodeKind.Atomic }) // validate grandparent isn't atomic 521if (node.Kind != RegexNodeKind.ExpressionConditional) // ReduceExpressionConditional will have already applied ending backtracking removal 542Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 544if (node.Kind is RegexNodeKind.Atomic) 547Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 550if (node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop) 577switch (Kind) 589return Kind switch 612Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 6150 => new RegexNode(Kind == RegexNodeKind.Alternate ? RegexNodeKind.Nothing : RegexNodeKind.Empty, Options), 629Debug.Assert(Kind == RegexNodeKind.Group); 632while (u.Kind == RegexNodeKind.Group) 657Debug.Assert(Kind == RegexNodeKind.Atomic); 662while (child.Kind == RegexNodeKind.Atomic) 668switch (child.Kind) 704if (branches[0].Kind == RegexNodeKind.Empty) 715if (branches[i].Kind == RegexNodeKind.Empty) 796(child.Child(0).Kind is RegexNodeKind.Empty || child.Child(1).Kind is RegexNodeKind.Empty); // can be transformed into a ? or ?? 811return child.Kind == RegexNodeKind.Empty ? 826Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 829RegexNodeKind kind = Kind; 839if (child.Kind != kind) 844switch (child.Kind) 858switch (child.Kind) 905switch (child.Kind) 910child.MakeRep(u.Kind == RegexNodeKind.Lazyloop ? RegexNodeKind.Onelazy : RegexNodeKind.Oneloop, u.M, u.N); 958Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 971Kind == RegexNodeKind.Set ? RegexNodeKind.One : 972Kind == RegexNodeKind.Setloop ? RegexNodeKind.Oneloop : 973Kind == RegexNodeKind.Setloopatomic ? RegexNodeKind.Oneloopatomic : 981Kind == RegexNodeKind.Set ? RegexNodeKind.Notone : 982Kind == RegexNodeKind.Setloop ? RegexNodeKind.Notoneloop : 983Kind == RegexNodeKind.Setloopatomic ? RegexNodeKind.Notoneloopatomic : 1018Debug.Assert(Kind == RegexNodeKind.Alternate); 1031if (node.Kind == RegexNodeKind.Alternate) 1034if (node.Kind == RegexNodeKind.Alternate) 1037if (node.Kind == RegexNodeKind.Alternate) 1045if (node.Kind is RegexNodeKind.Alternate && node.ChildCount() == 2) 1047if (node.Child(1).Kind is RegexNodeKind.Empty) 1051else if (node.Child(0).Kind is RegexNodeKind.Empty) 1088if (at.Kind == RegexNodeKind.Alternate) 1106else if (at.Kind is RegexNodeKind.Set or RegexNodeKind.One) 1111if (at.Kind == RegexNodeKind.Set) 1135if (prev.Kind == RegexNodeKind.One) 1145if (at.Kind == RegexNodeKind.One) 1162else if (at.Kind == RegexNodeKind.Nothing) 1186Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1205RegexNode required = startingNode.Kind == RegexNodeKind.Concatenate ? startingNode.Child(0) : startingNode; 1206switch (required.Kind) 1226RegexNode other = endingNode.Kind == RegexNodeKind.Concatenate ? endingNode.Child(0) : endingNode; 1227if (required.Kind != other.Kind || 1248if (children[i].Kind == RegexNodeKind.Concatenate) 1261if (alternation.Parent is RegexNode { Kind: RegexNodeKind.Atomic }) 1286Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1295switch (child.Kind) 1329Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1356if (startingNode.Kind == RegexNodeKind.One) 1376if (startingNode.Kind == RegexNodeKind.One) 1390Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1427ProcessOneOrMulti(branch.Kind == RegexNodeKind.Concatenate ? branch.Child(0) : branch, startingSpan); 1435if (node.Kind == RegexNodeKind.One) 1444Debug.Assert(node.Kind == RegexNodeKind.Multi); 1465if (alternation.Parent is RegexNode parent && parent.Kind == RegexNodeKind.Atomic) 1492RegexNode branch = Kind == RegexNodeKind.Concatenate ? Child(0) : this; 1493return branch.Kind is RegexNodeKind.One or RegexNodeKind.Multi ? branch : null; 1499Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1514Debug.Assert(Kind is RegexNodeKind.Alternate); 1538if (startingLiteralNode.IsOneFamily || startingLiteralNode.Kind is RegexNodeKind.Multi) 1582switch (node.Kind) 1617switch (node.Kind) 1684Debug.Assert(Kind == RegexNodeKind.Concatenate); 1700if (child.Kind == RegexNodeKind.Nothing) 1726Debug.Assert(Kind == RegexNodeKind.Concatenate); 1743if (at.Kind == RegexNodeKind.Concatenate && 1762else if (at.Kind is RegexNodeKind.Multi or RegexNodeKind.One) 1776if (prev.Kind == RegexNodeKind.One) 1783((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1784((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1786else if (at.Kind == RegexNodeKind.Empty) 1809Debug.Assert(Kind == RegexNodeKind.Concatenate); 1844switch (currentNode.Kind) 1847case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy when nextNode.Kind == currentNode.Kind && currentNode.Ch == nextNode.Ch: 1848case RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy when nextNode.Kind == currentNode.Kind && currentNode.Str == nextNode.Str: 1850currentNode.Kind is RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloopatomic) 1873case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.One && currentNode.Ch == nextNode.Ch: 1874case RegexNodeKind.Notoneloop or RegexNodeKind.Notonelazy when nextNode.Kind == RegexNodeKind.Notone && currentNode.Ch == nextNode.Ch: 1875case RegexNodeKind.Setloop or RegexNodeKind.Setlazy when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 1890nextNode.Kind == RegexNodeKind.Multi && 1941case RegexNodeKind.One when (nextNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch: 1942case RegexNodeKind.Notone when (nextNode.Kind is RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy) && currentNode.Ch == nextNode.Ch: 1943case RegexNodeKind.Set when (nextNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) && currentNode.Str == nextNode.Str: 1946currentNode.Kind = nextNode.Kind; 1956case RegexNodeKind.Notone when nextNode.Kind == currentNode.Kind && currentNode.Ch == nextNode.Ch: 1957case RegexNodeKind.Set when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 1968when nextNode.Kind == currentNode.Kind: 2011if (Kind is not RegexNodeKind.Concatenate) 2035while (node.Kind is RegexNodeKind.Capture or RegexNodeKind.Concatenate) 2041switch (node.Kind) 2087while (loopChild.Kind is RegexNodeKind.Capture or RegexNodeKind.Concatenate) 2098if (loopChild.Kind is 2106else if (node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop) 2149for (int b = node.Kind == RegexNodeKind.ExpressionConditional ? 1 : 0; b < alternateBranches; b++) 2163Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 2171if (Kind is RegexNodeKind.NegativeLookaround && ContainsKind(Child(0), [RegexNodeKind.Backreference, RegexNodeKind.BackreferenceConditional]) is false) 2186if (node is { Kind: RegexNodeKind.Capture, N: -1 }) 2217if (Kind is RegexNodeKind.PositiveLookaround) 2219if (((Options & RegexOptions.RightToLeft) == 0 && IsZeroWidthAssertion(child.Kind)) || 2220child.Kind is RegexNodeKind.Empty) 2225else if (Kind is RegexNodeKind.NegativeLookaround) 2230if (child.Kind is RegexNodeKind.Empty) 2255if (node.Kind == kind) 2283Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 2301Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2319if (condition.Kind == RegexNodeKind.PositiveLookaround && (condition.Options & RegexOptions.RightToLeft) == 0) 2346while (node.Kind is RegexNodeKind.Capture or RegexNodeKind.Concatenate) 2360switch (subsequent.Kind) 2400switch (subsequent.Kind) 2416switch (node.Kind) 2420switch (subsequent.Kind) 2450switch (subsequent.Kind) 2469switch (subsequent.Kind) 2516switch (subsequent.Kind) 2558switch (parent?.Kind) 2601public bool IsBacktrackingConstruct => Kind switch 2651Debug.Assert(node.Kind is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation."); 2662switch (parent.Kind) 2704switch (Kind) 2799Debug.Fail($"Unknown node: {Kind}"); 2817switch (Kind) 2877int i = Kind == RegexNodeKind.BackreferenceConditional ? 0 : 1; 2936Debug.Fail($"Unknown node: {Kind}"); 2960Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2973if (child.Kind is RegexNodeKind.One) 2986else if (child.Kind is RegexNodeKind.Multi) 2998else if (child.Kind is RegexNodeKind.Set || 2999(child.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.M == child.N)) 3008vsb.Append((char)(twoChars[0] | 0x20), child.Kind is RegexNodeKind.Set ? 1 : child.M); 3010else if (child.Kind is RegexNodeKind.Empty) 3015else if (consumeZeroWidthNodes && IsZeroWidthAssertion(child.Kind)) 3061Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 3063static bool CanJoinLengthCheck(RegexNode node) => node.Kind switch 3117case <= MultiVsRepeaterLimit when Kind == RegexNodeKind.One: 3130switch (Kind) 3262public bool IsSetFamily => Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy; 3265public bool IsOneFamily => Kind is RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy; 3268public bool IsNotoneFamily => Kind is RegexNodeKind.Notone or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy; 3307var sb = new StringBuilder(Kind.ToString()); 3317switch (Kind) 3356switch (Kind)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (6)
1051if (_group!.Kind != RegexNodeKind.ExpressionConditional) 1189if (result != null && result.Kind == RegexNodeKind.Backreference && (result.Options & RegexOptions.IgnoreCase) != 0) 2081if (_group.Kind == RegexNodeKind.ExpressionConditional && _group.ChildCount() == 0) 2106if (_group!.Kind is RegexNodeKind.ExpressionConditional or RegexNodeKind.BackreferenceConditional) 2121if (_group!.Kind is RegexNodeKind.ExpressionConditional or RegexNodeKind.BackreferenceConditional) 2125if (_group.Kind == RegexNodeKind.BackreferenceConditional && _group.ChildCount() > 2 || _group.ChildCount() > 3)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (27)
80switch (node.Kind) 114int reps = node.Kind is RegexNodeKind.One ? 1 : Math.Min(node.M, MaxPrefixLength); 119return node.Kind is RegexNodeKind.One || reps == node.N; 164int reps = node.Kind is RegexNodeKind.Set ? 1 : Math.Min(node.M, MaxPrefixLength); 209return node.Kind is RegexNodeKind.Set || reps == node.N; 360switch (node.Kind) 489switch (node.Kind) 598switch (node.Kind) 950switch (node.Kind) 959return node.Kind is RegexNodeKind.One || node.M > 0 ? true : null; 977return node.Kind is RegexNodeKind.Notone || node.M > 0 ? true : null; 996node.Kind is RegexNodeKind.Set || node.M > 0 ? true : 1104int branchStart = node.Kind is RegexNodeKind.BackreferenceConditional ? 0 : 1; 1118Debug.Fail($"Unexpected node {node.Kind}"); 1138while (node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Capture) 1142if (node.Kind != RegexNodeKind.Concatenate) 1155while (firstChild.Kind is RegexNodeKind.Atomic or RegexNodeKind.Capture) 1159if (firstChild.Kind is not (RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) || firstChild.N != int.MaxValue) 1167if (nextChild.Kind == RegexNodeKind.UpdateBumpalong) 1224while ((nextChild.Kind is RegexNodeKind.Atomic or RegexNodeKind.Capture or RegexNodeKind.Concatenate) || 1225(nextChild.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop && nextChild.M >= 1)) 1233(nextChild.Kind is RegexNodeKind.Set || nextChild.M >= 1)) 1277switch (node.Kind) 1349switch (node.Kind) 1358return node.Kind; 1386switch (tmpChild.Kind) 1416if (node.Child(i).Kind is not (RegexNodeKind.Empty or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround))
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (2)
55switch (node.Kind) 86bool treatChildAsAtomic = (isAtomicByAncestor | isAtomicBySelf) && node.Kind switch