12 writes to N
System.Text.RegularExpressions (12)
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;
890
u.
N
= max = ((int.MaxValue - 1) / u.N < max) ? int.MaxValue : u.N * max;
1805
currentNode.
N
= nextNode.N == int.MaxValue ? int.MaxValue : currentNode.N + nextNode.N;
1819
currentNode.
N
++;
1846
currentNode.
N
+= matchingCharsInMulti;
1886
currentNode.
N
= nextNode.N == int.MaxValue ? int.MaxValue : nextNode.N + 1;
112 references to N
System.Text.RegularExpressions (112)
System\Text\RegularExpressions\RegexCompiler.cs (22)
1250
Debug.Assert(target.LoopNode.
N
== int.MaxValue);
2391
int uncapnum = RegexParser.MapCaptureNumber(node.
N
, _regexTree.CaptureNumberSparseMapping);
3297
if (node.M == node.
N
)
3307
Debug.Assert(node.M < node.
N
);
3405
node.
N
> 1 &&
3515
if (node.M == node.
N
|| analysis.IsAtomicByAncestor(node))
3520
Debug.Assert(node.M < node.
N
);
3532
if (node.
N
!= int.MaxValue)
3534
maxIterations = node.
N
- node.M;
3852
Debug.Assert(node.
N
>= node.M, $"Unexpected M={node.M}, N={node.
N
}");
3857
int maxIterations = node.
N
;
4364
if (node.M == node.
N
)
4371
if (node.M == 0 && node.
N
== 1)
4377
Debug.Assert(node.
N
> node.M);
4379
int maxIterations = node.
N
;
4609
Debug.Assert(node.M == 0 && node.
N
== 1);
4699
Debug.Assert(node.M == node.
N
, $"Unexpected M={node.M} == N={node.
N
}");
4737
Debug.Assert(node.
N
>= node.M, $"Unexpected M={node.M}, N={node.
N
}");
4742
int maxIterations = node.
N
;
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
823
Debug.Assert(loopNode.
N
== int.MaxValue);
System\Text\RegularExpressions\RegexNode.cs (49)
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)
424
case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when node.
N
== int.MaxValue:
425
case RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when node.
N
== int.MaxValue && !atomicByAncestry:
552
if (node.
N
== 1 || CanBeMadeAtomic(node.Child(0), node.Child(0), iterateNullableSubsequent: false, allowLazy: false))
832
int max =
N
;
876
if (u.M == 0 && child.M > 1 || child.
N
< child.M * 2)
888
if (u.
N
> 0)
890
u.N = max = ((int.MaxValue - 1) / u.
N
< max) ? int.MaxValue : u.
N
* max;
910
child.MakeRep(u.Kind == RegexNodeKind.Lazyloop ? RegexNodeKind.Onelazy : RegexNodeKind.Oneloop, u.M, u.
N
);
1227
case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when required.M == required.
N
:
1246
required.
N
!= other.
N
||
1797
if (!CanCombineCounts(currentNode.M, currentNode.
N
, nextNode.M, nextNode.
N
))
1803
if (currentNode.
N
!= int.MaxValue)
1805
currentNode.N = nextNode.
N
== int.MaxValue ? int.MaxValue : currentNode.
N
+ nextNode.
N
;
1814
if (CanCombineCounts(currentNode.M, currentNode.
N
, 1, 1))
1817
if (currentNode.
N
!= int.MaxValue)
1840
if (CanCombineCounts(currentNode.M, currentNode.
N
, matchingCharsInMulti, matchingCharsInMulti))
1844
if (currentNode.
N
!= int.MaxValue)
1882
if (CanCombineCounts(1, 1, nextNode.M, nextNode.
N
))
1886
currentNode.N = nextNode.
N
== int.MaxValue ? int.MaxValue : nextNode.
N
+ 1;
2053
if (node.
N
== 1 || CanBeMadeAtomic(child, child, iterateNullableSubsequent: false, allowLazy: false))
2063
if (node.
N
== 1 || CanBeMadeAtomic(child, child, iterateNullableSubsequent: false, allowLazy: true))
2433
(node.
N
> 1 && RegexCharClass.MayOverlap(loopStartingSet, loopEndingSet)))
2715
return
N
== int.MaxValue ? null :
N
;
2718
if (
N
!= int.MaxValue)
2723
long maxLength = (long)
N
* childMaxLength;
2881
(child.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.M == child.
N
))
2952
when node.M == node.
N
=> true,
3213
if (
N
!= -1)
3215
sb.Append($", unindex = {
N
}");
3252
(M == 0 &&
N
== int.MaxValue) ? "*" :
3253
(M == 0 &&
N
== 1) ? "?" :
3254
(M == 1 &&
N
== int.MaxValue) ? "+" :
3255
(
N
== int.MaxValue) ? $"{{{M}, *}}" :
3256
(
N
== M) ? $"{{{M}}}" :
3257
$"{{{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)
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)
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (3)
50
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M != node.
N
:
51
case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when node.M != node.
N
:
111
RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.
N
== 1 => true,
System\Text\RegularExpressions\RegexWriter.cs (11)
314
if (node.
N
< int.MaxValue || node.M > 1)
333
if (node.
N
< int.MaxValue || node.M > 1)
334
Emit(RegexOpcode.Branchcount + Lazy, _intStack.Pop(), node.
N
== int.MaxValue ? int.MaxValue : node.
N
- node.M);
348
Emit(RegexOpcode.Capturemark, RegexParser.MapCaptureNumber(node.M, _tree.CaptureNumberSparseMapping), RegexParser.MapCaptureNumber(node.
N
, _tree.CaptureNumberSparseMapping));
397
if (node.
N
> node.M)
399
Emit((RegexOpcode)node.Kind | bits, node.Ch, node.
N
== int.MaxValue ? int.MaxValue : node.
N
- node.M);
412
if (node.
N
> node.M)
414
Emit((RegexOpcode)node.Kind | bits, stringCode, (node.
N
== int.MaxValue) ? int.MaxValue : node.
N
- node.M);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (5)
88
case RegexNodeKind.Capture when node.
N
== -1: // N == -1 because balancing groups (which have N >= 0) aren't supported
117
result.AddLast(_builder.CreateLoop(_builder.CreateSingleton(bdd), node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy, node.M, node.
N
));
128
result.AddLast(_builder.CreateLoop(_builder.CreateSingleton(setBdd), node.Kind == RegexNodeKind.Setlazy, node.M, node.
N
));
260
result.AddLast(_builder.CreateLoop(body, node.Kind == RegexNodeKind.Lazyloop, node.M, node.
N
));
267
Debug.Assert(node.Kind == RegexNodeKind.Capture && node.
N
== -1);