10 writes to M
System.Text.RegularExpressions (10)
System\Text\RegularExpressions\RegexNode.cs (10)
75
M
= m;
82
M
= m;
98
newNode.
M
= M - 1;
153
M
= min;
188
M
= N = 0;
826
u.
M
= min = ((int.MaxValue - 1) / u.M < min) ? int.MaxValue : u.M * min;
1680
currentNode.
M
+= nextNode.M;
1694
currentNode.
M
++;
1721
currentNode.
M
+= matchingCharsInMulti;
1763
currentNode.
M
= nextNode.M + 1;
131 references to M
System.Text.RegularExpressions (131)
System\Text\RegularExpressions\RegexCompiler.cs (2)
1343
if (target.LoopNode.
M
> 0)
1358
Ldc(target.LoopNode.
M
);
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
815
if ((i - prev - 1) < loopNode.
M
)
System\Text\RegularExpressions\RegexNode.cs (63)
92
Debug.Assert(
M
> 0);
98
newNode.M =
M
- 1;
172
N =
M
;
492
node.N = node.
M
;
772
int min =
M
;
817
if (u.
M
== 0 && child.
M
> 1 || child.N < child.
M
* 2)
824
if (u.
M
> 0)
826
u.M = min = ((int.MaxValue - 1) / u.
M
< min) ? int.MaxValue : u.
M
* min;
852
child.MakeRep(u.Kind == RegexNodeKind.Lazyloop ? RegexNodeKind.Onelazy : RegexNodeKind.Oneloop, u.
M
, u.N);
1109
case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when required.
M
== required.N:
1123
required.
M
!= other.
M
||
1385
Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily &&
M
> 0));
1401
case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy when node.
M
> 0:
1403
case RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Notonelazy when node.
M
> 0:
1405
case RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy when node.
M
> 0:
1413
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.
M
> 0:
1665
if (nextNode.
M
> 0 &&
1675
if (!CanCombineCounts(currentNode.
M
, currentNode.N, nextNode.
M
, nextNode.N))
1680
currentNode.M += nextNode.
M
;
1692
if (CanCombineCounts(currentNode.
M
, currentNode.N, 1, 1))
1718
if (CanCombineCounts(currentNode.
M
, currentNode.N, matchingCharsInMulti, matchingCharsInMulti))
1760
if (CanCombineCounts(1, 1, nextNode.
M
, nextNode.N))
1763
currentNode.M = nextNode.
M
+ 1;
2076
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when subsequent.
M
> 0:
2123
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.
M
> 0 && node.Ch != subsequent.Ch:
2124
case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when subsequent.
M
> 0 && node.Ch == subsequent.Ch:
2125
case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.
M
> 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!):
2131
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.
M
== 0 && node.Ch != subsequent.Ch:
2132
case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when subsequent.
M
== 0 && node.Ch == subsequent.Ch:
2133
case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.
M
== 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!):
2134
case RegexNodeKind.Boundary when node.
M
> 0 && RegexCharClass.IsBoundaryWordChar(node.Ch):
2135
case RegexNodeKind.NonBoundary when node.
M
> 0 && !RegexCharClass.IsBoundaryWordChar(node.Ch):
2136
case RegexNodeKind.ECMABoundary when node.
M
> 0 && RegexCharClass.IsECMAWordChar(node.Ch):
2137
case RegexNodeKind.NonECMABoundary when node.
M
> 0 && !RegexCharClass.IsECMAWordChar(node.Ch):
2151
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.
M
> 0 && node.Ch == subsequent.Ch:
2156
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.
M
== 0 && node.Ch == subsequent.Ch:
2171
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.
M
> 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!):
2172
case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.
M
> 0 && !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!):
2178
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.
M
== 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!):
2179
case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.
M
== 0 && !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!):
2180
case RegexNodeKind.Boundary when node.
M
> 0 && node.Str is RegexCharClass.WordClass or RegexCharClass.DigitClass:
2181
case RegexNodeKind.NonBoundary when node.
M
> 0 && node.Str is RegexCharClass.NotWordClass or RegexCharClass.NotDigitClass:
2182
case RegexNodeKind.ECMABoundary when node.
M
> 0 && node.Str is RegexCharClass.ECMAWordClass or RegexCharClass.ECMADigitClass:
2183
case RegexNodeKind.NonECMABoundary when node.
M
> 0 && node.Str is RegexCharClass.NotECMAWordClass or RegexCharClass.NotDigitClass:
2282
return
M
;
2287
return (int)Math.Min(int.MaxValue - 1, (long)
M
* Child(0).ComputeMinLength());
2555
(child.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic && child.
M
== child.N))
2564
vsb.Append((char)(twoChars[0] | 0x20), child.Kind is RegexNodeKind.Set ? 1 : child.
M
);
2641
when node.
M
== node.N => true,
2901
sb.Append(' ').Append($"index = {
M
}");
2909
sb.Append(' ').Append($"index = {
M
}");
2941
(
M
== 0 && N == int.MaxValue) ? "*" :
2942
(
M
== 0 && N == 1) ? "?" :
2943
(
M
== 1 && N == int.MaxValue) ? "+" :
2944
(N == int.MaxValue) ? $"{{{
M
}, *}}" :
2945
(N ==
M
) ? $"{{{
M
}}}" :
2946
$"{{{
M
}, {N}}}");
System\Text\RegularExpressions\RegexNodeKind.cs (14)
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"/>.
77
/// <remarks>The capture group number referenced is stored in <see cref="RegexNode.
M
"/>.</remarks>
128
/// One and only one child, the expression in the loop. The minimum number of iterations is in <see cref="RegexNode.
M
"/>,
134
/// One and only one child, the expression in the loop. The minimum number of iterations is in <see cref="RegexNode.
M
"/>,
141
/// One and only one child, the expression in the capture. <see cref="RegexNode.
M
"/> is the number of the capture, and if a balancing
169
/// The referenced capture group number is stored in <see cref="RegexNode.
M
"/>.
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (24)
114
int reps = node.Kind is RegexNodeKind.One ? 1 : Math.Min(node.
M
, MaxPrefixLength);
164
int reps = node.Kind is RegexNodeKind.Set ? 1 : Math.Min(node.
M
, MaxPrefixLength);
226
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.
M
> 0:
228
int limit = Math.Min(node.
M
, MaxPrefixLength); // MaxPrefixLength here is somewhat arbitrary, as a single loop iteration could yield multiple chars
432
case RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Onelazy when node.
M
> 0:
434
int count = Math.Min(node.
M
, SingleCharIterationLimit);
439
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.
M
> 0:
442
int limit = Math.Min(node.
M
, NodeIterationLimit);
493
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.
M
> 0:
609
case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when node.
M
> 0:
612
int minIterations = Math.Min(node.
M
, MaxLoopExpansion);
618
return i == node.
M
&& i == node.N;
641
case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when node.
M
> 0:
643
int minIterations = Math.Min(node.
M
, MaxLoopExpansion);
649
return i == node.
M
&& i == node.N;
658
case RegexNodeKind.Notonelazy or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic when node.
M
== node.N:
659
distance += node.
M
;
686
case RegexNodeKind.Lazyloop or RegexNodeKind.Loop when node.
M
> 0:
950
return node.Kind is RegexNodeKind.One || node.
M
> 0 ? true : null;
968
return node.Kind is RegexNodeKind.Notone || node.
M
> 0 ? true : null;
987
node.Kind is RegexNodeKind.Set || node.
M
> 0 ? true :
1033
_ => node.
M
== 0 ? null : true,
1201
(nextChild.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop && nextChild.
M
>= 1))
1209
(nextChild.Kind is RegexNodeKind.Set || nextChild.
M
>= 1))
System\Text\RegularExpressions\RegexReplacement.cs (1)
65
int slot = child.
M
;
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (2)
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:
System\Text\RegularExpressions\RegexWriter.cs (20)
254
Emit(RegexOpcode.TestBackreference, RegexParser.MapCaptureNumber(node.
M
, _tree.CaptureNumberSparseMapping));
314
if (node.N < int.MaxValue || node.
M
> 1)
315
Emit(node.
M
== 0 ? RegexOpcode.Nullcount : RegexOpcode.Setcount, node.
M
== 0 ? 0 : 1 - node.
M
);
317
Emit(node.
M
== 0 ? RegexOpcode.Nullmark : RegexOpcode.Setmark);
319
if (node.
M
== 0)
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
);
338
if (node.
M
== 0)
348
Emit(RegexOpcode.Capturemark, RegexParser.MapCaptureNumber(node.
M
, _tree.CaptureNumberSparseMapping), RegexParser.MapCaptureNumber(node.N, _tree.CaptureNumberSparseMapping));
392
if (node.
M
> 0)
395
RegexOpcode.Onerep : RegexOpcode.Notonerep) | bits, node.Ch, node.
M
);
397
if (node.N > node.
M
)
399
Emit((RegexOpcode)node.Kind | bits, node.Ch, node.N == int.MaxValue ? int.MaxValue : node.N - node.
M
);
408
if (node.
M
> 0)
410
Emit(RegexOpcode.Setrep | bits, stringCode, 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
);
428
Emit((RegexOpcode)node.Kind | bits, RegexParser.MapCaptureNumber(node.
M
, _tree.CaptureNumberSparseMapping));
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (4)
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));
272
int captureNum = RegexParser.MapCaptureNumber(node.
M
, _captureSparseMapping);