11 writes to N
System.Text.RegularExpressions (11)
System\Text\RegularExpressions\RegexNode.cs (11)
83N = n; 99newNode.N = N == int.MaxValue ? int.MaxValue : N - 1; 154N = max; 172N = M; 188M = N = 0; 492node.N = node.M; 831u.N = max = ((int.MaxValue - 1) / u.N < max) ? int.MaxValue : u.N * max; 1683currentNode.N = nextNode.N == int.MaxValue ? int.MaxValue : currentNode.N + nextNode.N; 1697currentNode.N++; 1721currentNode.N += matchingCharsInMulti; 1761currentNode.N = nextNode.N == int.MaxValue ? int.MaxValue : nextNode.N + 1;
86 references to N
System.Text.RegularExpressions (86)
System\Text\RegularExpressions\RegexCompiler.cs (1)
1247Debug.Assert(target.LoopNode.N == int.MaxValue);
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
764Debug.Assert(loopNode.N == int.MaxValue);
System\Text\RegularExpressions\RegexNode.cs (44)
99newNode.N = N == int.MaxValue ? int.MaxValue : N - 1; 173if (N == 0) 181else if (Kind == RegexNodeKind.Oneloopatomic && N is >= 2 and <= MultiVsRepeaterLimit) 186Str = new string(Ch, N); 384case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when node.N == int.MaxValue: 385case RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when node.N == int.MaxValue && !atomicByAncestry: 496if (node.N == 1) 773int max = N; 817if (u.M == 0 && child.M > 1 || child.N < child.M * 2) 829if (u.N > 0) 831u.N = max = ((int.MaxValue - 1) / u.N < max) ? int.MaxValue : u.N * max; 852child.MakeRep(u.Kind == RegexNodeKind.Lazyloop ? RegexNodeKind.Onelazy : RegexNodeKind.Oneloop, u.M, u.N); 1109case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when required.M == required.N: 1124required.N != other.N || 1675if (!CanCombineCounts(currentNode.M, currentNode.N, nextNode.M, nextNode.N)) 1681if (currentNode.N != int.MaxValue) 1683currentNode.N = nextNode.N == int.MaxValue ? int.MaxValue : currentNode.N + nextNode.N; 1692if (CanCombineCounts(currentNode.M, currentNode.N, 1, 1)) 1695if (currentNode.N != int.MaxValue) 1715if (CanCombineCounts(currentNode.M, currentNode.N, matchingCharsInMulti, matchingCharsInMulti)) 1719if (currentNode.N != int.MaxValue) 1757if (CanCombineCounts(1, 1, nextNode.M, nextNode.N)) 1761currentNode.N = nextNode.N == int.MaxValue ? int.MaxValue : nextNode.N + 1; 2386return N == int.MaxValue ? null : N; 2389if (N != int.MaxValue) 2394long maxLength = (long)N * childMaxLength; 2552(child.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.M == child.N)) 2638when node.M == node.N => true, 2899if (N != -1) 2901sb.Append($", unindex = {N}"); 2938(M == 0 && N == int.MaxValue) ? "*" : 2939(M == 0 && N == 1) ? "?" : 2940(M == 1 && N == int.MaxValue) ? "+" : 2941(N == int.MaxValue) ? $"{{{M}, *}}" : 2942(N == M) ? $"{{{M}}}" : 2943$"{{{M}, {N}}}");
System\Text\RegularExpressions\RegexNodeKind.cs (12)
31/// The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>. 36/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 40/// <remarks>The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 45/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 49/// <remarks>The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 53/// <remarks>The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 59/// The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>. 65/// The character is specified in <see cref="RegexNode.Ch"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>. 71/// The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>. 129/// and the maximum number of iterations is in <see cref="RegexNode.N"/>. 135/// and the maximum number of iterations is in <see cref="RegexNode.N"/>. 142/// group, <see cref="RegexNode.N"/> is the uncapture.
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (9)
119return node.Kind is RegexNodeKind.One || reps == node.N; 209return node.Kind is RegexNodeKind.Set || reps == node.N; 236return limit == node.N; 436return count == node.N && !rtl; 450return limit == node.N && !rtl; 618return i == node.M && i == node.N; 649return i == node.M && i == node.N; 658case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when node.M == node.N: 1135if (firstChild.Kind is not (RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) || firstChild.N != int.MaxValue)
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (3)
50case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M != node.N: 51case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when node.M != node.N: 111RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.N == 1 => true,
System\Text\RegularExpressions\RegexWriter.cs (11)
314if (node.N < int.MaxValue || node.M > 1) 333if (node.N < int.MaxValue || node.M > 1) 334Emit(RegexOpcode.Branchcount + Lazy, _intStack.Pop(), node.N == int.MaxValue ? int.MaxValue : node.N - node.M); 348Emit(RegexOpcode.Capturemark, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping), RegexParser.MapCaptureNumber(node.N, _tree.CaptureNumberSparseMapping)); 397if (node.N > node.M) 399Emit((RegexOpcode)node.Kind | bits, node.Ch, node.N == int.MaxValue ? int.MaxValue : node.N - node.M); 412if (node.N > node.M) 414Emit((RegexOpcode)node.Kind | bits, stringCode, (node.N == int.MaxValue) ? int.MaxValue : node.N - node.M);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (5)
88case RegexNodeKind.Capture when node.N == -1: // N == -1 because balancing groups (which have N >= 0) aren't supported 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)); 260result.AddLast(_builder.CreateLoop(body, node.Kind == RegexNodeKind.Lazyloop, node.M, node.N)); 267Debug.Assert(node.Kind == RegexNodeKind.Capture && node.N == -1);