25 writes to Kind
System.Text.RegularExpressions (25)
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; 1438node.Kind = RegexNodeKind.Empty; 1447node.Kind = RegexNodeKind.Empty; 1452node.Kind = RegexNodeKind.One; 1707prev.Kind = RegexNodeKind.Multi; 1852nextNode.Kind = RegexNodeKind.One; 1875currentNode.Kind = nextNode.Kind; 1997node.Kind -= RegexNodeKind.Onelazy - RegexNodeKind.Oneloop; // lazy to greedy 2155Kind = RegexNodeKind.Nothing; 3000Kind = RegexNodeKind.Multi;
307 references to Kind
System.Text.RegularExpressions (307)
System\Text\RegularExpressions\RegexCompiler.cs (65)
1268Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1451Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1459switch (node.Kind) 1467int length = node.Kind == RegexNodeKind.Multi ? node.Str!.Length : 1; 1667Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1872Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2047Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2061RegexNode? noBranch = node.Child(1) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null; 2206Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2222RegexNode? noBranch = node.Child(2) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null; 2399Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2525Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2569Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2718switch (node.Kind) 2822Debug.Fail($"Unexpected node type: {node.Kind}"); 2828Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2829Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 2835if (node.Kind is RegexNodeKind.Atomic && !analysis.MayBacktrack(child)) 2872Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 2892Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 2950if (next.Kind is not RegexNodeKind.UpdateBumpalong) // skip node types that don't have a semantic impact 2963Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 3038Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected type: {node.Kind}"); 3054switch (node.Kind) 3070if (node.Kind is RegexNodeKind.Boundary) 3083if (node.Kind is RegexNodeKind.ECMABoundary) 3098Debug.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}"); 3103switch (node.Kind) 3117if (node.Kind == RegexNodeKind.Beginning) 3236Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3288Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3504Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3605node.Kind is RegexNodeKind.Notonelazy && 3746node.Kind is RegexNodeKind.Setlazy && 3851Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4213Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4362Debug.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}"); 4609Debug.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}"); 4698Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4702Debug.Assert(!analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4736Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 5134if (node.Kind == RegexNodeKind.Multi) 5167if (node.Kind == RegexNodeKind.Multi) 5360if (root.Kind is RegexNodeKind.Multi or RegexNodeKind.One or RegexNodeKind.Notone or RegexNodeKind.Set) 5378Ldc((root.Kind == RegexNodeKind.Multi ? root.Str!.Length : 1) * (!rtl ? 1 : -1));
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
822Debug.Assert(loopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic);
System\Text\RegularExpressions\RegexNode.cs (179)
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); 1199if (child.Kind != RegexNodeKind.Concatenate || child.ChildCount() < 2) 1214switch (required.Kind) 1234if (required.Kind != other.Kind || 1260if (alternation.Parent is RegexNode { Kind: RegexNodeKind.Atomic }) 1285Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1294switch (child.Kind) 1328Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1355if (startingNode.Kind == RegexNodeKind.One) 1375if (startingNode.Kind == RegexNodeKind.One) 1389Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1426ProcessOneOrMulti(branch.Kind == RegexNodeKind.Concatenate ? branch.Child(0) : branch, startingSpan); 1434if (node.Kind == RegexNodeKind.One) 1443Debug.Assert(node.Kind == RegexNodeKind.Multi); 1464if (alternation.Parent is RegexNode parent && parent.Kind == RegexNodeKind.Atomic) 1491RegexNode branch = Kind == RegexNodeKind.Concatenate ? Child(0) : this; 1492return branch.Kind is RegexNodeKind.One or RegexNodeKind.Multi ? branch : null; 1498Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1511switch (node.Kind) 1546switch (node.Kind) 1613Debug.Assert(Kind == RegexNodeKind.Concatenate); 1629if (child.Kind == RegexNodeKind.Nothing) 1655Debug.Assert(Kind == RegexNodeKind.Concatenate); 1672if (at.Kind == RegexNodeKind.Concatenate && 1691else if (at.Kind is RegexNodeKind.Multi or RegexNodeKind.One) 1705if (prev.Kind == RegexNodeKind.One) 1712((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1713((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1715else if (at.Kind == RegexNodeKind.Empty) 1738Debug.Assert(Kind == RegexNodeKind.Concatenate); 1773switch (currentNode.Kind) 1776case 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: 1777case RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy when nextNode.Kind == currentNode.Kind && currentNode.Str == nextNode.Str: 1779currentNode.Kind is RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloopatomic) 1802case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.One && currentNode.Ch == nextNode.Ch: 1803case RegexNodeKind.Notoneloop or RegexNodeKind.Notonelazy when nextNode.Kind == RegexNodeKind.Notone && currentNode.Ch == nextNode.Ch: 1804case RegexNodeKind.Setloop or RegexNodeKind.Setlazy when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 1819nextNode.Kind == RegexNodeKind.Multi && 1870case RegexNodeKind.One when (nextNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) && currentNode.Ch == nextNode.Ch: 1871case RegexNodeKind.Notone when (nextNode.Kind is RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy) && currentNode.Ch == nextNode.Ch: 1872case RegexNodeKind.Set when (nextNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) && currentNode.Str == nextNode.Str: 1875currentNode.Kind = nextNode.Kind; 1885case RegexNodeKind.Notone when nextNode.Kind == currentNode.Kind && currentNode.Ch == nextNode.Ch: 1886case RegexNodeKind.Set when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 1897when nextNode.Kind == currentNode.Kind: 1940if (Kind is not RegexNodeKind.Concatenate) 1964while (node.Kind is RegexNodeKind.Capture or RegexNodeKind.Concatenate) 1970switch (node.Kind) 2016while (loopChild.Kind is RegexNodeKind.Capture or RegexNodeKind.Concatenate) 2021if (loopChild.Kind is 2029else if (node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop) 2072for (int b = node.Kind == RegexNodeKind.ExpressionConditional ? 1 : 0; b < alternateBranches; b++) 2086Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 2094if (Kind is RegexNodeKind.NegativeLookaround && ContainsKind(Child(0), [RegexNodeKind.Backreference, RegexNodeKind.BackreferenceConditional]) is false) 2109if (node is { Kind: RegexNodeKind.Capture, N: -1 }) 2140if (Kind is RegexNodeKind.PositiveLookaround) 2142if (((Options & RegexOptions.RightToLeft) == 0 && IsZeroWidthAssertion(child.Kind)) || 2143child.Kind is RegexNodeKind.Empty) 2148else if (Kind is RegexNodeKind.NegativeLookaround) 2153if (child.Kind is RegexNodeKind.Empty) 2178if (node.Kind == kind) 2206Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 2224Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2242if (condition.Kind == RegexNodeKind.PositiveLookaround && (condition.Options & RegexOptions.RightToLeft) == 0) 2269while (node.Kind is RegexNodeKind.Capture or RegexNodeKind.Concatenate) 2283switch (subsequent.Kind) 2323switch (subsequent.Kind) 2339switch (node.Kind) 2343switch (subsequent.Kind) 2373switch (subsequent.Kind) 2392switch (subsequent.Kind) 2439switch (subsequent.Kind) 2481switch (parent?.Kind) 2528Debug.Assert(node.Kind is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation."); 2539switch (parent.Kind) 2581switch (Kind) 2676Debug.Fail($"Unknown node: {Kind}"); 2694switch (Kind) 2754int i = Kind == RegexNodeKind.BackreferenceConditional ? 0 : 1; 2813Debug.Fail($"Unknown node: {Kind}"); 2837Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2850if (child.Kind is RegexNodeKind.One) 2863else if (child.Kind is RegexNodeKind.Multi) 2875else if (child.Kind is RegexNodeKind.Set || 2876(child.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.M == child.N)) 2885vsb.Append((char)(twoChars[0] | 0x20), child.Kind is RegexNodeKind.Set ? 1 : child.M); 2887else if (child.Kind is RegexNodeKind.Empty) 2892else if (consumeZeroWidthNodes && IsZeroWidthAssertion(child.Kind)) 2938Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 2940static bool CanJoinLengthCheck(RegexNode node) => node.Kind switch 2994case <= MultiVsRepeaterLimit when Kind == RegexNodeKind.One: 3007switch (Kind) 3139public bool IsSetFamily => Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy; 3142public bool IsOneFamily => Kind is RegexNodeKind.One or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy; 3145public bool IsNotoneFamily => Kind is RegexNodeKind.Notone or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy; 3184var sb = new StringBuilder(Kind.ToString()); 3194switch (Kind) 3233switch (Kind)
System\Text\RegularExpressions\RegexParser.cs (6)
1004if (_group!.Kind != RegexNodeKind.ExpressionConditional) 1142if (result != null && result.Kind == RegexNodeKind.Backreference && (result.Options & RegexOptions.IgnoreCase) != 0) 2034if (_group.Kind == RegexNodeKind.ExpressionConditional && _group.ChildCount() == 0) 2059if (_group!.Kind is RegexNodeKind.ExpressionConditional or RegexNodeKind.BackreferenceConditional) 2074if (_group!.Kind is RegexNodeKind.ExpressionConditional or RegexNodeKind.BackreferenceConditional) 2078if (_group.Kind == RegexNodeKind.BackreferenceConditional && _group.ChildCount() > 2 || _group.ChildCount() > 3)
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))
System\Text\RegularExpressions\RegexReplacement.cs (4)
36Debug.Assert(concat.Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {concat.Kind}"); 48switch (child.Kind) 77Debug.Fail($"Unexpected child kind {child.Kind}");
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (3)
47switch (node.Kind) 59switch (node.Kind) 90bool treatChildAsAtomic = (isAtomicByAncestor | isAtomicBySelf) && node.Kind switch
System\Text\RegularExpressions\RegexWriter.cs (11)
85EmitFragment(curNode.Kind, curNode, 0); 89EmitFragment(curNode.Kind | BeforeChild, curNode, curChild); 105EmitFragment(curNode.Kind | AfterChild, curNode, curChild); 383Emit((RegexOpcode)node.Kind | bits, node.Ch); 394Emit(((node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy) ? 399Emit((RegexOpcode)node.Kind | bits, node.Ch, node.N == int.MaxValue ? int.MaxValue : node.N - node.M); 414Emit((RegexOpcode)node.Kind | bits, stringCode, (node.N == int.MaxValue) ? int.MaxValue : node.N - node.M); 420Emit((RegexOpcode)node.Kind | bits, StringCode(node.Str!)); 424Emit((RegexOpcode)node.Kind | bits, StringCode(node.Str!)); 428Emit((RegexOpcode)node.Kind | bits, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping)); 443Emit((RegexOpcode)node.Kind);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (11)
53switch (node.Kind) 117result.AddLast(_builder.CreateLoop(_builder.CreateSingleton(bdd), node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy, node.M, node.N)); 128result.AddLast(_builder.CreateLoop(_builder.CreateSingleton(setBdd), node.Kind == RegexNodeKind.Setlazy, node.M, node.N)); 178throw new NotSupportedException(SR.Format(SR.NotSupported_NonBacktrackingConflictingExpression, node.Kind switch 195string description = $"Unexpected ({nameof(RegexNodeKind)}: {node.Kind})"; 209switch (node.Kind) 260result.AddLast(_builder.CreateLoop(body, node.Kind == RegexNodeKind.Lazyloop, node.M, node.N)); 267Debug.Assert(node.Kind == RegexNodeKind.Capture && node.N == -1); 285Debug.Assert(rootResult.Count == 1 || root.Kind == RegexNodeKind.Concatenate || root.Kind == RegexNodeKind.Capture); 312Debug.Assert(node.Kind == RegexNodeKind.Set);