12 writes to N
System.Text.RegularExpressions.Generator (12)
parent\src\System\Text\RegularExpressions\RegexNode.cs (12)
83
N
= n;
99
newNode.
N
= N == int.MaxValue ? int.MaxValue : N - 1;
154
N
= max;
182
N
= M;
200
M =
N
= 0;
209
M =
N
= 0;
218
N
= M;
945
u.
N
= max = ((int.MaxValue - 1) / u.N < max) ? int.MaxValue : u.N * max;
1925
currentNode.
N
= nextNode.N == int.MaxValue ? int.MaxValue : currentNode.N + nextNode.N;
1939
currentNode.
N
++;
1966
currentNode.
N
+= matchingCharsInMulti;
2006
currentNode.
N
= nextNode.N == int.MaxValue ? int.MaxValue : nextNode.N + 1;
88 references to N
System.Text.RegularExpressions.Generator (88)
parent\src\System\Text\RegularExpressions\RegexNode.cs (44)
99
newNode.N =
N
== int.MaxValue ? int.MaxValue :
N
- 1;
185
if (
N
== 0)
193
else if (Kind == RegexNodeKind.Oneloopatomic &&
N
is >= 2 and <= MultiVsRepeaterLimit)
198
Str = new string(Ch,
N
);
207
RegexNode loopAsChild = new(RegexNodeKind.Loop, Options, M,
N
);
221
if (
N
!= 0)
438
case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when node.
N
== int.MaxValue:
439
case RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when node.
N
== int.MaxValue && !atomicByAncestry:
599
if (node.
N
== 1 || CanBeMadeAtomic(node.Child(0), node.Child(0), iterateNullableSubsequent: false, allowLazy: false))
887
int max =
N
;
931
if (u.M == 0 && child.M > 1 || child.
N
< child.M * 2)
943
if (u.
N
> 0)
945
u.N = max = ((int.MaxValue - 1) / u.
N
< max) ? int.MaxValue : u.
N
* max;
965
child.MakeRep(u.Kind == RegexNodeKind.Lazyloop ? RegexNodeKind.Onelazy : RegexNodeKind.Oneloop, u.M, u.
N
);
1265
case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when required.M == required.
N
:
1285
required.
N
!= other.
N
||
1917
if (!CanCombineCounts(currentNode.M, currentNode.
N
, nextNode.M, nextNode.
N
))
1923
if (currentNode.
N
!= int.MaxValue)
1925
currentNode.N = nextNode.
N
== int.MaxValue ? int.MaxValue : currentNode.
N
+ nextNode.
N
;
1934
if (CanCombineCounts(currentNode.M, currentNode.
N
, 1, 1))
1937
if (currentNode.
N
!= int.MaxValue)
1960
if (CanCombineCounts(currentNode.M, currentNode.
N
, matchingCharsInMulti, matchingCharsInMulti))
1964
if (currentNode.
N
!= int.MaxValue)
2002
if (CanCombineCounts(1, 1, nextNode.M, nextNode.
N
))
2006
currentNode.N = nextNode.
N
== int.MaxValue ? int.MaxValue : nextNode.
N
+ 1;
2179
if (node.
N
== 1 || CanBeMadeAtomic(child, child, iterateNullableSubsequent: false, allowLazy: false))
2189
if (node.
N
== 1 || CanBeMadeAtomic(child, child, iterateNullableSubsequent: false, allowLazy: true))
2244
if (node is { Kind: RegexNodeKind.Capture,
N
: -1 })
2621
(node.
N
> 1 && RegexCharClass.MayOverlap(loopStartingSet, loopEndingSet)))
2741
RegexNodeKind.Loop or RegexNodeKind.Lazyloop when M !=
N
=> true,
2744
RegexNodeKind.Setloop or RegexNodeKind.Setlazy when M !=
N
=> true,
2970
return
N
== int.MaxValue ? null :
N
;
2973
if (
N
!= int.MaxValue)
2978
long maxLength = (long)
N
* childMaxLength;
3159
(child.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.M == child.
N
))
3250
when node.M == node.
N
=> true,
parent\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (9)
119
return node.Kind is RegexNodeKind.One || reps == node.
N
;
209
return node.Kind is RegexNodeKind.Set || reps == node.
N
;
236
return limit == node.
N
;
436
return count == node.
N
&& !rtl;
450
return limit == node.
N
&& !rtl;
618
return i == node.M && i == node.
N
;
649
return i == node.M && i == node.
N
;
658
case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when node.M == node.
N
:
1159
if (firstChild.Kind is not (RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) || firstChild.
N
!= int.MaxValue)
parent\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (1)
107
RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.
N
== 1 => true,
RegexGenerator.Emitter.cs (34)
1504
Debug.Assert(target.LoopNode.
N
== int.MaxValue);
2631
int uncapnum = RegexParser.MapCaptureNumber(node.
N
, rm.Tree.CaptureNumberSparseMapping);
3128
child.M == child.
N
&&
3411
if (node.M == node.
N
)
3421
Debug.Assert(node.M < node.
N
);
3483
node.
N
> 1 && // no point in using IndexOf for small loops, in particular optionals
3591
if (node.M == node.
N
|| rm.Analysis.IsAtomicByAncestor(node))
3602
Debug.Assert(node.M < node.
N
);
3613
if (node.
N
!= int.MaxValue)
3615
maxIterations = $"{node.
N
- node.M}";
3828
Debug.Assert(node.
N
>= node.M, $"Unexpected M={node.M}, N={node.
N
}");
3833
int maxIterations = node.
N
;
4255
if (node.M == node.
N
)
4262
if (node.M == 0 && node.
N
== 1)
4268
Debug.Assert(node.
N
> node.M);
4270
int maxIterations = node.
N
;
4385
Debug.Assert(node.M == 0 && node.
N
== 1);
4424
Debug.Assert(node.M == node.
N
, $"Unexpected M={node.M} == N={node.
N
}");
4444
Debug.Assert(node.
N
>= node.M, $"Unexpected M={node.M}, N={node.
N
}");
4449
int maxIterations = node.
N
;
5594
RegexNodeKind.Capture when node.M == -1 && node.
N
!= -1 => $"Non-capturing balancing group. Uncaptures the {DescribeCapture(node.
N
, rm)}.",
5595
RegexNodeKind.Capture when node.
N
!= -1 => $"Balancing group. Captures the {DescribeCapture(node.M, rm)} and uncaptures the {DescribeCapture(node.
N
, rm)}.",
5596
RegexNodeKind.Capture when node.
N
== -1 => $"{DescribeCapture(node.M, rm)}.",
5603
RegexNodeKind.Loop or RegexNodeKind.Lazyloop => node.M == 0 && node.
N
== 1 ? $"Optional ({(node.Kind is RegexNodeKind.Loop ? "greedy" : "lazy")})." : $"Loop {DescribeLoop(node, rm)}{direction}.",
5831
_ when node.M == node.
N
=> "exactly",
5839
node.M == node.
N
? $" {node.M} times" :
5840
(node.M, node.
N
) switch
5847
(0, _) => $" at most {node.
N
} times",
5848
_ => $" at least {node.M} and at most {node.
N
} times"