44 references to Loop
System.Text.RegularExpressions.Generator (44)
RegexGenerator.Emitter.cs (7)
2978case RegexNodeKind.Loop: 4374Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4394Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 5555RegexNodeKind.Loop or RegexNodeKind.Lazyloop => node.M == 0 && node.N == 1 ? $"Optional ({(node.Kind is RegexNodeKind.Loop ? "greedy" : "lazy")})." : $"Loop {DescribeLoop(node, rm)}{direction}.", 5726RegexNodeKind.Atomic when node.Child(0).Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop or RegexNodeKind.Alternate => true, 5786RegexNodeKind.Loop => rm.Analysis.IsAtomicByAncestor(node) ? "atomically" : "greedily",
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (24)
204case RegexNodeKind.Loop: 207RegexNode loopAsChild = new(RegexNodeKind.Loop, Options, M, N); 225goto case RegexNodeKind.Loop; 304case RegexNodeKind.Loop: 498if ((existingChild.Kind is RegexNodeKind.Alternate or RegexNodeKind.BackreferenceConditional or RegexNodeKind.ExpressionConditional or RegexNodeKind.Loop or RegexNodeKind.Lazyloop) && 537case RegexNodeKind.Loop: 542Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 547Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 550if (node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop) 595RegexNodeKind.Loop or RegexNodeKind.Lazyloop => ReduceLoops(), 826Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 842if (kind == RegexNodeKind.Loop) 1597case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M > 0: 2072case RegexNodeKind.Loop when CanBeMadeAtomic(node, subsequent, iterateNullableSubsequent: true, allowLazy: false): 2106else if (node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop) 2110goto case RegexNodeKind.Loop; 2118case RegexNodeKind.Loop: 2370case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when subsequent.M > 0: 2494case RegexNodeKind.Loop: 2604RegexNodeKind.Loop or RegexNodeKind.Lazyloop when M != N => true, 2729case RegexNodeKind.Loop: 2835case RegexNodeKind.Loop or RegexNodeKind.Lazyloop: 3139var result = new RegexNode(lazy ? RegexNodeKind.Lazyloop : RegexNodeKind.Loop, Options, min, max); 3367case RegexNodeKind.Loop:
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNodeKind.cs (3)
32/// This is purely a representational optimization, equivalent to a <see cref="Loop"/> wrapped around a <see cref="One"/>. 37/// This is purely a representational optimization, equivalent to a <see cref="Loop"/> wrapped around a <see cref="Notone"/>. 41/// This is purely a representational optimization, equivalent to a <see cref="Loop"/> wrapped around a <see cref="Set"/>.
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (8)
226case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M > 0: 439case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M > 0: 493case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M > 0: 686case RegexNodeKind.Lazyloop or RegexNodeKind.Loop when node.M > 0: 1037case RegexNodeKind.Loop: 1225(nextChild.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop && nextChild.M >= 1)) 1303case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M >= 1: 1362case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when leading && node.M >= 1:
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (2)
71case RegexNodeKind.Loop: 107RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.N == 1 => true,