Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RegexCompiler.cs
Go to the documentation of this file.
6
8
9internal abstract class RegexCompiler
10{
11 private sealed class BacktrackNote
12 {
13 internal int _codepos;
14
15 internal int _flags;
16
17 internal Label _label;
18
19 public BacktrackNote(int flags, Label label, int codepos)
20 {
22 _flags = flags;
23 _label = label;
24 }
25 }
26
28 {
30
32
38
40 {
41 return local._local;
42 }
43
44 public void Dispose()
45 {
47 this = default(RentedLocalBuilder);
48 }
49 }
50
51 private static readonly FieldInfo s_runtextbegField = RegexRunnerField("runtextbeg");
52
53 private static readonly FieldInfo s_runtextendField = RegexRunnerField("runtextend");
54
55 private static readonly FieldInfo s_runtextstartField = RegexRunnerField("runtextstart");
56
57 private static readonly FieldInfo s_runtextposField = RegexRunnerField("runtextpos");
58
59 private static readonly FieldInfo s_runtextField = RegexRunnerField("runtext");
60
61 private static readonly FieldInfo s_runtrackposField = RegexRunnerField("runtrackpos");
62
63 private static readonly FieldInfo s_runtrackField = RegexRunnerField("runtrack");
64
65 private static readonly FieldInfo s_runstackposField = RegexRunnerField("runstackpos");
66
67 private static readonly FieldInfo s_runstackField = RegexRunnerField("runstack");
68
69 protected static readonly FieldInfo s_runtrackcountField = RegexRunnerField("runtrackcount");
70
71 private static readonly MethodInfo s_doubleStackMethod = RegexRunnerMethod("DoubleStack");
72
73 private static readonly MethodInfo s_doubleTrackMethod = RegexRunnerMethod("DoubleTrack");
74
75 private static readonly MethodInfo s_captureMethod = RegexRunnerMethod("Capture");
76
77 private static readonly MethodInfo s_transferCaptureMethod = RegexRunnerMethod("TransferCapture");
78
79 private static readonly MethodInfo s_uncaptureMethod = RegexRunnerMethod("Uncapture");
80
81 private static readonly MethodInfo s_isMatchedMethod = RegexRunnerMethod("IsMatched");
82
83 private static readonly MethodInfo s_matchLengthMethod = RegexRunnerMethod("MatchLength");
84
85 private static readonly MethodInfo s_matchIndexMethod = RegexRunnerMethod("MatchIndex");
86
87 private static readonly MethodInfo s_isBoundaryMethod = RegexRunnerMethod("IsBoundary");
88
89 private static readonly MethodInfo s_isECMABoundaryMethod = RegexRunnerMethod("IsECMABoundary");
90
91 private static readonly MethodInfo s_crawlposMethod = RegexRunnerMethod("Crawlpos");
92
93 private static readonly MethodInfo s_charInClassMethod = RegexRunnerMethod("CharInClass");
94
95 private static readonly MethodInfo s_checkTimeoutMethod = RegexRunnerMethod("CheckTimeout");
96
97 private static readonly MethodInfo s_charIsDigitMethod = typeof(char).GetMethod("IsDigit", new Type[1] { typeof(char) });
98
99 private static readonly MethodInfo s_charIsWhiteSpaceMethod = typeof(char).GetMethod("IsWhiteSpace", new Type[1] { typeof(char) });
100
101 private static readonly MethodInfo s_charGetUnicodeInfo = typeof(char).GetMethod("GetUnicodeCategory", new Type[1] { typeof(char) });
102
103 private static readonly MethodInfo s_charToLowerInvariantMethod = typeof(char).GetMethod("ToLowerInvariant", new Type[1] { typeof(char) });
104
105 private static readonly MethodInfo s_cultureInfoGetCurrentCultureMethod = typeof(CultureInfo).GetMethod("get_CurrentCulture");
106
107 private static readonly MethodInfo s_cultureInfoGetTextInfoMethod = typeof(CultureInfo).GetMethod("get_TextInfo");
108
109 private static readonly MethodInfo s_spanGetItemMethod = typeof(ReadOnlySpan<char>).GetMethod("get_Item", new Type[1] { typeof(int) });
110
111 private static readonly MethodInfo s_spanGetLengthMethod = typeof(ReadOnlySpan<char>).GetMethod("get_Length");
112
113 private static readonly MethodInfo s_memoryMarshalGetReference = typeof(MemoryMarshal).GetMethod("GetReference", new Type[1] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) }).MakeGenericMethod(typeof(char));
114
115 private static readonly MethodInfo s_spanIndexOf = typeof(MemoryExtensions).GetMethod("IndexOf", new Type[2]
116 {
119 }).MakeGenericMethod(typeof(char));
120
121 private static readonly MethodInfo s_spanIndexOfAnyCharChar = typeof(MemoryExtensions).GetMethod("IndexOfAny", new Type[3]
122 {
126 }).MakeGenericMethod(typeof(char));
127
128 private static readonly MethodInfo s_spanIndexOfAnyCharCharChar = typeof(MemoryExtensions).GetMethod("IndexOfAny", new Type[4]
129 {
134 }).MakeGenericMethod(typeof(char));
135
136 private static readonly MethodInfo s_spanSliceIntMethod = typeof(ReadOnlySpan<char>).GetMethod("Slice", new Type[1] { typeof(int) });
137
138 private static readonly MethodInfo s_spanSliceIntIntMethod = typeof(ReadOnlySpan<char>).GetMethod("Slice", new Type[2]
139 {
140 typeof(int),
141 typeof(int)
142 });
143
144 private static readonly MethodInfo s_spanStartsWith = typeof(MemoryExtensions).GetMethod("StartsWith", new Type[2]
145 {
148 }).MakeGenericMethod(typeof(char));
149
150 private static readonly MethodInfo s_stringAsSpanMethod = typeof(MemoryExtensions).GetMethod("AsSpan", new Type[1] { typeof(string) });
151
152 private static readonly MethodInfo s_stringAsSpanIntIntMethod = typeof(MemoryExtensions).GetMethod("AsSpan", new Type[3]
153 {
154 typeof(string),
155 typeof(int),
156 typeof(int)
157 });
158
159 private static readonly MethodInfo s_stringGetCharsMethod = typeof(string).GetMethod("get_Chars", new Type[1] { typeof(int) });
160
161 private static readonly MethodInfo s_stringIndexOfCharInt = typeof(string).GetMethod("IndexOf", new Type[2]
162 {
163 typeof(char),
164 typeof(int)
165 });
166
167 private static readonly MethodInfo s_textInfoToLowerMethod = typeof(TextInfo).GetMethod("ToLower", new Type[1] { typeof(char) });
168
169 protected ILGenerator _ilg;
170
171 private readonly bool _persistsAssembly;
172
174
176
178
180
182
184
186
188
190
192
194
195 protected RegexCode _code;
196
197 protected int[] _codes;
198
199 protected string[] _strings;
200
201 protected (string CharClass, bool CaseInsensitive)[] _leadingCharClasses;
202
204
205 protected int _leadingAnchor;
206
207 protected bool _hasTimeout;
208
209 private Label[] _labels;
210
212
213 private int _notecount;
214
215 protected int _trackcount;
216
218
220
222
223 private int _regexopcode;
224
225 private int _codepos;
226
227 private int _backpos;
228
229 private int[] _uniquenote;
230
231 private int[] _goto;
232
234 {
235 get
236 {
237 if (_textInfoLocal != null)
238 {
239 return (_options & RegexOptions.CultureInvariant) != 0;
240 }
241 return true;
242 }
243 }
244
249
250 private static FieldInfo RegexRunnerField(string fieldname)
251 {
252 return typeof(RegexRunner).GetField(fieldname, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
253 }
254
255 private static MethodInfo RegexRunnerMethod(string methname)
256 {
257 return typeof(RegexRunner).GetMethod(methname, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
258 }
259
264
265 private int AddBacktrackNote(int flags, Label l, int codepos)
266 {
267 if (_notes == null || _notecount >= _notes.Length)
268 {
269 BacktrackNote[] array = new BacktrackNote[(_notes == null) ? 16 : (_notes.Length * 2)];
270 if (_notes != null)
271 {
273 }
274 _notes = array;
275 }
276 _notes[_notecount] = new BacktrackNote(flags, l, codepos);
277 return _notecount++;
278 }
279
280 private int AddTrack()
281 {
282 return AddTrack(128);
283 }
284
285 private int AddTrack(int flags)
286 {
287 return AddBacktrackNote(flags, DefineLabel(), _codepos);
288 }
289
290 private int AddGoto(int destpos)
291 {
292 if (_goto[destpos] == -1)
293 {
295 }
296 return _goto[destpos];
297 }
298
299 private int AddUniqueTrack(int i)
300 {
301 return AddUniqueTrack(i, 128);
302 }
303
304 private int AddUniqueTrack(int i, int flags)
305 {
306 if (_uniquenote[i] == -1)
307 {
308 _uniquenote[i] = AddTrack(flags);
309 }
310 return _uniquenote[i];
311 }
312
314 {
315 return _ilg.DefineLabel();
316 }
317
318 private void MarkLabel(Label l)
319 {
321 }
322
323 private int Operand(int i)
324 {
325 return _codes[_codepos + i + 1];
326 }
327
328 private bool IsRightToLeft()
329 {
330 return (_regexopcode & 0x40) != 0;
331 }
332
333 private bool IsCaseInsensitive()
334 {
335 return (_regexopcode & 0x200) != 0;
336 }
337
338 private int Code()
339 {
340 return _regexopcode & 0x3F;
341 }
342
343 protected void Ldstr(string str)
344 {
346 }
347
348 protected void Ldc(int i)
349 {
351 }
352
353 protected void LdcI8(long i)
354 {
356 }
357
358 protected void Ret()
359 {
361 }
362
363 protected void Dup()
364 {
366 }
367
368 private void RemUn()
369 {
371 }
372
373 private void Ceq()
374 {
376 }
377
378 private void CgtUn()
379 {
381 }
382
383 private void CltUn()
384 {
386 }
387
388 private void Pop()
389 {
391 }
392
393 private void Add()
394 {
396 }
397
398 private void Add(bool negate)
399 {
401 }
402
403 private void Sub()
404 {
406 }
407
408 private void Sub(bool negate)
409 {
411 }
412
413 private void Neg()
414 {
416 }
417
418 private void Mul()
419 {
421 }
422
423 private void And()
424 {
426 }
427
428 private void Or()
429 {
431 }
432
433 private void Shl()
434 {
436 }
437
438 private void Shr()
439 {
441 }
442
443 private void Ldloc(LocalBuilder lt)
444 {
446 }
447
448 private void Ldloca(LocalBuilder lt)
449 {
451 }
452
453 private void LdindU2()
454 {
456 }
457
458 private void LdindI4()
459 {
461 }
462
463 private void LdindI8()
464 {
466 }
467
468 private void Unaligned(byte alignment)
469 {
471 }
472
473 private void Stloc(LocalBuilder lt)
474 {
476 }
477
478 protected void Ldthis()
479 {
481 }
482
483 protected void Ldthisfld(FieldInfo ft)
484 {
485 Ldthis();
486 Ldfld(ft);
487 }
488
490 {
491 Ldthisfld(ft);
492 Stloc(lt);
493 }
494
496 {
497 Ldthis();
498 Ldloc(lt);
499 Stfld(ft);
500 }
501
502 private void Ldfld(FieldInfo ft)
503 {
505 }
506
507 protected void Stfld(FieldInfo ft)
508 {
510 }
511
512 protected void Callvirt(MethodInfo mt)
513 {
515 }
516
517 protected void Call(MethodInfo mt)
518 {
520 }
521
522 private void BrfalseFar(Label l)
523 {
525 }
526
527 private void BrtrueFar(Label l)
528 {
530 }
531
532 private void BrFar(Label l)
533 {
534 _ilg.Emit(OpCodes.Br, l);
535 }
536
537 private void BleFar(Label l)
538 {
540 }
541
542 private void BltFar(Label l)
543 {
545 }
546
547 private void BltUnFar(Label l)
548 {
550 }
551
552 private void BgeFar(Label l)
553 {
555 }
556
557 private void BgeUnFar(Label l)
558 {
560 }
561
562 private void BgtFar(Label l)
563 {
565 }
566
567 private void BneFar(Label l)
568 {
570 }
571
572 private void BeqFar(Label l)
573 {
575 }
576
577 private void Brfalse(Label l)
578 {
580 }
581
582 private void Brtrue(Label l)
583 {
585 }
586
587 private void Br(Label l)
588 {
590 }
591
592 private void Ble(Label l)
593 {
595 }
596
597 private void Blt(Label l)
598 {
600 }
601
602 private void Bge(Label l)
603 {
605 }
606
607 private void BgeUn(Label l)
608 {
610 }
611
612 private void Bgt(Label l)
613 {
615 }
616
617 private void BgtUn(Label l)
618 {
620 }
621
622 private void Bne(Label l)
623 {
625 }
626
627 private void Beq(Label l)
628 {
630 }
631
632 private void Ldlen()
633 {
635 }
636
637 private void LdelemI4()
638 {
640 }
641
642 private void StelemI4()
643 {
645 }
646
647 private void Switch(Label[] table)
648 {
649 _ilg.Emit(OpCodes.Switch, table);
650 }
651
653 {
654 return _ilg.DeclareLocal(typeof(int));
655 }
656
658 {
660 }
661
663 {
664 return _ilg.DeclareLocal(typeof(int[]));
665 }
666
668 {
669 return _ilg.DeclareLocal(typeof(string));
670 }
671
676
682
688
689 private void Rightchar()
690 {
694 }
695
706
707 private void Leftchar()
708 {
711 Ldc(1);
712 Sub();
714 }
715
716 private void Leftcharnext()
717 {
719 Ldc(1);
720 Sub();
725 }
726
727 private void Track()
728 {
730 Ldc(AddTrack());
731 DoPush();
732 }
733
734 private void Trackagain()
735 {
737 Ldc(_backpos);
738 DoPush();
739 }
740
742 {
744 Ldloc(lt);
745 DoPush();
746 }
747
748 private void TrackUnique(int i)
749 {
752 DoPush();
753 }
754
755 private void TrackUnique2(int i)
756 {
758 Ldc(AddUniqueTrack(i, 256));
759 DoPush();
760 }
761
762 private void ReadyPushTrack()
763 {
765 Ldc(1);
766 Sub();
770 }
771
785
786 private void TopTrack()
787 {
790 LdelemI4();
791 }
792
794 {
796 Ldloc(lt);
797 DoPush();
798 }
799
800 internal void ReadyReplaceStack(int i)
801 {
804 if (i != 0)
805 {
806 Ldc(i);
807 Add();
808 }
809 }
810
811 private void ReadyPushStack()
812 {
814 Ldc(1);
815 Sub();
819 }
820
821 private void TopStack()
822 {
825 LdelemI4();
826 }
827
841
842 private void PopDiscardStack()
843 {
845 }
846
847 private void PopDiscardStack(int i)
848 {
850 Ldc(i);
851 Add();
853 }
854
855 private void DoReplace()
856 {
857 StelemI4();
858 }
859
860 private void DoPush()
861 {
862 StelemI4();
863 }
864
865 private void Back()
866 {
868 }
869
870 private void Goto(int i)
871 {
872 if (i < _codepos)
873 {
874 Label l = DefineLabel();
876 Ldc(_trackcount * 4);
877 Ble(l);
879 Ldc(_trackcount * 3);
880 BgtFar(_labels[i]);
881 MarkLabel(l);
883 Ldc(AddGoto(i));
884 DoPush();
886 }
887 else
888 {
889 BrFar(_labels[i]);
890 }
891 }
892
893 private int NextCodepos()
894 {
896 }
897
899 {
900 return _labels[NextCodepos()];
901 }
902
903 private void Advance()
904 {
906 }
907
914
928
930 {
931 switch (char.GetUnicodeCategory((char)comparison))
932 {
933 case UnicodeCategory.DecimalDigitNumber:
934 case UnicodeCategory.OtherNumber:
935 case UnicodeCategory.SpaceSeparator:
936 case UnicodeCategory.LineSeparator:
937 case UnicodeCategory.ParagraphSeparator:
938 case UnicodeCategory.Control:
939 case UnicodeCategory.ConnectorPunctuation:
940 case UnicodeCategory.DashPunctuation:
941 case UnicodeCategory.OpenPunctuation:
942 case UnicodeCategory.ClosePunctuation:
943 case UnicodeCategory.InitialQuotePunctuation:
944 case UnicodeCategory.FinalQuotePunctuation:
945 case UnicodeCategory.OtherPunctuation:
946 return false;
947 default:
948 return true;
949 }
950 }
951
953 {
954 _uniquenote = new int[10];
955 _labels = new Label[_codes.Length];
956 _goto = new int[_codes.Length];
957 Array.Fill(_uniquenote, -1);
958 for (int i = 0; i < _codes.Length; i += RegexCode.OpcodeSize(_codes[i]))
959 {
960 _goto[i] = -1;
961 _labels[i] = DefineLabel();
962 }
971 _backpos = -1;
972 for (int j = 0; j < _codes.Length; j += RegexCode.OpcodeSize(_codes[j]))
973 {
975 _codepos = j;
978 }
979 }
980
1017
1019 {
1020 for (int i = 0; i < _notecount; i++)
1021 {
1023 if (backtrackNote._flags != 0)
1024 {
1025 MarkLabel(backtrackNote._label);
1026 _codepos = backtrackNote._codepos;
1027 _backpos = i;
1028 _regexopcode = _codes[backtrackNote._codepos] | backtrackNote._flags;
1030 }
1031 }
1032 }
1033
1034 protected void GenerateFindFirstChar()
1035 {
1040 if (_code.RightToLeft)
1041 {
1043 }
1045 _textInfoLocal = null;
1046 if (!_options.HasFlag(RegexOptions.CultureInvariant))
1047 {
1048 bool flag = _options.HasFlag(RegexOptions.IgnoreCase) || (_boyerMoorePrefix?.CaseInsensitive ?? false);
1049 if (!flag && _leadingCharClasses != null)
1050 {
1051 for (int i = 0; i < _leadingCharClasses.Length; i++)
1052 {
1053 if (_leadingCharClasses[i].CaseInsensitive)
1054 {
1055 flag = true;
1056 break;
1057 }
1058 }
1059 }
1060 if (flag)
1061 {
1064 }
1065 }
1068 if (_code.RightToLeft)
1069 {
1071 }
1073 Label l = DefineLabel();
1074 Label l2 = DefineLabel();
1075 if (!_code.RightToLeft)
1076 {
1079 if (minRequiredLength > 0)
1080 {
1082 Sub();
1083 }
1084 Ble(l2);
1085 MarkLabel(l);
1086 Ldthis();
1088 }
1089 else
1090 {
1092 if (minRequiredLength > 0)
1093 {
1095 Sub();
1096 }
1098 Bge(l2);
1099 MarkLabel(l);
1100 Ldthis();
1102 }
1104 Ldc(0);
1105 Ret();
1106 MarkLabel(l2);
1107 if (((uint)_leadingAnchor & 0x37u) != 0)
1108 {
1109 switch (_leadingAnchor)
1110 {
1111 case 1:
1112 {
1113 Label l5 = DefineLabel();
1115 if (!_code.RightToLeft)
1116 {
1118 Ble(l5);
1119 Br(l);
1120 }
1121 else
1122 {
1124 Ble(l5);
1125 Ldthis();
1128 }
1129 MarkLabel(l5);
1130 Ldc(1);
1131 Ret();
1132 return;
1133 }
1134 case 4:
1135 {
1136 Label l4 = DefineLabel();
1139 if (!_code.RightToLeft)
1140 {
1141 Ble(l4);
1142 }
1143 else
1144 {
1145 Bge(l4);
1146 }
1147 Br(l);
1148 MarkLabel(l4);
1149 Ldc(1);
1150 Ret();
1151 return;
1152 }
1153 case 16:
1154 {
1155 Label l7 = DefineLabel();
1156 if (!_code.RightToLeft)
1157 {
1160 Ldc(1);
1161 Sub();
1162 Bge(l7);
1163 Ldthis();
1165 Ldc(1);
1166 Sub();
1168 MarkLabel(l7);
1169 }
1170 else
1171 {
1172 Label l8 = DefineLabel();
1175 Ldc(1);
1176 Sub();
1177 Blt(l7);
1180 Beq(l8);
1184 Ldc(10);
1185 Beq(l8);
1186 MarkLabel(l7);
1187 BrFar(l);
1188 MarkLabel(l8);
1189 }
1190 Ldc(1);
1191 Ret();
1192 return;
1193 }
1194 case 32:
1195 if (minRequiredLength == 0)
1196 {
1197 Label l6 = DefineLabel();
1200 if (!_code.RightToLeft)
1201 {
1202 Bge(l6);
1203 Ldthis();
1206 }
1207 else
1208 {
1209 Bge(l6);
1210 Br(l);
1211 }
1212 MarkLabel(l6);
1213 Ldc(1);
1214 Ret();
1215 return;
1216 }
1217 break;
1218 case 2:
1219 if (!_code.RightToLeft)
1220 {
1221 Label l3 = DefineLabel();
1224 Ble(l3);
1227 Ldc(1);
1228 Sub();
1230 Ldc(10);
1231 Beq(l3);
1233 Ldc(10);
1237 {
1240 Ldc(-1);
1241 Beq(l);
1243 Ldc(1);
1244 Add();
1246 Bgt(l);
1248 Ldc(1);
1249 Add();
1251 }
1252 MarkLabel(l3);
1253 }
1254 break;
1255 }
1256 }
1258 {
1260 int num;
1261 int index;
1262 if (!_code.RightToLeft)
1263 {
1265 num = -1;
1266 index = _boyerMoorePrefix.Pattern.Length - 1;
1267 }
1268 else
1269 {
1271 num = _boyerMoorePrefix.Pattern.Length;
1272 index = 0;
1273 }
1277 if (!_code.RightToLeft)
1278 {
1279 Ldc(_boyerMoorePrefix.Pattern.Length - 1);
1280 Add();
1281 }
1282 else
1283 {
1285 Sub();
1286 }
1288 Label l9 = DefineLabel();
1289 Br(l9);
1290 Label l10 = DefineLabel();
1291 MarkLabel(l10);
1293 Label l11 = DefineLabel();
1294 MarkLabel(l11);
1296 Add();
1298 MarkLabel(l9);
1300 Ldloc(lt);
1301 if (!_code.RightToLeft)
1302 {
1303 BgeFar(l);
1304 }
1305 else
1306 {
1307 BltFar(l);
1308 }
1309 Rightchar();
1311 {
1312 CallToLower();
1313 }
1314 Label l12 = DefineLabel();
1316 {
1319 Ldc(i2);
1320 BeqFar(l12);
1323 Sub();
1327 BgtUn(l10);
1328 int num2 = _boyerMoorePrefix.HighASCII - _boyerMoorePrefix.LowASCII + 1;
1329 if (num2 > 1)
1330 {
1331 string str = string.Create(num2, (this, num), delegate(Span<char> span, (RegexCompiler thisRef, int beforefirst) state)
1332 {
1333 for (int k = 0; k < span.Length; k++)
1334 {
1335 int num8 = state.thisRef._boyerMoorePrefix.NegativeASCII[k + state.thisRef._boyerMoorePrefix.LowASCII];
1336 if (num8 == state.beforefirst)
1337 {
1338 num8 = state.thisRef._boyerMoorePrefix.Pattern.Length;
1339 }
1340 else if (state.thisRef._code.RightToLeft)
1341 {
1342 num8 = -num8;
1343 }
1344 span[k] = (char)num8;
1345 }
1346 });
1347 Ldstr(str);
1350 if (_code.RightToLeft)
1351 {
1352 Neg();
1353 }
1354 }
1355 else
1356 {
1358 if (num3 == num)
1359 {
1360 num3 = (_code.RightToLeft ? (-_boyerMoorePrefix.Pattern.Length) : _boyerMoorePrefix.Pattern.Length);
1361 }
1362 Ldc(num3);
1363 }
1364 BrFar(l11);
1365 }
1366 MarkLabel(l12);
1370 int num4 = int.MaxValue;
1371 Label l13 = default(Label);
1372 for (int num5 = _boyerMoorePrefix.Pattern.Length - 2; num5 >= 0; num5--)
1373 {
1374 int num6 = (_code.RightToLeft ? (_boyerMoorePrefix.Pattern.Length - 1 - num5) : num5);
1377 Ldc(1);
1383 {
1384 CallToLower();
1385 }
1388 {
1389 BneFar(l13);
1390 }
1391 else
1392 {
1393 Label l14 = DefineLabel();
1394 Beq(l14);
1395 l13 = DefineLabel();
1397 MarkLabel(l13);
1398 Ldc(num4);
1399 BrFar(l11);
1400 MarkLabel(l14);
1401 }
1402 }
1403 Ldthis();
1405 if (_code.RightToLeft)
1406 {
1407 Ldc(1);
1408 Add();
1409 }
1411 Ldc(1);
1412 Ret();
1413 return;
1414 }
1415 if (_leadingCharClasses == null)
1416 {
1417 Ldc(1);
1418 Ret();
1419 return;
1420 }
1421 if (_code.RightToLeft)
1422 {
1424 {
1425 Label l15 = DefineLabel();
1426 Label l16 = DefineLabel();
1427 Label l17 = DefineLabel();
1428 Label l18 = DefineLabel();
1429 Label l19 = DefineLabel();
1433 Sub();
1435 if (minRequiredLength == 0)
1436 {
1438 Ldc(0);
1439 BleFar(l18);
1440 }
1441 MarkLabel(l15);
1443 Ldc(1);
1444 Sub();
1446 Leftcharnext();
1448 {
1450 Brtrue(l16);
1451 }
1452 else
1453 {
1455 Beq(l16);
1456 }
1457 MarkLabel(l19);
1459 Ldc(0);
1461 {
1462 BgtFar(l15);
1463 }
1464 else
1465 {
1466 Bgt(l15);
1467 }
1468 Ldc(0);
1469 Br(l17);
1470 MarkLabel(l16);
1472 Ldc(1);
1475 Ldc(1);
1476 MarkLabel(l17);
1478 Ret();
1479 MarkLabel(l18);
1480 Ldc(0);
1481 Ret();
1482 return;
1483 }
1484 }
1486 {
1488 if (_leadingCharClasses.Length > 1)
1489 {
1490 Ldc(_leadingCharClasses.Length - 1);
1491 Sub();
1492 }
1494 BleFar(l);
1495 }
1502 Sub();
1505 Span<char> chars = stackalloc char[3];
1506 int num7 = 0;
1507 int j = 0;
1509 bool flag3 = !flag2 || _leadingCharClasses.Length > 1;
1510 Label l20 = default(Label);
1511 Label l21 = default(Label);
1512 Label l22 = default(Label);
1513 if (flag3)
1514 {
1515 l20 = DefineLabel();
1516 l21 = DefineLabel();
1517 l22 = DefineLabel();
1518 Ldc(0);
1520 BrFar(l20);
1521 MarkLabel(l22);
1522 }
1523 if (flag2)
1524 {
1525 j = 1;
1526 if (flag3)
1527 {
1531 }
1532 else
1533 {
1535 }
1536 switch (num7)
1537 {
1538 case 1:
1539 Ldc(chars[0]);
1541 break;
1542 case 2:
1543 Ldc(chars[0]);
1544 Ldc(chars[1]);
1546 break;
1547 default:
1548 Ldc(chars[0]);
1549 Ldc(chars[1]);
1550 Ldc(chars[2]);
1552 break;
1553 }
1554 if (flag3)
1555 {
1560 Add();
1563 Ldc(0);
1564 BltFar(l);
1565 }
1566 else
1567 {
1570 Ldc(0);
1571 BltFar(l);
1572 }
1573 if (_leadingCharClasses.Length > 1)
1574 {
1577 Ldc(_leadingCharClasses.Length - 1);
1578 Sub();
1580 BleFar(l);
1581 }
1582 }
1583 for (; j < _leadingCharClasses.Length; j++)
1584 {
1587 if (j > 0)
1588 {
1589 Ldc(j);
1590 Add();
1591 }
1593 LdindU2();
1595 BrfalseFar(l21);
1596 }
1597 Ldthis();
1600 Add();
1602 Ldc(1);
1603 Ret();
1604 if (flag3)
1605 {
1606 MarkLabel(l21);
1608 Ldc(1);
1609 Add();
1611 MarkLabel(l20);
1615 if (_leadingCharClasses.Length > 1)
1616 {
1617 Ldc(_leadingCharClasses.Length - 1);
1618 Sub();
1619 }
1620 BltFar(l22);
1621 BrFar(l);
1622 }
1623 }
1624
1626 {
1627 if ((node.Options & RegexOptions.RightToLeft) != 0)
1628 {
1629 return false;
1630 }
1631 node = node.Child(0);
1633 {
1634 return false;
1635 }
1641 Label l = DefineLabel();
1643 if (_hasTimeout)
1644 {
1646 }
1653 Stloc(lt);
1654 int textSpanPos = 0;
1656 EmitNode(node);
1657 MarkLabel(l);
1658 Ldthis();
1660 if (textSpanPos > 0)
1661 {
1663 Add();
1666 }
1668 Ldthis();
1669 Ldc(0);
1670 Ldloc(lt);
1673 if (((uint)node.Options & 0x80000000u) != 0)
1674 {
1675 Label l2 = DefineLabel();
1676 Br(l2);
1678 Label l3 = DefineLabel();
1679 Label l4 = DefineLabel();
1680 Br(l3);
1681 MarkLabel(l4);
1682 Ldthis();
1684 MarkLabel(l3);
1685 Ldthis();
1687 Brtrue(l4);
1688 MarkLabel(l2);
1689 }
1690 else
1691 {
1693 }
1694 Ret();
1695 return true;
1697 {
1698 switch (node.Type)
1699 {
1700 default:
1701 return;
1702 case 18:
1703 case 19:
1704 if (textSpanPos > 0)
1705 {
1707 }
1708 else
1709 {
1713 }
1714 return;
1715 case 14:
1716 if (textSpanPos > 0)
1717 {
1719 Ldc(textSpanPos - 1);
1721 LdindU2();
1722 Ldc(10);
1724 }
1725 else
1726 {
1727 Label l5 = DefineLabel();
1730 Ble(l5);
1733 Ldc(1);
1734 Sub();
1736 Ldc(10);
1738 MarkLabel(l5);
1739 }
1740 return;
1741 case 21:
1746 return;
1747 case 20:
1751 Ldc(1);
1752 Sub();
1754 break;
1755 case 15:
1756 break;
1757 case 16:
1758 case 17:
1759 return;
1760 }
1761 Label l6 = DefineLabel();
1765 BgeUn(l6);
1769 LdindU2();
1770 Ldc(10);
1772 MarkLabel(l6);
1773 }
1775 {
1779 int num2 = textSpanPos;
1781 if (((uint)node.Options & 0x80000000u) != 0)
1782 {
1784 Ldthis();
1787 Stloc(rentedLocalBuilder7.HasValue ? ((LocalBuilder)rentedLocalBuilder7.GetValueOrDefault()) : null);
1788 }
1789 Label l17 = DefineLabel();
1791 int num3 = node.ChildCount();
1792 for (int j = 0; j < num3 - 1; j++)
1793 {
1795 EmitNode(node.Child(j));
1797 BrFar(l17);
1798 MarkLabel(l18);
1802 textSpanPos = num2;
1803 if (rentedLocalBuilder6.HasValue)
1804 {
1806 EmitUncaptureUntil(rentedLocalBuilder7.HasValue ? ((LocalBuilder)rentedLocalBuilder7.GetValueOrDefault()) : null);
1807 }
1808 }
1809 if (rentedLocalBuilder6.HasValue)
1810 {
1812 EmitNode(node.Child(num3 - 1));
1813 doneLabel = label4;
1815 Br(l17);
1816 MarkLabel(l19);
1818 EmitUncaptureUntil(rentedLocalBuilder7.HasValue ? ((LocalBuilder)rentedLocalBuilder7.GetValueOrDefault()) : null);
1820 }
1821 else
1822 {
1823 doneLabel = label4;
1824 EmitNode(node.Child(num3 - 1));
1826 }
1827 MarkLabel(l17);
1828 rentedLocalBuilder6?.Dispose();
1829 }
1831 {
1832 if (node.M == node.N)
1833 {
1835 return;
1836 }
1842 Label l10 = DefineLabel();
1843 Label l11 = DefineLabel();
1844 int m2 = node.M;
1845 int n2 = node.N;
1846 Ldc(0);
1848 BrFar(l10);
1849 MarkLabel(l11);
1851 Label l12 = DefineLabel();
1856 EmitNode(node.Child(0));
1858 Br(l12);
1860 doneLabel = label3;
1864 MarkLabel(l12);
1866 Ldc(1);
1867 Add();
1869 MarkLabel(l10);
1870 if (n2 != int.MaxValue)
1871 {
1873 Ldc(n2);
1874 BltFar(l11);
1875 }
1876 else
1877 {
1878 BrFar(l11);
1879 }
1881 doneLabel = label2;
1882 if (m2 > 0)
1883 {
1885 Ldc(m2);
1887 }
1888 }
1890 {
1891 Label l7 = DefineLabel();
1895 BgeUnFar(l7);
1899 LdindU2();
1900 switch (node.Type)
1901 {
1902 case 43:
1904 {
1905 CallToLower();
1906 }
1907 Ldc(node.Ch);
1908 BneFar(l7);
1909 break;
1910 case 44:
1912 {
1913 CallToLower();
1914 }
1915 Ldc(node.Ch);
1916 BeqFar(l7);
1917 break;
1918 case 45:
1920 BrfalseFar(l7);
1921 break;
1922 }
1924 Ldc(1);
1928 Ldc(1);
1929 Add();
1931 MarkLabel(l7);
1932 }
1934 {
1935 Ldthis();
1937 if (textSpanPos > 0)
1938 {
1940 Add();
1941 }
1944 switch (node.Type)
1945 {
1946 case 16:
1949 break;
1950 case 17:
1953 break;
1954 case 41:
1957 break;
1958 default:
1961 break;
1962 }
1963 }
1965 {
1967 int num5 = node.M;
1968 if (num5 != -1 && _code.Caps != null)
1969 {
1970 num5 = (int)_code.Caps[num5];
1971 }
1975 EmitNode(node.Child(0));
1977 Ldthis();
1978 Ldc(num5);
1982 }
1984 {
1985 bool flag = IsCaseInsensitive(node);
1986 if (!flag && node.Str.Length > 64)
1987 {
1991 Ldstr(node.Str);
1995 textSpanPos += node.Str.Length;
1996 }
1997 else
1998 {
2000 EmitSpanLengthCheck(span.Length);
2001 if (!flag && !_persistsAssembly)
2002 {
2003 if (IntPtr.Size == 8)
2004 {
2005 while (span.Length >= 4)
2006 {
2008 Unaligned(1);
2009 LdindI8();
2010 LdcI8(MemoryMarshal.Read<long>(MemoryMarshal.AsBytes(span)));
2012 textSpanPos += 4;
2013 span = span.Slice(4);
2014 }
2015 }
2016 while (span.Length >= 2)
2017 {
2019 Unaligned(1);
2020 LdindI4();
2021 Ldc(MemoryMarshal.Read<int>(MemoryMarshal.AsBytes(span)));
2023 textSpanPos += 2;
2024 span = span.Slice(2);
2025 }
2026 }
2027 for (int i = 0; i < span.Length; i++)
2028 {
2030 textSpanPos++;
2031 LdindU2();
2032 if (flag && ParticipatesInCaseConversion(span[i]))
2033 {
2034 CallToLower();
2035 }
2036 Ldc(span[i]);
2038 }
2039 }
2040 }
2042 {
2046 int num7 = textSpanPos;
2049 EmitNode(node.Child(0));
2050 BrFar(label5);
2052 doneLabel = label5;
2056 textSpanPos = num7;
2057 }
2058 void EmitNode(RegexNode node)
2059 {
2060 switch (node.Type)
2061 {
2062 case 9:
2063 case 10:
2064 case 11:
2066 break;
2067 case 16:
2068 case 17:
2069 case 41:
2070 case 42:
2072 break;
2073 case 14:
2074 case 15:
2075 case 18:
2076 case 19:
2077 case 20:
2078 case 21:
2080 break;
2081 case 12:
2083 break;
2084 case 43:
2085 case 44:
2086 case 45:
2088 break;
2089 case 26:
2091 break;
2092 case 27:
2093 if (node.M > 0)
2094 {
2096 }
2097 break;
2098 case 32:
2099 EmitNode(node.Child(0));
2100 break;
2101 case 24:
2103 break;
2104 case 3:
2105 case 4:
2106 case 5:
2107 case 6:
2108 case 7:
2109 case 8:
2111 break;
2112 case 25:
2113 {
2114 int num8 = node.ChildCount();
2115 for (int num9 = 0; num9 < num8; num9++)
2116 {
2117 EmitNode(node.Child(num9));
2118 }
2119 break;
2120 }
2121 case 28:
2123 break;
2124 case 30:
2126 break;
2127 case 31:
2129 break;
2130 case 22:
2132 break;
2133 case 46:
2135 break;
2136 case 13:
2137 case 23:
2138 case 29:
2139 case 33:
2140 case 34:
2141 case 35:
2142 case 36:
2143 case 37:
2144 case 38:
2145 case 39:
2146 case 40:
2147 break;
2148 }
2149 }
2151 {
2152 int m3 = node.M;
2153 if (m3 == 1)
2154 {
2155 EmitNode(node.Child(0));
2156 return;
2157 }
2159 Label l13 = DefineLabel();
2160 Label l14 = DefineLabel();
2162 Ldc(0);
2164 BrFar(l13);
2165 MarkLabel(l14);
2167 EmitNode(node.Child(0));
2170 Ldc(1);
2171 Add();
2173 MarkLabel(l13);
2175 Ldc(m3);
2176 BltFar(l14);
2177 }
2179 {
2183 int num6 = textSpanPos;
2184 EmitNode(node.Child(0));
2188 textSpanPos = num6;
2189 }
2191 {
2192 if (emitLengthCheck)
2193 {
2195 }
2199 LdindU2();
2200 switch (node.Type)
2201 {
2202 case 5:
2203 case 8:
2204 case 11:
2205 case 45:
2208 break;
2209 case 3:
2210 case 6:
2211 case 9:
2212 case 43:
2214 {
2215 CallToLower();
2216 }
2217 Ldc(node.Ch);
2219 break;
2220 default:
2222 {
2223 CallToLower();
2224 }
2225 Ldc(node.Ch);
2227 break;
2228 }
2229 textSpanPos++;
2230 }
2232 {
2233 if (node.M == node.N)
2234 {
2236 }
2237 else
2238 {
2239 if (node.M != 0 || node.N != 1)
2240 {
2241 int m = node.M;
2242 int n = node.N;
2246 Span<char> chars = stackalloc char[3];
2247 int num = 0;
2248 if (node.Type == 44 && n == int.MaxValue && (!IsCaseInsensitive(node) || !ParticipatesInCaseConversion(node.Ch)))
2249 {
2250 if (textSpanPos > 0)
2251 {
2255 }
2256 else
2257 {
2259 }
2260 Ldc(node.Ch);
2264 Ldc(-1);
2268 if (textSpanPos > 0)
2269 {
2271 Sub();
2272 }
2274 }
2275 else if (node.Type == 45 && n == int.MaxValue && !IsCaseInsensitive(node) && (num = RegexCharClass.GetSetChars(node.Str, chars)) > 1 && RegexCharClass.IsNegated(node.Str))
2276 {
2277 if (textSpanPos > 0)
2278 {
2282 }
2283 else
2284 {
2286 }
2287 Ldc(chars[0]);
2288 Ldc(chars[1]);
2289 if (num == 2)
2290 {
2292 }
2293 else
2294 {
2295 Ldc(chars[2]);
2297 }
2300 Ldc(-1);
2304 if (textSpanPos > 0)
2305 {
2307 Sub();
2308 }
2310 }
2311 else if (node.Type == 45 && n == int.MaxValue && node.Str == "\0\u0001\0\0")
2312 {
2316 Sub();
2318 }
2319 else
2320 {
2322 Label l8 = DefineLabel();
2323 Label l9 = DefineLabel();
2324 Ldc(0);
2326 BrFar(l8);
2327 MarkLabel(l9);
2336 LdindU2();
2337 switch (node.Type)
2338 {
2339 case 43:
2341 {
2342 CallToLower();
2343 }
2344 Ldc(node.Ch);
2346 break;
2347 case 44:
2349 {
2350 CallToLower();
2351 }
2352 Ldc(node.Ch);
2354 break;
2355 case 45:
2358 break;
2359 }
2361 Ldc(1);
2362 Add();
2364 MarkLabel(l8);
2365 if (n != int.MaxValue)
2366 {
2368 Ldc(n);
2369 BltFar(l9);
2370 }
2371 else
2372 {
2373 BrFar(l9);
2374 }
2375 }
2377 doneLabel = label;
2378 if (m > 0)
2379 {
2381 Ldc(m);
2383 }
2390 Add();
2392 return;
2393 }
2395 }
2396 }
2398 {
2399 int m4 = node.M;
2400 if (m4 != 0)
2401 {
2403 if (m4 > 16)
2404 {
2405 Label l20 = DefineLabel();
2406 Label l21 = DefineLabel();
2410 Ldc(m4);
2414 Ldc(0);
2416 BrFar(l20);
2417 MarkLabel(l21);
2420 int num4 = textSpanPos;
2422 textSpanPos = 0;
2425 textSpanPos = num4;
2427 Ldc(1);
2428 Add();
2430 MarkLabel(l20);
2434 BltFar(l21);
2435 textSpanPos += m4;
2436 return;
2437 }
2438 for (int k = 0; k < m4; k++)
2439 {
2441 }
2442 }
2443 }
2445 {
2450 }
2452 {
2453 if (local == null)
2454 {
2455 Ldc(constant);
2456 }
2457 else if (constant == 0)
2458 {
2459 Ldloc(local);
2460 }
2461 else
2462 {
2463 Ldloc(local);
2464 Ldc(constant);
2465 Add();
2466 }
2467 }
2468 void EmitTextSpanOffset()
2469 {
2472 if (textSpanPos > 0)
2473 {
2474 Ldc(textSpanPos * 2);
2475 Add();
2476 }
2477 }
2479 {
2480 Label l15 = DefineLabel();
2481 Label l16 = DefineLabel();
2482 Br(l15);
2483 MarkLabel(l16);
2484 Ldthis();
2486 MarkLabel(l15);
2487 Ldthis();
2490 Bne(l16);
2491 }
2492 void EmitUpdateBumpalong()
2493 {
2495 Ldthis();
2498 }
2499 static bool IsCaseInsensitive(RegexNode node)
2500 {
2501 return (node.Options & RegexOptions.IgnoreCase) != 0;
2502 }
2503 void LoadTextSpanLocal()
2504 {
2509 Sub();
2512 }
2514 {
2515 bool flag2 = false;
2516 if ((node.Options & RegexOptions.RightToLeft) == 0 && maxDepth > 0)
2517 {
2518 int num10 = node.ChildCount();
2519 switch (node.Type)
2520 {
2521 case 9:
2522 case 10:
2523 case 11:
2524 case 12:
2525 case 14:
2526 case 15:
2527 case 16:
2528 case 17:
2529 case 18:
2530 case 19:
2531 case 20:
2532 case 21:
2533 case 22:
2534 case 23:
2535 case 41:
2536 case 42:
2537 case 43:
2538 case 44:
2539 case 45:
2540 case 46:
2541 flag2 = true;
2542 break;
2543 case 3:
2544 case 4:
2545 case 5:
2546 case 6:
2547 case 7:
2548 case 8:
2549 flag2 = node.M == node.N || (node.Next != null && node.Next.Type == 32);
2550 break;
2551 case 26:
2552 case 27:
2553 flag2 = (node.M == node.N || (node.Next != null && node.Next.Type == 32)) && NodeSupportsNonBacktrackingImplementation(node.Child(0), maxDepth - 1);
2554 break;
2555 case 30:
2556 case 31:
2557 case 32:
2559 break;
2560 case 24:
2561 if (node.Next == null || (!node.IsAtomicByParent() && (node.Next.Type != 28 || node.Next.Next != null)))
2562 {
2563 break;
2564 }
2565 goto case 25;
2566 case 25:
2567 {
2568 flag2 = true;
2569 for (int num11 = 0; num11 < num10; num11++)
2570 {
2572 {
2573 flag2 = false;
2574 break;
2575 }
2576 }
2577 break;
2578 }
2579 case 28:
2580 flag2 = node.N == -1;
2581 if (flag2)
2582 {
2583 RegexNode regexNode = node.Next;
2584 while (regexNode != null)
2585 {
2586 switch (regexNode.Type)
2587 {
2588 case 24:
2589 case 25:
2590 case 28:
2591 case 30:
2592 case 32:
2593 regexNode = regexNode.Next;
2594 break;
2595 default:
2596 regexNode = null;
2597 flag2 = false;
2598 break;
2599 }
2600 }
2601 if (flag2)
2602 {
2604 if (flag2)
2605 {
2606 regexNode = node;
2607 while (regexNode != null && (regexNode.Options & (RegexOptions)(-2147483648)) == 0)
2608 {
2609 regexNode.Options |= (RegexOptions)(-2147483648);
2610 regexNode = regexNode.Next;
2611 }
2612 }
2613 }
2614 }
2615 break;
2616 }
2617 }
2618 return flag2;
2619 }
2621 {
2622 if (textSpanPos > 0)
2623 {
2626 Add();
2632 textSpanPos = 0;
2633 }
2634 }
2635 }
2636
2665
2667 {
2668 _textInfoLocal = null;
2669 if ((_options & RegexOptions.CultureInvariant) != 0)
2670 {
2671 return;
2672 }
2673 bool flag = (_options & RegexOptions.IgnoreCase) != 0;
2674 if (!flag)
2675 {
2676 for (int i = 0; i < _codes.Length; i += RegexCode.OpcodeSize(_codes[i]))
2677 {
2678 if ((_codes[i] & 0x200) == 512)
2679 {
2680 flag = true;
2681 break;
2682 }
2683 }
2684 }
2685 if (flag)
2686 {
2689 }
2690 }
2691
2692 private void GenerateOneCode()
2693 {
2694 if (_hasTimeout)
2695 {
2696 Ldthis();
2698 }
2699 switch (_regexopcode)
2700 {
2701 case 40:
2703 Ret();
2704 break;
2705 case 22:
2706 Back();
2707 break;
2708 case 46:
2710 Dup();
2711 Ldlen();
2712 Ldc(1);
2713 Sub();
2715 StelemI4();
2716 break;
2717 case 38:
2718 Goto(Operand(0));
2719 break;
2720 case 37:
2721 Ldthis();
2722 Ldc(Operand(0));
2725 break;
2726 case 23:
2728 Track();
2729 break;
2730 case 151:
2731 PopTrack();
2733 Goto(Operand(0));
2734 break;
2735 case 30:
2737 Ldc(-1);
2738 DoPush();
2739 TrackUnique(0);
2740 break;
2741 case 31:
2743 TrackUnique(0);
2744 break;
2745 case 158:
2746 case 159:
2748 Back();
2749 break;
2750 case 33:
2752 PopStack();
2755 DoPush();
2756 Track();
2757 break;
2758 case 161:
2760 PopTrack();
2761 DoPush();
2762 Back();
2763 break;
2764 case 32:
2765 {
2766 if (Operand(1) != -1)
2767 {
2768 Ldthis();
2769 Ldc(Operand(1));
2772 }
2774 {
2775 PopStack();
2777 if (Operand(1) != -1)
2778 {
2779 Ldthis();
2780 Ldc(Operand(0));
2781 Ldc(Operand(1));
2785 }
2786 else
2787 {
2788 Ldthis();
2789 Ldc(Operand(0));
2793 }
2795 }
2796 TrackUnique((Operand(0) != -1 && Operand(1) != -1) ? 4 : 3);
2797 break;
2798 }
2799 case 160:
2801 PopTrack();
2802 DoPush();
2803 Ldthis();
2805 if (Operand(0) != -1 && Operand(1) != -1)
2806 {
2807 Ldthis();
2809 }
2810 Back();
2811 break;
2812 case 24:
2813 {
2814 Label l19 = DefineLabel();
2815 PopStack();
2817 {
2821 }
2823 Beq(l19);
2826 Track();
2827 Goto(Operand(0));
2828 MarkLabel(l19);
2829 TrackUnique2(5);
2830 break;
2831 }
2832 case 152:
2833 PopTrack();
2835 PopStack();
2836 Pop();
2837 TrackUnique2(5);
2838 Advance();
2839 break;
2840 case 280:
2842 PopTrack();
2843 DoPush();
2844 Back();
2845 break;
2846 case 25:
2847 {
2849 {
2850 PopStack();
2852 Label l16 = DefineLabel();
2853 Label l17 = DefineLabel();
2855 Ldc(-1);
2856 Beq(l16);
2858 Br(l17);
2859 MarkLabel(l16);
2861 MarkLabel(l17);
2862 Label l18 = DefineLabel();
2865 Beq(l18);
2867 Track();
2868 Br(AdvanceLabel());
2869 MarkLabel(l18);
2872 }
2873 DoPush();
2874 TrackUnique2(6);
2875 break;
2876 }
2877 case 153:
2878 PopTrack();
2881 TrackUnique2(6);
2882 Goto(Operand(0));
2883 break;
2884 case 281:
2886 PopTrack();
2887 DoReplace();
2888 Back();
2889 break;
2890 case 26:
2892 Ldc(-1);
2893 DoPush();
2895 Ldc(Operand(0));
2896 DoPush();
2897 TrackUnique(1);
2898 break;
2899 case 27:
2902 Ldc(Operand(0));
2903 DoPush();
2904 TrackUnique(1);
2905 break;
2906 case 154:
2907 case 155:
2908 PopDiscardStack(2);
2909 Back();
2910 break;
2911 case 28:
2912 {
2914 {
2915 PopStack();
2917 PopStack();
2919 {
2923 }
2924 Label l14 = DefineLabel();
2925 Label l15 = DefineLabel();
2927 Bne(l14);
2929 Ldc(0);
2930 Bge(l15);
2931 MarkLabel(l14);
2933 Ldc(Operand(1));
2934 Bge(l15);
2938 Ldc(1);
2939 Add();
2940 DoPush();
2941 Track();
2942 Goto(Operand(0));
2943 MarkLabel(l15);
2945 }
2946 TrackUnique2(7);
2947 break;
2948 }
2949 case 156:
2950 {
2952 {
2953 Label l12 = DefineLabel();
2954 PopStack();
2955 Ldc(1);
2956 Sub();
2959 Ldc(0);
2960 Blt(l12);
2961 PopStack();
2964 TrackUnique2(7);
2965 Advance();
2966 MarkLabel(l12);
2968 PopTrack();
2969 DoReplace();
2971 }
2972 Back();
2973 break;
2974 }
2975 case 284:
2976 {
2977 PopTrack();
2979 {
2982 PopTrack();
2983 DoPush();
2985 }
2986 Back();
2987 break;
2988 }
2989 case 29:
2990 {
2991 PopStack();
2993 {
2995 PopStack();
2997 {
2999 Label l10 = DefineLabel();
3001 Ldc(0);
3002 Bge(l10);
3007 Ldc(1);
3008 Add();
3009 DoPush();
3010 TrackUnique2(8);
3011 Goto(Operand(0));
3012 MarkLabel(l10);
3014 }
3016 }
3018 Track();
3019 break;
3020 }
3021 case 157:
3022 {
3024 {
3025 Label l4 = DefineLabel();
3026 PopTrack();
3028 PopTrack();
3031 Ldc(Operand(1));
3032 Bge(l4);
3034 TopTrack();
3035 Beq(l4);
3039 Ldc(1);
3040 Add();
3041 DoPush();
3042 TrackUnique2(8);
3043 Goto(Operand(0));
3044 MarkLabel(l4);
3046 PopTrack();
3047 DoPush();
3049 }
3050 Back();
3051 break;
3052 }
3053 case 285:
3055 PopTrack();
3056 DoReplace();
3058 TopStack();
3059 Ldc(1);
3060 Sub();
3061 DoReplace();
3062 Back();
3063 break;
3064 case 34:
3067 Ldlen();
3069 Sub();
3070 DoPush();
3072 Ldthis();
3074 DoPush();
3075 TrackUnique(1);
3076 break;
3077 case 162:
3078 PopDiscardStack(2);
3079 Back();
3080 break;
3081 case 35:
3082 {
3083 Label l = DefineLabel();
3084 Label l2 = DefineLabel();
3086 {
3087 PopStack();
3090 Ldlen();
3091 PopStack();
3092 Sub();
3094 MarkLabel(l);
3095 Ldthis();
3098 Beq(l2);
3099 Ldthis();
3101 Br(l);
3102 }
3103 MarkLabel(l2);
3104 Back();
3105 break;
3106 }
3107 case 36:
3108 {
3109 PopStack();
3111 {
3114 Ldlen();
3115 PopStack();
3116 Sub();
3119 }
3120 TrackUnique(9);
3121 break;
3122 }
3123 case 164:
3124 {
3125 Label l22 = DefineLabel();
3126 Label l23 = DefineLabel();
3128 {
3129 PopTrack();
3131 MarkLabel(l22);
3132 Ldthis();
3135 Beq(l23);
3136 Ldthis();
3138 Br(l22);
3139 }
3140 MarkLabel(l23);
3141 Back();
3142 break;
3143 }
3144 case 14:
3145 {
3149 Ble(l21);
3150 Leftchar();
3151 Ldc(10);
3153 break;
3154 }
3155 case 15:
3156 {
3160 Bge(l20);
3161 Rightchar();
3162 Ldc(10);
3164 break;
3165 }
3166 case 16:
3167 case 17:
3168 Ldthis();
3173 if (Code() == 16)
3174 {
3176 }
3177 else
3178 {
3180 }
3181 break;
3182 case 41:
3183 case 42:
3184 Ldthis();
3189 if (Code() == 41)
3190 {
3192 }
3193 else
3194 {
3196 }
3197 break;
3198 case 18:
3202 break;
3203 case 19:
3207 break;
3208 case 20:
3211 Ldc(1);
3212 Sub();
3217 Rightchar();
3218 Ldc(10);
3220 break;
3221 case 21:
3225 break;
3226 case 9:
3227 case 10:
3228 case 11:
3229 case 73:
3230 case 74:
3231 case 75:
3232 case 521:
3233 case 522:
3234 case 523:
3235 case 585:
3236 case 586:
3237 case 587:
3239 if (!IsRightToLeft())
3240 {
3243 Rightcharnext();
3244 }
3245 else
3246 {
3249 Leftcharnext();
3250 }
3251 if (Code() == 11)
3252 {
3255 break;
3256 }
3258 {
3259 CallToLower();
3260 }
3261 Ldc(Operand(0));
3262 if (Code() == 9)
3263 {
3265 }
3266 else
3267 {
3269 }
3270 break;
3271 case 12:
3272 case 524:
3273 {
3274 string text3 = _strings[Operand(0)];
3275 Ldc(text3.Length);
3278 Sub();
3280 for (int i = 0; i < text3.Length; i++)
3281 {
3284 if (i != 0)
3285 {
3286 Ldc(i);
3287 Add();
3288 }
3291 {
3292 CallToLower();
3293 }
3294 Ldc(text3[i]);
3296 }
3298 Ldc(text3.Length);
3299 Add();
3301 break;
3302 }
3303 case 76:
3304 case 588:
3305 {
3306 string text2 = _strings[Operand(0)];
3307 Ldc(text2.Length);
3310 Sub();
3312 int num4 = text2.Length;
3313 while (num4 > 0)
3314 {
3315 num4--;
3318 Ldc(text2.Length - num4);
3319 Sub();
3322 {
3323 CallToLower();
3324 }
3325 Ldc(text2[num4]);
3327 }
3329 Ldc(text2.Length);
3330 Sub();
3332 break;
3333 }
3334 case 13:
3335 case 77:
3336 case 525:
3337 case 589:
3338 {
3341 Label l13 = DefineLabel();
3342 Ldthis();
3343 Ldc(Operand(0));
3345 if ((_options & RegexOptions.ECMAScript) != 0)
3346 {
3348 }
3349 else
3350 {
3352 }
3353 Ldthis();
3354 Ldc(Operand(0));
3358 if (!IsRightToLeft())
3359 {
3362 }
3363 else
3364 {
3367 }
3368 Sub();
3370 Ldthis();
3371 Ldc(Operand(0));
3373 if (!IsRightToLeft())
3374 {
3376 Add(IsRightToLeft());
3377 }
3381 Add(IsRightToLeft());
3383 MarkLabel(l13);
3385 Ldc(0);
3386 Ble(AdvanceLabel());
3390 if (IsRightToLeft())
3391 {
3392 Ldc(1);
3393 Sub();
3396 }
3397 Sub(IsRightToLeft());
3399 if (IsCaseInsensitive())
3400 {
3401 CallToLower();
3402 }
3406 if (!IsRightToLeft())
3407 {
3409 Ldc(1);
3410 Sub();
3412 }
3413 Sub(IsRightToLeft());
3415 if (IsCaseInsensitive())
3416 {
3417 CallToLower();
3418 }
3419 Beq(l13);
3420 Back();
3421 break;
3422 }
3423 case 0:
3424 case 1:
3425 case 2:
3426 case 64:
3427 case 65:
3428 case 66:
3429 case 512:
3430 case 513:
3431 case 514:
3432 case 576:
3433 case 577:
3434 case 578:
3435 {
3436 int num3 = Operand(1);
3437 if (num3 == 0)
3438 {
3439 break;
3440 }
3441 Ldc(num3);
3442 if (!IsRightToLeft())
3443 {
3446 }
3447 else
3448 {
3451 }
3452 Sub();
3455 Ldc(num3);
3456 Add(IsRightToLeft());
3459 Label l11 = DefineLabel();
3460 Ldc(num3);
3462 MarkLabel(l11);
3466 if (IsRightToLeft())
3467 {
3468 Ldc(1);
3469 Sub();
3472 Add();
3473 }
3474 else
3475 {
3477 Ldc(1);
3478 Sub();
3480 Sub();
3481 }
3483 if (Code() == 2)
3484 {
3488 }
3489 else
3490 {
3492 {
3493 CallToLower();
3494 }
3495 Ldc(Operand(0));
3496 if (Code() == 0)
3497 {
3499 }
3500 else
3501 {
3503 }
3504 }
3506 Ldc(0);
3507 if (Code() == 2)
3508 {
3509 BgtFar(l11);
3510 }
3511 else
3512 {
3513 Bgt(l11);
3514 }
3515 break;
3516 }
3517 case 3:
3518 case 4:
3519 case 5:
3520 case 43:
3521 case 44:
3522 case 45:
3523 case 67:
3524 case 68:
3525 case 69:
3526 case 107:
3527 case 108:
3528 case 109:
3529 case 515:
3530 case 516:
3531 case 517:
3532 case 555:
3533 case 556:
3534 case 557:
3535 case 579:
3536 case 580:
3537 case 581:
3538 case 619:
3539 case 620:
3540 case 621:
3541 {
3542 int num2 = Operand(1);
3543 if (num2 == 0)
3544 {
3545 break;
3546 }
3549 if (!IsRightToLeft())
3550 {
3553 }
3554 else
3555 {
3558 }
3559 Sub();
3561 if (num2 != int.MaxValue)
3562 {
3563 Label l5 = DefineLabel();
3565 Ldc(num2);
3566 Blt(l5);
3567 Ldc(num2);
3569 MarkLabel(l5);
3570 }
3571 Label l6 = DefineLabel();
3572 string text = ((Code() == 5 || Code() == 45) ? _strings[Operand(0)] : null);
3573 Span<char> chars = stackalloc char[3];
3574 int setChars;
3575 if ((Code() == 4 || Code() == 44) && !IsRightToLeft() && (!IsCaseInsensitive() || !ParticipatesInCaseConversion(Operand(0))))
3576 {
3581 Ldc(Operand(0));
3584 Label l7 = DefineLabel();
3586 Ldc(-1);
3587 Bne(l7);
3590 Add();
3592 Ldc(0);
3594 BrFar(l6);
3595 MarkLabel(l7);
3598 Add();
3602 Sub();
3604 BrFar(l6);
3605 }
3606 else if ((Code() == 5 || Code() == 45) && !IsRightToLeft() && !IsCaseInsensitive() && (setChars = RegexCharClass.GetSetChars(text, chars)) > 1 && RegexCharClass.IsNegated(text))
3607 {
3612 Ldc(chars[0]);
3613 Ldc(chars[1]);
3614 if (setChars == 2)
3615 {
3617 }
3618 else
3619 {
3620 Ldc(chars[2]);
3622 }
3624 Label l8 = DefineLabel();
3626 Ldc(-1);
3627 Bne(l8);
3630 Add();
3632 Ldc(0);
3634 BrFar(l6);
3635 MarkLabel(l8);
3638 Add();
3642 Sub();
3644 BrFar(l6);
3645 }
3646 else if ((Code() == 5 || Code() == 45) && !IsRightToLeft() && text == "\0\u0001\0\0")
3647 {
3650 Add();
3652 Ldc(0);
3654 BrFar(l6);
3655 }
3656 else
3657 {
3659 Ldc(1);
3660 Add();
3662 Label l9 = DefineLabel();
3663 MarkLabel(l9);
3665 Ldc(1);
3666 Sub();
3669 Ldc(0);
3670 if (Code() == 5 || Code() == 45)
3671 {
3672 BleFar(l6);
3673 }
3674 else
3675 {
3676 Ble(l6);
3677 }
3678 if (IsRightToLeft())
3679 {
3680 Leftcharnext();
3681 }
3682 else
3683 {
3684 Rightcharnext();
3685 }
3686 if (Code() == 5 || Code() == 45)
3687 {
3690 BrtrueFar(l9);
3691 }
3692 else
3693 {
3695 {
3696 CallToLower();
3697 }
3698 Ldc(Operand(0));
3699 if (Code() == 3 || Code() == 43)
3700 {
3701 Beq(l9);
3702 }
3703 else
3704 {
3705 Bne(l9);
3706 }
3707 }
3709 Ldc(1);
3710 Sub(IsRightToLeft());
3712 }
3713 MarkLabel(l6);
3714 if (Code() != 43 && Code() != 44 && Code() != 45)
3715 {
3718 Ble(AdvanceLabel());
3722 Sub();
3723 Ldc(1);
3724 Sub();
3725 DoPush();
3728 Ldc(1);
3729 Sub(IsRightToLeft());
3730 DoPush();
3731 Track();
3732 }
3733 break;
3734 }
3735 case 131:
3736 case 132:
3737 case 133:
3738 case 195:
3739 case 196:
3740 case 197:
3741 case 643:
3742 case 644:
3743 case 645:
3744 case 707:
3745 case 708:
3746 case 709:
3747 {
3748 PopTrack();
3750 PopTrack();
3752 {
3755 Ldc(0);
3759 }
3760 Ldc(1);
3761 Sub();
3762 DoPush();
3765 Ldc(1);
3766 Sub(IsRightToLeft());
3767 DoPush();
3768 Trackagain();
3769 Advance();
3770 break;
3771 }
3772 case 6:
3773 case 7:
3774 case 8:
3775 case 70:
3776 case 71:
3777 case 72:
3778 case 518:
3779 case 519:
3780 case 520:
3781 case 582:
3782 case 583:
3783 case 584:
3784 {
3785 int num = Operand(1);
3786 if (num == 0)
3787 {
3788 break;
3789 }
3790 if (!IsRightToLeft())
3791 {
3794 }
3795 else
3796 {
3799 }
3800 Sub();
3802 {
3804 if (num != int.MaxValue)
3805 {
3806 Label l3 = DefineLabel();
3808 Ldc(num);
3809 Blt(l3);
3810 Ldc(num);
3812 MarkLabel(l3);
3813 }
3815 Ldc(0);
3816 Ble(AdvanceLabel());
3819 }
3820 Ldc(1);
3821 Sub();
3822 DoPush();
3824 Track();
3825 break;
3826 }
3827 case 134:
3828 case 135:
3829 case 136:
3830 case 198:
3831 case 199:
3832 case 200:
3833 case 646:
3834 case 647:
3835 case 648:
3836 case 710:
3837 case 711:
3838 case 712:
3839 {
3840 PopTrack();
3842 PopTrack();
3844 {
3846 if (!IsRightToLeft())
3847 {
3848 Rightcharnext();
3849 }
3850 else
3851 {
3852 Leftcharnext();
3853 }
3854 if (Code() == 8)
3855 {
3858 }
3859 else
3860 {
3862 {
3863 CallToLower();
3864 }
3865 Ldc(Operand(0));
3866 if (Code() == 6)
3867 {
3869 }
3870 else
3871 {
3873 }
3874 }
3876 Ldc(0);
3880 }
3881 Ldc(1);
3882 Sub();
3883 DoPush();
3885 Trackagain();
3886 Advance();
3887 break;
3888 }
3889 }
3890 }
3891
3892 private void EmitMatchCharacterClass(string charClass, bool caseInsensitive)
3893 {
3894 switch (charClass)
3895 {
3896 case "\0\u0001\0\0":
3897 Pop();
3898 Ldc(1);
3899 return;
3900 case "\0\0\u0001\t":
3902 return;
3903 case "\0\0\u0001\ufff7":
3905 Ldc(0);
3906 Ceq();
3907 return;
3908 case "\0\0\u0001d":
3910 return;
3911 case "\u0001\0\u0001d":
3913 Ldc(0);
3914 Ceq();
3915 return;
3916 }
3917 bool invariant = false;
3918 if (caseInsensitive)
3919 {
3921 if (!invariant)
3922 {
3923 CallToLower();
3924 }
3925 }
3927 {
3929 {
3931 Ceq();
3932 }
3933 else
3934 {
3936 Sub();
3938 CltUn();
3939 }
3941 {
3942 Ldc(0);
3943 Ceq();
3944 }
3945 return;
3946 }
3948 {
3950 Ldc((int)category);
3951 Ceq();
3952 if (negated)
3953 {
3954 Ldc(0);
3955 Ceq();
3956 }
3957 return;
3958 }
3961 try
3962 {
3964 if (!invariant)
3965 {
3966 Span<char> chars = stackalloc char[3];
3969 {
3971 Ldc(chars[0]);
3972 Ceq();
3974 Ldc(chars[1]);
3975 Ceq();
3976 Or();
3977 if (setChars == 3)
3978 {
3980 Ldc(chars[2]);
3981 Ceq();
3982 Or();
3983 }
3984 return;
3985 }
3986 }
3988 try
3989 {
3991 Label l = DefineLabel();
3992 Label l2 = DefineLabel();
3993 if (!invariant)
3994 {
3995 if (charClassAnalysisResults.ContainsNoAscii)
3996 {
3998 Ldc(128);
3999 Blt(l2);
4001 Br(l);
4002 MarkLabel(l2);
4003 Ldc(0);
4005 MarkLabel(l);
4007 return;
4008 }
4009 if (charClassAnalysisResults.AllAsciiContained)
4010 {
4012 Ldc(128);
4013 Blt(l2);
4015 Br(l);
4016 MarkLabel(l2);
4017 Ldc(1);
4019 MarkLabel(l);
4021 return;
4022 }
4023 }
4024 string str = string.Create(8, (charClass, invariant), delegate(Span<char> dest, (string charClass, bool invariant) state)
4025 {
4026 for (int i = 0; i < 128; i++)
4027 {
4028 char c = (char)i;
4029 if (state.invariant ? RegexCharClass.CharInClass(char.ToLowerInvariant(c), state.charClass) : RegexCharClass.CharInClass(c, state.charClass))
4030 {
4031 dest[i >> 4] |= (char)(ushort)(1 << (i & 0xF));
4032 }
4033 }
4034 });
4036 Ldc(128);
4037 Bge(l2);
4038 Ldstr(str);
4040 Ldc(4);
4041 Shr();
4043 Ldc(1);
4045 Ldc(15);
4046 And();
4047 Ldc(31);
4048 And();
4049 Shl();
4050 And();
4051 Ldc(0);
4052 CgtUn();
4054 Br(l);
4055 MarkLabel(l2);
4056 if (charClassAnalysisResults.ContainsOnlyAscii)
4057 {
4058 Ldc(0);
4060 }
4061 else if (charClassAnalysisResults.AllNonAsciiContained)
4062 {
4063 Ldc(1);
4065 }
4066 else
4067 {
4069 }
4070 MarkLabel(l);
4072 }
4073 finally
4074 {
4075 ((IDisposable)resultLocal).Dispose();
4076 }
4077 }
4078 finally
4079 {
4080 ((IDisposable)tempLocal).Dispose();
4081 }
4082 void EmitCharInClass()
4083 {
4085 if (invariant)
4086 {
4087 CallToLower();
4088 }
4092 }
4093 }
4094
4095 private void EmitTimeoutCheck()
4096 {
4097 if (_hasTimeout)
4098 {
4100 Ldc(1);
4101 Add();
4103 Label l = DefineLabel();
4105 Ldc(2048);
4106 RemUn();
4107 Brtrue(l);
4108 Ldthis();
4110 MarkLabel(l);
4111 }
4112 }
4113}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
bool TryPop([MaybeNullWhen(false)] out T result)
Definition Stack.cs:275
virtual LocalBuilder DeclareLocal(Type localType)
virtual void MarkLabel(Label loc)
virtual void Emit(OpCode opcode)
static readonly OpCode Ldloca
Definition OpCodes.cs:427
static readonly OpCode Brfalse
Definition OpCodes.cs:117
static readonly OpCode Bge_S
Definition OpCodes.cs:97
static readonly OpCode Blt_Un
Definition OpCodes.cs:139
static readonly OpCode Ldc_I8
Definition OpCodes.cs:71
static readonly OpCode Blt
Definition OpCodes.cs:129
static readonly OpCode Callvirt
Definition OpCodes.cs:225
static readonly OpCode Bge_Un
Definition OpCodes.cs:133
static readonly OpCode Mul
Definition OpCodes.cs:183
static readonly OpCode Brtrue
Definition OpCodes.cs:119
static readonly OpCode Br_S
Definition OpCodes.cs:89
static readonly OpCode Bge_Un_S
Definition OpCodes.cs:107
static readonly OpCode Or
Definition OpCodes.cs:195
static readonly OpCode Stloc
Definition OpCodes.cs:429
static readonly OpCode Bne_Un_S
Definition OpCodes.cs:105
static readonly OpCode Ldind_I4
Definition OpCodes.cs:151
static readonly OpCode Ldind_U2
Definition OpCodes.cs:149
static readonly OpCode Beq_S
Definition OpCodes.cs:95
static readonly OpCode Bgt
Definition OpCodes.cs:125
static readonly OpCode Rem_Un
Definition OpCodes.cs:191
static readonly OpCode Add
Definition OpCodes.cs:179
static readonly OpCode Ble
Definition OpCodes.cs:127
static readonly OpCode Blt_S
Definition OpCodes.cs:103
static readonly OpCode Ldind_I8
Definition OpCodes.cs:155
static readonly OpCode Ldc_I4
Definition OpCodes.cs:69
static readonly OpCode Beq
Definition OpCodes.cs:121
static readonly OpCode Unaligned
Definition OpCodes.cs:435
static readonly OpCode And
Definition OpCodes.cs:193
static readonly OpCode Br
Definition OpCodes.cs:115
static readonly OpCode Shl
Definition OpCodes.cs:199
static readonly OpCode Stelem_I4
Definition OpCodes.cs:315
static readonly OpCode Bne_Un
Definition OpCodes.cs:131
static readonly OpCode Ceq
Definition OpCodes.cs:405
static readonly OpCode Ldfld
Definition OpCodes.cs:245
static readonly OpCode Shr
Definition OpCodes.cs:201
static readonly OpCode Bge
Definition OpCodes.cs:123
static readonly OpCode Sub
Definition OpCodes.cs:181
static readonly OpCode Brtrue_S
Definition OpCodes.cs:93
static readonly OpCode Ldstr
Definition OpCodes.cs:231
static readonly OpCode Pop
Definition OpCodes.cs:79
static readonly OpCode Ldelem_I4
Definition OpCodes.cs:295
static readonly OpCode Switch
Definition OpCodes.cs:141
static readonly OpCode Call
Definition OpCodes.cs:83
static readonly OpCode Ret
Definition OpCodes.cs:87
static readonly OpCode Ldloc
Definition OpCodes.cs:425
static readonly OpCode Brfalse_S
Definition OpCodes.cs:91
static readonly OpCode Ldarg_0
Definition OpCodes.cs:9
static readonly OpCode Clt_Un
Definition OpCodes.cs:413
static readonly OpCode Neg
Definition OpCodes.cs:205
static readonly OpCode Bgt_Un_S
Definition OpCodes.cs:109
static readonly OpCode Dup
Definition OpCodes.cs:77
static readonly OpCode Ble_S
Definition OpCodes.cs:101
static readonly OpCode Stfld
Definition OpCodes.cs:249
static readonly OpCode Bgt_S
Definition OpCodes.cs:99
static readonly OpCode Ldlen
Definition OpCodes.cs:283
static readonly OpCode Cgt_Un
Definition OpCodes.cs:409
static int GetSetChars(string set, Span< char > chars)
static bool TryGetSingleRange(string set, out char lowInclusive, out char highInclusive)
static bool CharInClass(char ch, string set, ref int[] asciiResultCache)
static bool TryGetSingleUnicodeCategory(string set, out UnicodeCategory category, out bool negated)
static CharClassAnalysisResults Analyze(string set)
static int OpcodeSize(int opcode)
Definition RegexCode.cs:77
BacktrackNote(int flags, Label label, int codepos)
static readonly MethodInfo s_memoryMarshalGetReference
static readonly FieldInfo s_runtrackcountField
static readonly MethodInfo s_stringAsSpanMethod
static readonly FieldInfo s_runtextstartField
static readonly MethodInfo s_isMatchedMethod
void EmitMatchCharacterClass(string charClass, bool caseInsensitive)
static readonly MethodInfo s_checkTimeoutMethod
static readonly MethodInfo s_isECMABoundaryMethod
static readonly MethodInfo s_cultureInfoGetTextInfoMethod
static readonly MethodInfo s_stringAsSpanIntIntMethod
static readonly MethodInfo s_spanIndexOfAnyCharChar
static readonly MethodInfo s_transferCaptureMethod
static readonly FieldInfo s_runtextendField
static readonly MethodInfo s_cultureInfoGetCurrentCultureMethod
static readonly MethodInfo s_matchIndexMethod
static readonly MethodInfo s_spanSliceIntMethod
static RegexRunnerFactory Compile(string pattern, RegexCode code, RegexOptions options, bool hasTimeout)
static readonly MethodInfo s_charIsWhiteSpaceMethod
string bool CaseInsensitive[] _leadingCharClasses
int AddBacktrackNote(int flags, Label l, int codepos)
static readonly FieldInfo s_runtrackposField
static readonly MethodInfo s_stringGetCharsMethod
static readonly MethodInfo s_charToLowerInvariantMethod
static MethodInfo RegexRunnerMethod(string methname)
void Mvlocfld(LocalBuilder lt, FieldInfo ft)
static readonly MethodInfo s_matchLengthMethod
static readonly MethodInfo s_doubleTrackMethod
static readonly MethodInfo s_spanGetItemMethod
static readonly MethodInfo s_textInfoToLowerMethod
static readonly MethodInfo s_doubleStackMethod
static readonly MethodInfo s_uncaptureMethod
static readonly MethodInfo s_crawlposMethod
static readonly MethodInfo s_spanSliceIntIntMethod
static bool ParticipatesInCaseConversion(int comparison)
static readonly MethodInfo s_spanStartsWith
static readonly MethodInfo s_spanIndexOfAnyCharCharChar
static readonly FieldInfo s_runstackposField
static readonly MethodInfo s_captureMethod
static readonly MethodInfo s_charIsDigitMethod
static readonly FieldInfo s_runtextbegField
static readonly MethodInfo s_isBoundaryMethod
static readonly MethodInfo s_stringIndexOfCharInt
static readonly MethodInfo s_spanGetLengthMethod
static readonly FieldInfo s_runtextposField
void Mvfldloc(FieldInfo ft, LocalBuilder lt)
static FieldInfo RegexRunnerField(string fieldname)
static readonly MethodInfo s_charGetUnicodeInfo
static readonly MethodInfo s_charInClassMethod
RegexRunnerFactory FactoryInstanceFromCode(string pattern, RegexCode code, RegexOptions options, bool hasTimeout)
static Type MakeGenericMethodParameter(int position)
Definition Type.cs:1089
static int Size
Definition IntPtr.cs:21
RentedLocalBuilder(Stack< LocalBuilder > pool, LocalBuilder local)