scripts
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002AA RID: 682
|
||||
internal abstract class BaseMachine : IMachine
|
||||
{
|
||||
// Token: 0x060018E7 RID: 6375 RVA: 0x00055598 File Offset: 0x00053798
|
||||
public virtual string Replace(Regex regex, string input, string replacement, int count, int startat)
|
||||
{
|
||||
ReplacementEvaluator replacementEvaluator = new ReplacementEvaluator(regex, replacement);
|
||||
if (regex.RightToLeft)
|
||||
{
|
||||
return this.RTLReplace(regex, input, new MatchEvaluator(replacementEvaluator.Evaluate), count, startat);
|
||||
}
|
||||
return this.LTRReplace(regex, input, new BaseMachine.MatchAppendEvaluator(replacementEvaluator.EvaluateAppend), count, startat, replacementEvaluator.NeedsGroupsOrCaptures);
|
||||
}
|
||||
|
||||
// Token: 0x060018E8 RID: 6376 RVA: 0x000555F0 File Offset: 0x000537F0
|
||||
public virtual string[] Split(Regex regex, string input, int count, int startat)
|
||||
{
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (count == 0)
|
||||
{
|
||||
count = int.MaxValue;
|
||||
}
|
||||
int num = startat;
|
||||
Match match = null;
|
||||
while (--count > 0)
|
||||
{
|
||||
if (match != null)
|
||||
{
|
||||
match = match.NextMatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
match = regex.Match(input, num);
|
||||
}
|
||||
if (!match.Success)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (regex.RightToLeft)
|
||||
{
|
||||
arrayList.Add(input.Substring(match.Index + match.Length, num - match.Index - match.Length));
|
||||
}
|
||||
else
|
||||
{
|
||||
arrayList.Add(input.Substring(num, match.Index - num));
|
||||
}
|
||||
int count2 = match.Groups.Count;
|
||||
for (int i = 1; i < count2; i++)
|
||||
{
|
||||
Group group = match.Groups[i];
|
||||
arrayList.Add(input.Substring(group.Index, group.Length));
|
||||
}
|
||||
if (regex.RightToLeft)
|
||||
{
|
||||
num = match.Index;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = match.Index + match.Length;
|
||||
}
|
||||
}
|
||||
if (regex.RightToLeft && num >= 0)
|
||||
{
|
||||
arrayList.Add(input.Substring(0, num));
|
||||
}
|
||||
if (!regex.RightToLeft && num <= input.Length)
|
||||
{
|
||||
arrayList.Add(input.Substring(num));
|
||||
}
|
||||
return (string[])arrayList.ToArray(typeof(string));
|
||||
}
|
||||
|
||||
// Token: 0x060018E9 RID: 6377 RVA: 0x0005576C File Offset: 0x0005396C
|
||||
public virtual Match Scan(Regex regex, string text, int start, int end)
|
||||
{
|
||||
throw new NotImplementedException("Scan method must be implemented in derived classes");
|
||||
}
|
||||
|
||||
// Token: 0x060018EA RID: 6378 RVA: 0x00055778 File Offset: 0x00053978
|
||||
public virtual string Result(string replacement, Match match)
|
||||
{
|
||||
return ReplacementEvaluator.Evaluate(replacement, match);
|
||||
}
|
||||
|
||||
// Token: 0x060018EB RID: 6379 RVA: 0x00055784 File Offset: 0x00053984
|
||||
internal string LTRReplace(Regex regex, string input, BaseMachine.MatchAppendEvaluator evaluator, int count, int startat)
|
||||
{
|
||||
return this.LTRReplace(regex, input, evaluator, count, startat, true);
|
||||
}
|
||||
|
||||
// Token: 0x060018EC RID: 6380 RVA: 0x00055794 File Offset: 0x00053994
|
||||
internal string LTRReplace(Regex regex, string input, BaseMachine.MatchAppendEvaluator evaluator, int count, int startat, bool needs_groups_or_captures)
|
||||
{
|
||||
this.needs_groups_or_captures = needs_groups_or_captures;
|
||||
Match match = this.Scan(regex, input, startat, input.Length);
|
||||
if (!match.Success)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder(input.Length);
|
||||
int num = startat;
|
||||
int num2 = count;
|
||||
stringBuilder.Append(input, 0, num);
|
||||
while (count == -1 || num2-- > 0)
|
||||
{
|
||||
if (match.Index < num)
|
||||
{
|
||||
throw new SystemException("how");
|
||||
}
|
||||
stringBuilder.Append(input, num, match.Index - num);
|
||||
evaluator(match, stringBuilder);
|
||||
num = match.Index + match.Length;
|
||||
match = match.NextMatch();
|
||||
if (!match.Success)
|
||||
{
|
||||
IL_AA:
|
||||
stringBuilder.Append(input, num, input.Length - num);
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
goto IL_AA;
|
||||
}
|
||||
|
||||
// Token: 0x060018ED RID: 6381 RVA: 0x00055864 File Offset: 0x00053A64
|
||||
internal string RTLReplace(Regex regex, string input, MatchEvaluator evaluator, int count, int startat)
|
||||
{
|
||||
Match match = this.Scan(regex, input, startat, input.Length);
|
||||
if (!match.Success)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
int num = startat;
|
||||
int num2 = count;
|
||||
List<string> list = new List<string>();
|
||||
list.Add(input.Substring(num));
|
||||
while (count == -1 || num2-- > 0)
|
||||
{
|
||||
if (match.Index + match.Length > num)
|
||||
{
|
||||
throw new SystemException("how");
|
||||
}
|
||||
list.Add(input.Substring(match.Index + match.Length, num - match.Index - match.Length));
|
||||
list.Add(evaluator(match));
|
||||
num = match.Index;
|
||||
match = match.NextMatch();
|
||||
if (!match.Success)
|
||||
{
|
||||
IL_BB:
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.Append(input, 0, num);
|
||||
int i = list.Count;
|
||||
while (i > 0)
|
||||
{
|
||||
stringBuilder.Append(list[--i]);
|
||||
}
|
||||
list.Clear();
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
goto IL_BB;
|
||||
}
|
||||
|
||||
// Token: 0x040013C1 RID: 5057
|
||||
protected bool needs_groups_or_captures = true;
|
||||
|
||||
// Token: 0x02000319 RID: 793
|
||||
// (Invoke) Token: 0x06001C3D RID: 7229
|
||||
internal delegate void MatchAppendEvaluator(Match match, StringBuilder sb);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents the results from a single subexpression capture. </summary>
|
||||
// Token: 0x020002AB RID: 683
|
||||
[Serializable]
|
||||
public class Capture
|
||||
{
|
||||
// Token: 0x060018EE RID: 6382 RVA: 0x00055978 File Offset: 0x00053B78
|
||||
internal Capture(string text)
|
||||
: this(text, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060018EF RID: 6383 RVA: 0x00055984 File Offset: 0x00053B84
|
||||
internal Capture(string text, int index, int length)
|
||||
{
|
||||
this.text = text;
|
||||
this.index = index;
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
/// <summary>The position in the original string where the first character of the captured substring was found.</summary>
|
||||
/// <returns>The zero-based starting position in the original string where the captured substring was found.</returns>
|
||||
// Token: 0x170007CD RID: 1997
|
||||
// (get) Token: 0x060018F0 RID: 6384 RVA: 0x000559A4 File Offset: 0x00053BA4
|
||||
public int Index
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.index;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The length of the captured substring.</summary>
|
||||
/// <returns>The length of the captured substring.</returns>
|
||||
// Token: 0x170007CE RID: 1998
|
||||
// (get) Token: 0x060018F1 RID: 6385 RVA: 0x000559AC File Offset: 0x00053BAC
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.length;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the captured substring from the input string.</summary>
|
||||
/// <returns>The actual substring that was captured by the match.</returns>
|
||||
// Token: 0x170007CF RID: 1999
|
||||
// (get) Token: 0x060018F2 RID: 6386 RVA: 0x000559B4 File Offset: 0x00053BB4
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.text != null) ? this.text.Substring(this.index, this.length) : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets the captured substring from the input string.</summary>
|
||||
/// <returns>The actual substring that was captured by the match.</returns>
|
||||
// Token: 0x060018F3 RID: 6387 RVA: 0x000559F0 File Offset: 0x00053BF0
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Value;
|
||||
}
|
||||
|
||||
// Token: 0x170007D0 RID: 2000
|
||||
// (get) Token: 0x060018F4 RID: 6388 RVA: 0x000559F8 File Offset: 0x00053BF8
|
||||
internal string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.text;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040013C2 RID: 5058
|
||||
internal int index;
|
||||
|
||||
// Token: 0x040013C3 RID: 5059
|
||||
internal int length;
|
||||
|
||||
// Token: 0x040013C4 RID: 5060
|
||||
internal string text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents the set of captures made by a single capturing group.</summary>
|
||||
// Token: 0x020002AC RID: 684
|
||||
[Serializable]
|
||||
public class CaptureCollection : ICollection, IEnumerable
|
||||
{
|
||||
// Token: 0x060018F5 RID: 6389 RVA: 0x00055A00 File Offset: 0x00053C00
|
||||
internal CaptureCollection(int n)
|
||||
{
|
||||
this.list = new Capture[n];
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of substrings captured by the group.</summary>
|
||||
/// <returns>The number of items in the <see cref="T:System.Text.RegularExpressions.CaptureCollection" />.</returns>
|
||||
// Token: 0x170007D1 RID: 2001
|
||||
// (get) Token: 0x060018F6 RID: 6390 RVA: 0x00055A14 File Offset: 0x00053C14
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list.Length;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the collection is read only.</summary>
|
||||
/// <returns>true in all cases.</returns>
|
||||
// Token: 0x170007D2 RID: 2002
|
||||
// (get) Token: 0x060018F7 RID: 6391 RVA: 0x00055A20 File Offset: 0x00053C20
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether access to the collection is synchronized (thread-safe).</summary>
|
||||
/// <returns>false in all cases.</returns>
|
||||
// Token: 0x170007D3 RID: 2003
|
||||
// (get) Token: 0x060018F8 RID: 6392 RVA: 0x00055A24 File Offset: 0x00053C24
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an individual member of the collection.</summary>
|
||||
/// <returns>The captured substring at position <paramref name="i" /> in the collection.</returns>
|
||||
/// <param name="i">Index into the capture collection. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="i" /> is less than 0 or greater than <see cref="P:System.Text.RegularExpressions.CaptureCollection.Count" />. </exception>
|
||||
// Token: 0x170007D4 RID: 2004
|
||||
public Capture this[int i]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (i < 0 || i >= this.Count)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("Index is out of range");
|
||||
}
|
||||
return this.list[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060018FA RID: 6394 RVA: 0x00055A5C File Offset: 0x00053C5C
|
||||
internal void SetValue(Capture cap, int i)
|
||||
{
|
||||
this.list[i] = cap;
|
||||
}
|
||||
|
||||
/// <summary>Gets an object that can be used to synchronize access to the collection.</summary>
|
||||
/// <returns>An object that can be used to synchronize access to the collection.</returns>
|
||||
// Token: 0x170007D5 RID: 2005
|
||||
// (get) Token: 0x060018FB RID: 6395 RVA: 0x00055A68 File Offset: 0x00053C68
|
||||
public object SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Copies all the elements of the collection to the given array beginning at the given index.</summary>
|
||||
/// <param name="array">The array the collection is to be copied into. </param>
|
||||
/// <param name="arrayIndex">The position in the destination array where copying is to begin. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="array " />is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="arrayIndex" /> is outside the bounds of <paramref name="array" />. -or-<paramref name="arrayIndex" /> plus <see cref="P:System.Text.RegularExpressions.CaptureCollection.Count" /> is outside the bounds of <paramref name="array" />. </exception>
|
||||
// Token: 0x060018FC RID: 6396 RVA: 0x00055A70 File Offset: 0x00053C70
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
this.list.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>Provides an enumerator that iterates through the collection.</summary>
|
||||
/// <returns>An object that contains all <see cref="T:System.Text.RegularExpressions.Capture" /> objects within the <see cref="T:System.Text.RegularExpressions.CaptureCollection" />.</returns>
|
||||
// Token: 0x060018FD RID: 6397 RVA: 0x00055A80 File Offset: 0x00053C80
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return this.list.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x040013C5 RID: 5061
|
||||
private Capture[] list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C3 RID: 707
|
||||
internal enum Category : ushort
|
||||
{
|
||||
// Token: 0x040014DF RID: 5343
|
||||
None,
|
||||
// Token: 0x040014E0 RID: 5344
|
||||
Any,
|
||||
// Token: 0x040014E1 RID: 5345
|
||||
AnySingleline,
|
||||
// Token: 0x040014E2 RID: 5346
|
||||
Word,
|
||||
// Token: 0x040014E3 RID: 5347
|
||||
Digit,
|
||||
// Token: 0x040014E4 RID: 5348
|
||||
WhiteSpace,
|
||||
// Token: 0x040014E5 RID: 5349
|
||||
EcmaAny,
|
||||
// Token: 0x040014E6 RID: 5350
|
||||
EcmaAnySingleline,
|
||||
// Token: 0x040014E7 RID: 5351
|
||||
EcmaWord,
|
||||
// Token: 0x040014E8 RID: 5352
|
||||
EcmaDigit,
|
||||
// Token: 0x040014E9 RID: 5353
|
||||
EcmaWhiteSpace,
|
||||
// Token: 0x040014EA RID: 5354
|
||||
UnicodeL,
|
||||
// Token: 0x040014EB RID: 5355
|
||||
UnicodeM,
|
||||
// Token: 0x040014EC RID: 5356
|
||||
UnicodeN,
|
||||
// Token: 0x040014ED RID: 5357
|
||||
UnicodeZ,
|
||||
// Token: 0x040014EE RID: 5358
|
||||
UnicodeP,
|
||||
// Token: 0x040014EF RID: 5359
|
||||
UnicodeS,
|
||||
// Token: 0x040014F0 RID: 5360
|
||||
UnicodeC,
|
||||
// Token: 0x040014F1 RID: 5361
|
||||
UnicodeLu,
|
||||
// Token: 0x040014F2 RID: 5362
|
||||
UnicodeLl,
|
||||
// Token: 0x040014F3 RID: 5363
|
||||
UnicodeLt,
|
||||
// Token: 0x040014F4 RID: 5364
|
||||
UnicodeLm,
|
||||
// Token: 0x040014F5 RID: 5365
|
||||
UnicodeLo,
|
||||
// Token: 0x040014F6 RID: 5366
|
||||
UnicodeMn,
|
||||
// Token: 0x040014F7 RID: 5367
|
||||
UnicodeMe,
|
||||
// Token: 0x040014F8 RID: 5368
|
||||
UnicodeMc,
|
||||
// Token: 0x040014F9 RID: 5369
|
||||
UnicodeNd,
|
||||
// Token: 0x040014FA RID: 5370
|
||||
UnicodeNl,
|
||||
// Token: 0x040014FB RID: 5371
|
||||
UnicodeNo,
|
||||
// Token: 0x040014FC RID: 5372
|
||||
UnicodeZs,
|
||||
// Token: 0x040014FD RID: 5373
|
||||
UnicodeZl,
|
||||
// Token: 0x040014FE RID: 5374
|
||||
UnicodeZp,
|
||||
// Token: 0x040014FF RID: 5375
|
||||
UnicodePd,
|
||||
// Token: 0x04001500 RID: 5376
|
||||
UnicodePs,
|
||||
// Token: 0x04001501 RID: 5377
|
||||
UnicodePi,
|
||||
// Token: 0x04001502 RID: 5378
|
||||
UnicodePe,
|
||||
// Token: 0x04001503 RID: 5379
|
||||
UnicodePf,
|
||||
// Token: 0x04001504 RID: 5380
|
||||
UnicodePc,
|
||||
// Token: 0x04001505 RID: 5381
|
||||
UnicodePo,
|
||||
// Token: 0x04001506 RID: 5382
|
||||
UnicodeSm,
|
||||
// Token: 0x04001507 RID: 5383
|
||||
UnicodeSc,
|
||||
// Token: 0x04001508 RID: 5384
|
||||
UnicodeSk,
|
||||
// Token: 0x04001509 RID: 5385
|
||||
UnicodeSo,
|
||||
// Token: 0x0400150A RID: 5386
|
||||
UnicodeCc,
|
||||
// Token: 0x0400150B RID: 5387
|
||||
UnicodeCf,
|
||||
// Token: 0x0400150C RID: 5388
|
||||
UnicodeCo,
|
||||
// Token: 0x0400150D RID: 5389
|
||||
UnicodeCs,
|
||||
// Token: 0x0400150E RID: 5390
|
||||
UnicodeCn,
|
||||
// Token: 0x0400150F RID: 5391
|
||||
UnicodeBasicLatin,
|
||||
// Token: 0x04001510 RID: 5392
|
||||
UnicodeLatin1Supplement,
|
||||
// Token: 0x04001511 RID: 5393
|
||||
UnicodeLatinExtendedA,
|
||||
// Token: 0x04001512 RID: 5394
|
||||
UnicodeLatinExtendedB,
|
||||
// Token: 0x04001513 RID: 5395
|
||||
UnicodeIPAExtensions,
|
||||
// Token: 0x04001514 RID: 5396
|
||||
UnicodeSpacingModifierLetters,
|
||||
// Token: 0x04001515 RID: 5397
|
||||
UnicodeCombiningDiacriticalMarks,
|
||||
// Token: 0x04001516 RID: 5398
|
||||
UnicodeGreek,
|
||||
// Token: 0x04001517 RID: 5399
|
||||
UnicodeCyrillic,
|
||||
// Token: 0x04001518 RID: 5400
|
||||
UnicodeArmenian,
|
||||
// Token: 0x04001519 RID: 5401
|
||||
UnicodeHebrew,
|
||||
// Token: 0x0400151A RID: 5402
|
||||
UnicodeArabic,
|
||||
// Token: 0x0400151B RID: 5403
|
||||
UnicodeSyriac,
|
||||
// Token: 0x0400151C RID: 5404
|
||||
UnicodeThaana,
|
||||
// Token: 0x0400151D RID: 5405
|
||||
UnicodeDevanagari,
|
||||
// Token: 0x0400151E RID: 5406
|
||||
UnicodeBengali,
|
||||
// Token: 0x0400151F RID: 5407
|
||||
UnicodeGurmukhi,
|
||||
// Token: 0x04001520 RID: 5408
|
||||
UnicodeGujarati,
|
||||
// Token: 0x04001521 RID: 5409
|
||||
UnicodeOriya,
|
||||
// Token: 0x04001522 RID: 5410
|
||||
UnicodeTamil,
|
||||
// Token: 0x04001523 RID: 5411
|
||||
UnicodeTelugu,
|
||||
// Token: 0x04001524 RID: 5412
|
||||
UnicodeKannada,
|
||||
// Token: 0x04001525 RID: 5413
|
||||
UnicodeMalayalam,
|
||||
// Token: 0x04001526 RID: 5414
|
||||
UnicodeSinhala,
|
||||
// Token: 0x04001527 RID: 5415
|
||||
UnicodeThai,
|
||||
// Token: 0x04001528 RID: 5416
|
||||
UnicodeLao,
|
||||
// Token: 0x04001529 RID: 5417
|
||||
UnicodeTibetan,
|
||||
// Token: 0x0400152A RID: 5418
|
||||
UnicodeMyanmar,
|
||||
// Token: 0x0400152B RID: 5419
|
||||
UnicodeGeorgian,
|
||||
// Token: 0x0400152C RID: 5420
|
||||
UnicodeHangulJamo,
|
||||
// Token: 0x0400152D RID: 5421
|
||||
UnicodeEthiopic,
|
||||
// Token: 0x0400152E RID: 5422
|
||||
UnicodeCherokee,
|
||||
// Token: 0x0400152F RID: 5423
|
||||
UnicodeUnifiedCanadianAboriginalSyllabics,
|
||||
// Token: 0x04001530 RID: 5424
|
||||
UnicodeOgham,
|
||||
// Token: 0x04001531 RID: 5425
|
||||
UnicodeRunic,
|
||||
// Token: 0x04001532 RID: 5426
|
||||
UnicodeKhmer,
|
||||
// Token: 0x04001533 RID: 5427
|
||||
UnicodeMongolian,
|
||||
// Token: 0x04001534 RID: 5428
|
||||
UnicodeLatinExtendedAdditional,
|
||||
// Token: 0x04001535 RID: 5429
|
||||
UnicodeGreekExtended,
|
||||
// Token: 0x04001536 RID: 5430
|
||||
UnicodeGeneralPunctuation,
|
||||
// Token: 0x04001537 RID: 5431
|
||||
UnicodeSuperscriptsandSubscripts,
|
||||
// Token: 0x04001538 RID: 5432
|
||||
UnicodeCurrencySymbols,
|
||||
// Token: 0x04001539 RID: 5433
|
||||
UnicodeCombiningMarksforSymbols,
|
||||
// Token: 0x0400153A RID: 5434
|
||||
UnicodeLetterlikeSymbols,
|
||||
// Token: 0x0400153B RID: 5435
|
||||
UnicodeNumberForms,
|
||||
// Token: 0x0400153C RID: 5436
|
||||
UnicodeArrows,
|
||||
// Token: 0x0400153D RID: 5437
|
||||
UnicodeMathematicalOperators,
|
||||
// Token: 0x0400153E RID: 5438
|
||||
UnicodeMiscellaneousTechnical,
|
||||
// Token: 0x0400153F RID: 5439
|
||||
UnicodeControlPictures,
|
||||
// Token: 0x04001540 RID: 5440
|
||||
UnicodeOpticalCharacterRecognition,
|
||||
// Token: 0x04001541 RID: 5441
|
||||
UnicodeEnclosedAlphanumerics,
|
||||
// Token: 0x04001542 RID: 5442
|
||||
UnicodeBoxDrawing,
|
||||
// Token: 0x04001543 RID: 5443
|
||||
UnicodeBlockElements,
|
||||
// Token: 0x04001544 RID: 5444
|
||||
UnicodeGeometricShapes,
|
||||
// Token: 0x04001545 RID: 5445
|
||||
UnicodeMiscellaneousSymbols,
|
||||
// Token: 0x04001546 RID: 5446
|
||||
UnicodeDingbats,
|
||||
// Token: 0x04001547 RID: 5447
|
||||
UnicodeBraillePatterns,
|
||||
// Token: 0x04001548 RID: 5448
|
||||
UnicodeCJKRadicalsSupplement,
|
||||
// Token: 0x04001549 RID: 5449
|
||||
UnicodeKangxiRadicals,
|
||||
// Token: 0x0400154A RID: 5450
|
||||
UnicodeIdeographicDescriptionCharacters,
|
||||
// Token: 0x0400154B RID: 5451
|
||||
UnicodeCJKSymbolsandPunctuation,
|
||||
// Token: 0x0400154C RID: 5452
|
||||
UnicodeHiragana,
|
||||
// Token: 0x0400154D RID: 5453
|
||||
UnicodeKatakana,
|
||||
// Token: 0x0400154E RID: 5454
|
||||
UnicodeBopomofo,
|
||||
// Token: 0x0400154F RID: 5455
|
||||
UnicodeHangulCompatibilityJamo,
|
||||
// Token: 0x04001550 RID: 5456
|
||||
UnicodeKanbun,
|
||||
// Token: 0x04001551 RID: 5457
|
||||
UnicodeBopomofoExtended,
|
||||
// Token: 0x04001552 RID: 5458
|
||||
UnicodeEnclosedCJKLettersandMonths,
|
||||
// Token: 0x04001553 RID: 5459
|
||||
UnicodeCJKCompatibility,
|
||||
// Token: 0x04001554 RID: 5460
|
||||
UnicodeCJKUnifiedIdeographsExtensionA,
|
||||
// Token: 0x04001555 RID: 5461
|
||||
UnicodeCJKUnifiedIdeographs,
|
||||
// Token: 0x04001556 RID: 5462
|
||||
UnicodeYiSyllables,
|
||||
// Token: 0x04001557 RID: 5463
|
||||
UnicodeYiRadicals,
|
||||
// Token: 0x04001558 RID: 5464
|
||||
UnicodeHangulSyllables,
|
||||
// Token: 0x04001559 RID: 5465
|
||||
UnicodeHighSurrogates,
|
||||
// Token: 0x0400155A RID: 5466
|
||||
UnicodeHighPrivateUseSurrogates,
|
||||
// Token: 0x0400155B RID: 5467
|
||||
UnicodeLowSurrogates,
|
||||
// Token: 0x0400155C RID: 5468
|
||||
UnicodePrivateUse,
|
||||
// Token: 0x0400155D RID: 5469
|
||||
UnicodeCJKCompatibilityIdeographs,
|
||||
// Token: 0x0400155E RID: 5470
|
||||
UnicodeAlphabeticPresentationForms,
|
||||
// Token: 0x0400155F RID: 5471
|
||||
UnicodeArabicPresentationFormsA,
|
||||
// Token: 0x04001560 RID: 5472
|
||||
UnicodeCombiningHalfMarks,
|
||||
// Token: 0x04001561 RID: 5473
|
||||
UnicodeCJKCompatibilityForms,
|
||||
// Token: 0x04001562 RID: 5474
|
||||
UnicodeSmallFormVariants,
|
||||
// Token: 0x04001563 RID: 5475
|
||||
UnicodeArabicPresentationFormsB,
|
||||
// Token: 0x04001564 RID: 5476
|
||||
UnicodeSpecials,
|
||||
// Token: 0x04001565 RID: 5477
|
||||
UnicodeHalfwidthandFullwidthForms,
|
||||
// Token: 0x04001566 RID: 5478
|
||||
UnicodeOldItalic,
|
||||
// Token: 0x04001567 RID: 5479
|
||||
UnicodeGothic,
|
||||
// Token: 0x04001568 RID: 5480
|
||||
UnicodeDeseret,
|
||||
// Token: 0x04001569 RID: 5481
|
||||
UnicodeByzantineMusicalSymbols,
|
||||
// Token: 0x0400156A RID: 5482
|
||||
UnicodeMusicalSymbols,
|
||||
// Token: 0x0400156B RID: 5483
|
||||
UnicodeMathematicalAlphanumericSymbols,
|
||||
// Token: 0x0400156C RID: 5484
|
||||
UnicodeCJKUnifiedIdeographsExtensionB,
|
||||
// Token: 0x0400156D RID: 5485
|
||||
UnicodeCJKCompatibilityIdeographsSupplement,
|
||||
// Token: 0x0400156E RID: 5486
|
||||
UnicodeTags,
|
||||
// Token: 0x0400156F RID: 5487
|
||||
LastValue
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C4 RID: 708
|
||||
internal class CategoryUtils
|
||||
{
|
||||
// Token: 0x060019AD RID: 6573 RVA: 0x0005B5B8 File Offset: 0x000597B8
|
||||
public static Category CategoryFromName(string name)
|
||||
{
|
||||
Category category;
|
||||
try
|
||||
{
|
||||
if (name.StartsWith("Is"))
|
||||
{
|
||||
name = name.Substring(2);
|
||||
}
|
||||
category = (Category)((ushort)Enum.Parse(typeof(Category), "Unicode" + name, false));
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
category = Category.None;
|
||||
}
|
||||
return category;
|
||||
}
|
||||
|
||||
// Token: 0x060019AE RID: 6574 RVA: 0x0005B634 File Offset: 0x00059834
|
||||
public static bool IsCategory(Category cat, char c)
|
||||
{
|
||||
switch (cat)
|
||||
{
|
||||
case Category.None:
|
||||
return false;
|
||||
case Category.Any:
|
||||
return c != '\n';
|
||||
case Category.AnySingleline:
|
||||
return true;
|
||||
case Category.Word:
|
||||
return char.IsLetterOrDigit(c) || CategoryUtils.IsCategory(UnicodeCategory.ConnectorPunctuation, c);
|
||||
case Category.Digit:
|
||||
return char.IsDigit(c);
|
||||
case Category.WhiteSpace:
|
||||
return char.IsWhiteSpace(c);
|
||||
case Category.EcmaAny:
|
||||
return c != '\n';
|
||||
case Category.EcmaAnySingleline:
|
||||
return true;
|
||||
case Category.EcmaWord:
|
||||
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || '_' == c;
|
||||
case Category.EcmaDigit:
|
||||
return '0' <= c && c <= '9';
|
||||
case Category.EcmaWhiteSpace:
|
||||
return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
|
||||
case Category.UnicodeL:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.UppercaseLetter, c) || CategoryUtils.IsCategory(UnicodeCategory.LowercaseLetter, c) || CategoryUtils.IsCategory(UnicodeCategory.TitlecaseLetter, c) || CategoryUtils.IsCategory(UnicodeCategory.ModifierLetter, c) || CategoryUtils.IsCategory(UnicodeCategory.OtherLetter, c);
|
||||
case Category.UnicodeM:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.NonSpacingMark, c) || CategoryUtils.IsCategory(UnicodeCategory.EnclosingMark, c) || CategoryUtils.IsCategory(UnicodeCategory.SpacingCombiningMark, c);
|
||||
case Category.UnicodeN:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.DecimalDigitNumber, c) || CategoryUtils.IsCategory(UnicodeCategory.LetterNumber, c) || CategoryUtils.IsCategory(UnicodeCategory.OtherNumber, c);
|
||||
case Category.UnicodeZ:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.SpaceSeparator, c) || CategoryUtils.IsCategory(UnicodeCategory.LineSeparator, c) || CategoryUtils.IsCategory(UnicodeCategory.ParagraphSeparator, c);
|
||||
case Category.UnicodeP:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.DashPunctuation, c) || CategoryUtils.IsCategory(UnicodeCategory.OpenPunctuation, c) || CategoryUtils.IsCategory(UnicodeCategory.InitialQuotePunctuation, c) || CategoryUtils.IsCategory(UnicodeCategory.ClosePunctuation, c) || CategoryUtils.IsCategory(UnicodeCategory.FinalQuotePunctuation, c) || CategoryUtils.IsCategory(UnicodeCategory.ConnectorPunctuation, c) || CategoryUtils.IsCategory(UnicodeCategory.OtherPunctuation, c);
|
||||
case Category.UnicodeS:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.MathSymbol, c) || CategoryUtils.IsCategory(UnicodeCategory.CurrencySymbol, c) || CategoryUtils.IsCategory(UnicodeCategory.ModifierSymbol, c) || CategoryUtils.IsCategory(UnicodeCategory.OtherSymbol, c);
|
||||
case Category.UnicodeC:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.Control, c) || CategoryUtils.IsCategory(UnicodeCategory.Format, c) || CategoryUtils.IsCategory(UnicodeCategory.PrivateUse, c) || CategoryUtils.IsCategory(UnicodeCategory.Surrogate, c) || CategoryUtils.IsCategory(UnicodeCategory.OtherNotAssigned, c);
|
||||
case Category.UnicodeLu:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.UppercaseLetter, c);
|
||||
case Category.UnicodeLl:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.LowercaseLetter, c);
|
||||
case Category.UnicodeLt:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.TitlecaseLetter, c);
|
||||
case Category.UnicodeLm:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.ModifierLetter, c);
|
||||
case Category.UnicodeLo:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.OtherLetter, c);
|
||||
case Category.UnicodeMn:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.NonSpacingMark, c);
|
||||
case Category.UnicodeMe:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.EnclosingMark, c);
|
||||
case Category.UnicodeMc:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.SpacingCombiningMark, c);
|
||||
case Category.UnicodeNd:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.DecimalDigitNumber, c);
|
||||
case Category.UnicodeNl:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.LetterNumber, c);
|
||||
case Category.UnicodeNo:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.OtherNumber, c);
|
||||
case Category.UnicodeZs:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.SpaceSeparator, c);
|
||||
case Category.UnicodeZl:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.LineSeparator, c);
|
||||
case Category.UnicodeZp:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.ParagraphSeparator, c);
|
||||
case Category.UnicodePd:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.DashPunctuation, c);
|
||||
case Category.UnicodePs:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.OpenPunctuation, c);
|
||||
case Category.UnicodePi:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.InitialQuotePunctuation, c);
|
||||
case Category.UnicodePe:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.ClosePunctuation, c);
|
||||
case Category.UnicodePf:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.FinalQuotePunctuation, c);
|
||||
case Category.UnicodePc:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.ConnectorPunctuation, c);
|
||||
case Category.UnicodePo:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.OtherPunctuation, c);
|
||||
case Category.UnicodeSm:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.MathSymbol, c);
|
||||
case Category.UnicodeSc:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.CurrencySymbol, c);
|
||||
case Category.UnicodeSk:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.ModifierSymbol, c);
|
||||
case Category.UnicodeSo:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.OtherSymbol, c);
|
||||
case Category.UnicodeCc:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.Control, c);
|
||||
case Category.UnicodeCf:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.Format, c);
|
||||
case Category.UnicodeCo:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.PrivateUse, c);
|
||||
case Category.UnicodeCs:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.Surrogate, c);
|
||||
case Category.UnicodeCn:
|
||||
return CategoryUtils.IsCategory(UnicodeCategory.OtherNotAssigned, c);
|
||||
case Category.UnicodeBasicLatin:
|
||||
return '\0' <= c && c <= '\u007f';
|
||||
case Category.UnicodeLatin1Supplement:
|
||||
return '\u0080' <= c && c <= 'ÿ';
|
||||
case Category.UnicodeLatinExtendedA:
|
||||
return 'Ā' <= c && c <= 'ſ';
|
||||
case Category.UnicodeLatinExtendedB:
|
||||
return 'ƀ' <= c && c <= 'ɏ';
|
||||
case Category.UnicodeIPAExtensions:
|
||||
return 'ɐ' <= c && c <= 'ʯ';
|
||||
case Category.UnicodeSpacingModifierLetters:
|
||||
return 'ʰ' <= c && c <= '\u02ff';
|
||||
case Category.UnicodeCombiningDiacriticalMarks:
|
||||
return '\u0300' <= c && c <= '\u036f';
|
||||
case Category.UnicodeGreek:
|
||||
return 'Ͱ' <= c && c <= 'Ͽ';
|
||||
case Category.UnicodeCyrillic:
|
||||
return 'Ѐ' <= c && c <= 'ӿ';
|
||||
case Category.UnicodeArmenian:
|
||||
return '\u0530' <= c && c <= '֏';
|
||||
case Category.UnicodeHebrew:
|
||||
return '\u0590' <= c && c <= '\u05ff';
|
||||
case Category.UnicodeArabic:
|
||||
return '\u0600' <= c && c <= 'ۿ';
|
||||
case Category.UnicodeSyriac:
|
||||
return '܀' <= c && c <= 'ݏ';
|
||||
case Category.UnicodeThaana:
|
||||
return 'ހ' <= c && c <= '\u07bf';
|
||||
case Category.UnicodeDevanagari:
|
||||
return '\u0900' <= c && c <= 'ॿ';
|
||||
case Category.UnicodeBengali:
|
||||
return 'ঀ' <= c && c <= '\u09ff';
|
||||
case Category.UnicodeGurmukhi:
|
||||
return '\u0a00' <= c && c <= '\u0a7f';
|
||||
case Category.UnicodeGujarati:
|
||||
return '\u0a80' <= c && c <= '\u0aff';
|
||||
case Category.UnicodeOriya:
|
||||
return '\u0b00' <= c && c <= '\u0b7f';
|
||||
case Category.UnicodeTamil:
|
||||
return '\u0b80' <= c && c <= '\u0bff';
|
||||
case Category.UnicodeTelugu:
|
||||
return '\u0c00' <= c && c <= '౿';
|
||||
case Category.UnicodeKannada:
|
||||
return 'ಀ' <= c && c <= '\u0cff';
|
||||
case Category.UnicodeMalayalam:
|
||||
return '\u0d00' <= c && c <= 'ൿ';
|
||||
case Category.UnicodeSinhala:
|
||||
return '\u0d80' <= c && c <= '\u0dff';
|
||||
case Category.UnicodeThai:
|
||||
return '\u0e00' <= c && c <= '\u0e7f';
|
||||
case Category.UnicodeLao:
|
||||
return '\u0e80' <= c && c <= '\u0eff';
|
||||
case Category.UnicodeTibetan:
|
||||
return 'ༀ' <= c && c <= '\u0fff';
|
||||
case Category.UnicodeMyanmar:
|
||||
return 'က' <= c && c <= '႟';
|
||||
case Category.UnicodeGeorgian:
|
||||
return 'Ⴀ' <= c && c <= 'ჿ';
|
||||
case Category.UnicodeHangulJamo:
|
||||
return 'ᄀ' <= c && c <= 'ᇿ';
|
||||
case Category.UnicodeEthiopic:
|
||||
return 'ሀ' <= c && c <= '\u137f';
|
||||
case Category.UnicodeCherokee:
|
||||
return 'Ꭰ' <= c && c <= '\u13ff';
|
||||
case Category.UnicodeUnifiedCanadianAboriginalSyllabics:
|
||||
return '᐀' <= c && c <= 'ᙿ';
|
||||
case Category.UnicodeOgham:
|
||||
return '\u1680' <= c && c <= '\u169f';
|
||||
case Category.UnicodeRunic:
|
||||
return 'ᚠ' <= c && c <= '\u16ff';
|
||||
case Category.UnicodeKhmer:
|
||||
return 'ក' <= c && c <= '\u17ff';
|
||||
case Category.UnicodeMongolian:
|
||||
return '᠀' <= c && c <= '\u18af';
|
||||
case Category.UnicodeLatinExtendedAdditional:
|
||||
return 'Ḁ' <= c && c <= 'ỿ';
|
||||
case Category.UnicodeGreekExtended:
|
||||
return 'ἀ' <= c && c <= '\u1fff';
|
||||
case Category.UnicodeGeneralPunctuation:
|
||||
return '\u2000' <= c && c <= '\u206f';
|
||||
case Category.UnicodeSuperscriptsandSubscripts:
|
||||
return '⁰' <= c && c <= '\u209f';
|
||||
case Category.UnicodeCurrencySymbols:
|
||||
return '₠' <= c && c <= '\u20cf';
|
||||
case Category.UnicodeCombiningMarksforSymbols:
|
||||
return '\u20d0' <= c && c <= '\u20ff';
|
||||
case Category.UnicodeLetterlikeSymbols:
|
||||
return '℀' <= c && c <= '⅏';
|
||||
case Category.UnicodeNumberForms:
|
||||
return '⅐' <= c && c <= '\u218f';
|
||||
case Category.UnicodeArrows:
|
||||
return '←' <= c && c <= '⇿';
|
||||
case Category.UnicodeMathematicalOperators:
|
||||
return '∀' <= c && c <= '⋿';
|
||||
case Category.UnicodeMiscellaneousTechnical:
|
||||
return '⌀' <= c && c <= '⏿';
|
||||
case Category.UnicodeControlPictures:
|
||||
return '␀' <= c && c <= '\u243f';
|
||||
case Category.UnicodeOpticalCharacterRecognition:
|
||||
return '⑀' <= c && c <= '\u245f';
|
||||
case Category.UnicodeEnclosedAlphanumerics:
|
||||
return '①' <= c && c <= '⓿';
|
||||
case Category.UnicodeBoxDrawing:
|
||||
return '─' <= c && c <= '╿';
|
||||
case Category.UnicodeBlockElements:
|
||||
return '▀' <= c && c <= '▟';
|
||||
case Category.UnicodeGeometricShapes:
|
||||
return '■' <= c && c <= '◿';
|
||||
case Category.UnicodeMiscellaneousSymbols:
|
||||
return '☀' <= c && c <= '⛿';
|
||||
case Category.UnicodeDingbats:
|
||||
return '✀' <= c && c <= '➿';
|
||||
case Category.UnicodeBraillePatterns:
|
||||
return '⠀' <= c && c <= '⣿';
|
||||
case Category.UnicodeCJKRadicalsSupplement:
|
||||
return '⺀' <= c && c <= '\u2eff';
|
||||
case Category.UnicodeKangxiRadicals:
|
||||
return '⼀' <= c && c <= '\u2fdf';
|
||||
case Category.UnicodeIdeographicDescriptionCharacters:
|
||||
return '⿰' <= c && c <= '\u2fff';
|
||||
case Category.UnicodeCJKSymbolsandPunctuation:
|
||||
return '\u3000' <= c && c <= '〿';
|
||||
case Category.UnicodeHiragana:
|
||||
return '\u3040' <= c && c <= 'ゟ';
|
||||
case Category.UnicodeKatakana:
|
||||
return '゠' <= c && c <= 'ヿ';
|
||||
case Category.UnicodeBopomofo:
|
||||
return '\u3100' <= c && c <= 'ㄯ';
|
||||
case Category.UnicodeHangulCompatibilityJamo:
|
||||
return '\u3130' <= c && c <= '\u318f';
|
||||
case Category.UnicodeKanbun:
|
||||
return '㆐' <= c && c <= '㆟';
|
||||
case Category.UnicodeBopomofoExtended:
|
||||
return 'ㆠ' <= c && c <= 'ㆿ';
|
||||
case Category.UnicodeEnclosedCJKLettersandMonths:
|
||||
return '㈀' <= c && c <= '㋿';
|
||||
case Category.UnicodeCJKCompatibility:
|
||||
return '㌀' <= c && c <= '㏿';
|
||||
case Category.UnicodeCJKUnifiedIdeographsExtensionA:
|
||||
return '㐀' <= c && c <= '䶵';
|
||||
case Category.UnicodeCJKUnifiedIdeographs:
|
||||
return '一' <= c && c <= '鿿';
|
||||
case Category.UnicodeYiSyllables:
|
||||
return 'ꀀ' <= c && c <= '\ua48f';
|
||||
case Category.UnicodeYiRadicals:
|
||||
return '꒐' <= c && c <= '\ua4cf';
|
||||
case Category.UnicodeHangulSyllables:
|
||||
return '가' <= c && c <= '힣';
|
||||
case Category.UnicodeHighSurrogates:
|
||||
return '\ud800' <= c && c <= '\udb7f';
|
||||
case Category.UnicodeHighPrivateUseSurrogates:
|
||||
return '\udb80' <= c && c <= '\udbff';
|
||||
case Category.UnicodeLowSurrogates:
|
||||
return '\udc00' <= c && c <= '\udfff';
|
||||
case Category.UnicodePrivateUse:
|
||||
return '\ue000' <= c && c <= '\uf8ff';
|
||||
case Category.UnicodeCJKCompatibilityIdeographs:
|
||||
return '豈' <= c && c <= '\ufaff';
|
||||
case Category.UnicodeAlphabeticPresentationForms:
|
||||
return 'ff' <= c && c <= 'ﭏ';
|
||||
case Category.UnicodeArabicPresentationFormsA:
|
||||
return 'ﭐ' <= c && c <= '﷿';
|
||||
case Category.UnicodeCombiningHalfMarks:
|
||||
return '\ufe20' <= c && c <= '\ufe2f';
|
||||
case Category.UnicodeCJKCompatibilityForms:
|
||||
return '︰' <= c && c <= '\ufe4f';
|
||||
case Category.UnicodeSmallFormVariants:
|
||||
return '﹐' <= c && c <= '\ufe6f';
|
||||
case Category.UnicodeArabicPresentationFormsB:
|
||||
return 'ﹰ' <= c && c <= '\ufefe';
|
||||
case Category.UnicodeSpecials:
|
||||
return ('\ufeff' <= c && c <= '\ufeff') || ('\ufff0' <= c && c <= '\ufffd');
|
||||
case Category.UnicodeHalfwidthandFullwidthForms:
|
||||
return '\uff00' <= c && c <= '\uffef';
|
||||
case Category.UnicodeOldItalic:
|
||||
case Category.UnicodeGothic:
|
||||
case Category.UnicodeDeseret:
|
||||
case Category.UnicodeByzantineMusicalSymbols:
|
||||
case Category.UnicodeMusicalSymbols:
|
||||
case Category.UnicodeMathematicalAlphanumericSymbols:
|
||||
case Category.UnicodeCJKUnifiedIdeographsExtensionB:
|
||||
case Category.UnicodeCJKCompatibilityIdeographsSupplement:
|
||||
case Category.UnicodeTags:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060019AF RID: 6575 RVA: 0x0005C4B0 File Offset: 0x0005A6B0
|
||||
private static bool IsCategory(UnicodeCategory uc, char c)
|
||||
{
|
||||
return char.GetUnicodeCategory(c) == uc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002CD RID: 717
|
||||
internal class Disassembler
|
||||
{
|
||||
// Token: 0x06001A13 RID: 6675 RVA: 0x0005CC60 File Offset: 0x0005AE60
|
||||
public static void DisassemblePattern(ushort[] image)
|
||||
{
|
||||
Disassembler.DisassembleBlock(image, 0, 0);
|
||||
}
|
||||
|
||||
// Token: 0x06001A14 RID: 6676 RVA: 0x0005CC6C File Offset: 0x0005AE6C
|
||||
public static void DisassembleBlock(ushort[] image, int pc, int depth)
|
||||
{
|
||||
while (pc < image.Length)
|
||||
{
|
||||
OpCode opCode;
|
||||
OpFlags opFlags;
|
||||
PatternCompiler.DecodeOp(image[pc], out opCode, out opFlags);
|
||||
Console.Write(Disassembler.FormatAddress(pc) + ": ");
|
||||
Console.Write(new string(' ', depth * 2));
|
||||
Console.Write(Disassembler.DisassembleOp(image, pc));
|
||||
Console.WriteLine();
|
||||
int num;
|
||||
switch (opCode)
|
||||
{
|
||||
case OpCode.False:
|
||||
case OpCode.True:
|
||||
case OpCode.Until:
|
||||
num = 1;
|
||||
break;
|
||||
case OpCode.Position:
|
||||
case OpCode.Reference:
|
||||
case OpCode.Character:
|
||||
case OpCode.Category:
|
||||
case OpCode.NotCategory:
|
||||
case OpCode.In:
|
||||
case OpCode.Open:
|
||||
case OpCode.Close:
|
||||
case OpCode.Sub:
|
||||
case OpCode.Branch:
|
||||
case OpCode.Jump:
|
||||
num = 2;
|
||||
break;
|
||||
case OpCode.String:
|
||||
num = (int)(image[pc + 1] + 2);
|
||||
break;
|
||||
case OpCode.Range:
|
||||
case OpCode.Balance:
|
||||
case OpCode.IfDefined:
|
||||
case OpCode.Test:
|
||||
case OpCode.Anchor:
|
||||
num = 3;
|
||||
break;
|
||||
case OpCode.Set:
|
||||
num = (int)(image[pc + 2] + 3);
|
||||
break;
|
||||
case OpCode.BalanceStart:
|
||||
goto IL_F7;
|
||||
case OpCode.Repeat:
|
||||
case OpCode.FastRepeat:
|
||||
case OpCode.Info:
|
||||
num = 4;
|
||||
break;
|
||||
default:
|
||||
goto IL_F7;
|
||||
}
|
||||
IL_FE:
|
||||
pc += num;
|
||||
continue;
|
||||
IL_F7:
|
||||
num = 1;
|
||||
goto IL_FE;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A15 RID: 6677 RVA: 0x0005CD80 File Offset: 0x0005AF80
|
||||
public static string DisassembleOp(ushort[] image, int pc)
|
||||
{
|
||||
OpCode opCode;
|
||||
OpFlags opFlags;
|
||||
PatternCompiler.DecodeOp(image[pc], out opCode, out opFlags);
|
||||
string text = opCode.ToString();
|
||||
if (opFlags != OpFlags.None)
|
||||
{
|
||||
text = text + "[" + opFlags.ToString("f") + "]";
|
||||
}
|
||||
switch (opCode)
|
||||
{
|
||||
case OpCode.Position:
|
||||
text = text + " /" + (Position)image[pc + 1];
|
||||
break;
|
||||
case OpCode.String:
|
||||
text = text + " '" + Disassembler.ReadString(image, pc + 1) + "'";
|
||||
break;
|
||||
case OpCode.Reference:
|
||||
case OpCode.Open:
|
||||
case OpCode.Close:
|
||||
text = text + " " + image[pc + 1];
|
||||
break;
|
||||
case OpCode.Character:
|
||||
text = text + " '" + Disassembler.FormatChar((char)image[pc + 1]) + "'";
|
||||
break;
|
||||
case OpCode.Category:
|
||||
case OpCode.NotCategory:
|
||||
text = text + " /" + (Category)image[pc + 1];
|
||||
break;
|
||||
case OpCode.Range:
|
||||
text = text + " '" + Disassembler.FormatChar((char)image[pc + 1]) + "', ";
|
||||
text = text + " '" + Disassembler.FormatChar((char)image[pc + 2]) + "'";
|
||||
break;
|
||||
case OpCode.Set:
|
||||
text = text + " " + Disassembler.FormatSet(image, pc + 1);
|
||||
break;
|
||||
case OpCode.In:
|
||||
case OpCode.Sub:
|
||||
case OpCode.Branch:
|
||||
case OpCode.Jump:
|
||||
text = text + " :" + Disassembler.FormatAddress(pc + (int)image[pc + 1]);
|
||||
break;
|
||||
case OpCode.Balance:
|
||||
{
|
||||
string text2 = text;
|
||||
text = string.Concat(new object[]
|
||||
{
|
||||
text2,
|
||||
" ",
|
||||
image[pc + 1],
|
||||
" ",
|
||||
image[pc + 2]
|
||||
});
|
||||
break;
|
||||
}
|
||||
case OpCode.IfDefined:
|
||||
case OpCode.Anchor:
|
||||
text = text + " :" + Disassembler.FormatAddress(pc + (int)image[pc + 1]);
|
||||
text = text + " " + image[pc + 2];
|
||||
break;
|
||||
case OpCode.Test:
|
||||
text = text + " :" + Disassembler.FormatAddress(pc + (int)image[pc + 1]);
|
||||
text = text + ", :" + Disassembler.FormatAddress(pc + (int)image[pc + 2]);
|
||||
break;
|
||||
case OpCode.Repeat:
|
||||
case OpCode.FastRepeat:
|
||||
{
|
||||
text = text + " :" + Disassembler.FormatAddress(pc + (int)image[pc + 1]);
|
||||
string text2 = text;
|
||||
text = string.Concat(new object[]
|
||||
{
|
||||
text2,
|
||||
" (",
|
||||
image[pc + 2],
|
||||
", "
|
||||
});
|
||||
if (image[pc + 3] == 65535)
|
||||
{
|
||||
text += "Inf";
|
||||
}
|
||||
else
|
||||
{
|
||||
text += image[pc + 3];
|
||||
}
|
||||
text += ")";
|
||||
break;
|
||||
}
|
||||
case OpCode.Info:
|
||||
{
|
||||
text = text + " " + image[pc + 1];
|
||||
string text2 = text;
|
||||
text = string.Concat(new object[]
|
||||
{
|
||||
text2,
|
||||
" (",
|
||||
image[pc + 2],
|
||||
", ",
|
||||
image[pc + 3],
|
||||
")"
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
// Token: 0x06001A16 RID: 6678 RVA: 0x0005D0DC File Offset: 0x0005B2DC
|
||||
private static string ReadString(ushort[] image, int pc)
|
||||
{
|
||||
int num = (int)image[pc];
|
||||
char[] array = new char[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
array[i] = (char)image[pc + i + 1];
|
||||
}
|
||||
return new string(array);
|
||||
}
|
||||
|
||||
// Token: 0x06001A17 RID: 6679 RVA: 0x0005D118 File Offset: 0x0005B318
|
||||
private static string FormatAddress(int pc)
|
||||
{
|
||||
return pc.ToString("x4");
|
||||
}
|
||||
|
||||
// Token: 0x06001A18 RID: 6680 RVA: 0x0005D128 File Offset: 0x0005B328
|
||||
private static string FormatSet(ushort[] image, int pc)
|
||||
{
|
||||
int num = (int)image[pc++];
|
||||
int num2 = ((int)image[pc++] << 4) - 1;
|
||||
string text = "[";
|
||||
bool flag = false;
|
||||
char c = '\0';
|
||||
for (int i = 0; i <= num2; i++)
|
||||
{
|
||||
bool flag2 = ((int)image[pc + (i >> 4)] & (1 << (i & 15))) != 0;
|
||||
if (flag2 & !flag)
|
||||
{
|
||||
c = (char)(num + i);
|
||||
flag = true;
|
||||
}
|
||||
else if (flag & (!flag2 || i == num2))
|
||||
{
|
||||
char c2 = (char)(num + i - 1);
|
||||
text += Disassembler.FormatChar(c);
|
||||
if (c2 != c)
|
||||
{
|
||||
text = text + "-" + Disassembler.FormatChar(c2);
|
||||
}
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
return text + "]";
|
||||
}
|
||||
|
||||
// Token: 0x06001A19 RID: 6681 RVA: 0x0005D1FC File Offset: 0x0005B3FC
|
||||
private static string FormatChar(char c)
|
||||
{
|
||||
if (c == '-' || c == ']')
|
||||
{
|
||||
return "\\" + c;
|
||||
}
|
||||
if (char.IsLetterOrDigit(c) || char.IsSymbol(c))
|
||||
{
|
||||
return c.ToString();
|
||||
}
|
||||
if (char.IsControl(c))
|
||||
{
|
||||
return "^" + ('@' + c);
|
||||
}
|
||||
string text = "\\u";
|
||||
int num = (int)c;
|
||||
return text + num.ToString("x4");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x02000341 RID: 833
|
||||
// (Invoke) Token: 0x06001CDD RID: 7389
|
||||
internal delegate bool EvalDelegate(RxInterpreter interp, int strpos, ref int strpos_result);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002BF RID: 703
|
||||
internal class FactoryCache
|
||||
{
|
||||
// Token: 0x0600199E RID: 6558 RVA: 0x0005B1C0 File Offset: 0x000593C0
|
||||
public FactoryCache(int capacity)
|
||||
{
|
||||
this.capacity = capacity;
|
||||
this.factories = new Hashtable(capacity);
|
||||
this.mru_list = new MRUList();
|
||||
}
|
||||
|
||||
// Token: 0x0600199F RID: 6559 RVA: 0x0005B1F4 File Offset: 0x000593F4
|
||||
public void Add(string pattern, RegexOptions options, IMachineFactory factory)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
FactoryCache.Key key = new FactoryCache.Key(pattern, options);
|
||||
this.Cleanup();
|
||||
this.factories[key] = factory;
|
||||
this.mru_list.Use(key);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060019A0 RID: 6560 RVA: 0x0005B258 File Offset: 0x00059458
|
||||
private void Cleanup()
|
||||
{
|
||||
while (this.factories.Count >= this.capacity && this.capacity > 0)
|
||||
{
|
||||
object obj = this.mru_list.Evict();
|
||||
if (obj != null)
|
||||
{
|
||||
this.factories.Remove((FactoryCache.Key)obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060019A1 RID: 6561 RVA: 0x0005B2B0 File Offset: 0x000594B0
|
||||
public IMachineFactory Lookup(string pattern, RegexOptions options)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
FactoryCache.Key key = new FactoryCache.Key(pattern, options);
|
||||
if (this.factories.Contains(key))
|
||||
{
|
||||
this.mru_list.Use(key);
|
||||
return (IMachineFactory)this.factories[key];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Token: 0x17000800 RID: 2048
|
||||
// (get) Token: 0x060019A2 RID: 6562 RVA: 0x0005B32C File Offset: 0x0005952C
|
||||
// (set) Token: 0x060019A3 RID: 6563 RVA: 0x0005B334 File Offset: 0x00059534
|
||||
public int Capacity
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.capacity;
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
this.capacity = value;
|
||||
this.Cleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040014D4 RID: 5332
|
||||
private int capacity;
|
||||
|
||||
// Token: 0x040014D5 RID: 5333
|
||||
private Hashtable factories;
|
||||
|
||||
// Token: 0x040014D6 RID: 5334
|
||||
private MRUList mru_list;
|
||||
|
||||
// Token: 0x020002C0 RID: 704
|
||||
private class Key
|
||||
{
|
||||
// Token: 0x060019A4 RID: 6564 RVA: 0x0005B380 File Offset: 0x00059580
|
||||
public Key(string pattern, RegexOptions options)
|
||||
{
|
||||
this.pattern = pattern;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
// Token: 0x060019A5 RID: 6565 RVA: 0x0005B398 File Offset: 0x00059598
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.pattern.GetHashCode() ^ (int)this.options;
|
||||
}
|
||||
|
||||
// Token: 0x060019A6 RID: 6566 RVA: 0x0005B3AC File Offset: 0x000595AC
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
if (o == null || !(o is FactoryCache.Key))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
FactoryCache.Key key = (FactoryCache.Key)o;
|
||||
return this.options == key.options && this.pattern.Equals(key.pattern);
|
||||
}
|
||||
|
||||
// Token: 0x060019A7 RID: 6567 RVA: 0x0005B3F8 File Offset: 0x000595F8
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Concat(new object[] { "('", this.pattern, "', [", this.options, "])" });
|
||||
}
|
||||
|
||||
// Token: 0x040014D7 RID: 5335
|
||||
public string pattern;
|
||||
|
||||
// Token: 0x040014D8 RID: 5336
|
||||
public RegexOptions options;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents the results from a single capturing group. </summary>
|
||||
// Token: 0x020002AD RID: 685
|
||||
[Serializable]
|
||||
public class Group : Capture
|
||||
{
|
||||
// Token: 0x060018FE RID: 6398 RVA: 0x00055A90 File Offset: 0x00053C90
|
||||
internal Group(string text, int index, int length, int n_caps)
|
||||
: base(text, index, length)
|
||||
{
|
||||
this.success = true;
|
||||
this.captures = new CaptureCollection(n_caps);
|
||||
this.captures.SetValue(this, n_caps - 1);
|
||||
}
|
||||
|
||||
// Token: 0x060018FF RID: 6399 RVA: 0x00055AC0 File Offset: 0x00053CC0
|
||||
internal Group(string text, int index, int length)
|
||||
: base(text, index, length)
|
||||
{
|
||||
this.success = true;
|
||||
}
|
||||
|
||||
// Token: 0x06001900 RID: 6400 RVA: 0x00055AD4 File Offset: 0x00053CD4
|
||||
internal Group()
|
||||
: base(string.Empty)
|
||||
{
|
||||
this.success = false;
|
||||
this.captures = new CaptureCollection(0);
|
||||
}
|
||||
|
||||
/// <summary>Returns a Group object equivalent to the one supplied that is safe to share between multiple threads.</summary>
|
||||
/// <returns>A regular expression Group object. </returns>
|
||||
/// <param name="inner">The input <see cref="T:System.Text.RegularExpressions.Group" /> object.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="inner" /> is null.</exception>
|
||||
// Token: 0x06001902 RID: 6402 RVA: 0x00055B00 File Offset: 0x00053D00
|
||||
[global::System.MonoTODO("not thread-safe")]
|
||||
public static Group Synchronized(Group inner)
|
||||
{
|
||||
if (inner == null)
|
||||
{
|
||||
throw new ArgumentNullException("inner");
|
||||
}
|
||||
return inner;
|
||||
}
|
||||
|
||||
/// <summary>Gets a collection of all the captures matched by the capturing group, in innermost-leftmost-first order (or innermost-rightmost-first order if the regular expression is modified with the <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> option). The collection may have zero or more items.</summary>
|
||||
/// <returns>The collection of substrings matched by the group.</returns>
|
||||
// Token: 0x170007D6 RID: 2006
|
||||
// (get) Token: 0x06001903 RID: 6403 RVA: 0x00055B14 File Offset: 0x00053D14
|
||||
public CaptureCollection Captures
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.captures;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the match is successful.</summary>
|
||||
/// <returns>true if the match is successful; otherwise, false.</returns>
|
||||
// Token: 0x170007D7 RID: 2007
|
||||
// (get) Token: 0x06001904 RID: 6404 RVA: 0x00055B1C File Offset: 0x00053D1C
|
||||
public bool Success
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.success;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040013C6 RID: 5062
|
||||
internal static Group Fail = new Group();
|
||||
|
||||
// Token: 0x040013C7 RID: 5063
|
||||
private bool success;
|
||||
|
||||
// Token: 0x040013C8 RID: 5064
|
||||
private CaptureCollection captures;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents a collection of captured groups in a single match. </summary>
|
||||
// Token: 0x020002AE RID: 686
|
||||
[Serializable]
|
||||
public class GroupCollection : ICollection, IEnumerable
|
||||
{
|
||||
// Token: 0x06001905 RID: 6405 RVA: 0x00055B24 File Offset: 0x00053D24
|
||||
internal GroupCollection(int n, int gap)
|
||||
{
|
||||
this.list = new Group[n];
|
||||
this.gap = gap;
|
||||
}
|
||||
|
||||
/// <summary>Returns the number of groups in the collection.</summary>
|
||||
/// <returns>The number of groups in the collection.</returns>
|
||||
// Token: 0x170007D8 RID: 2008
|
||||
// (get) Token: 0x06001906 RID: 6406 RVA: 0x00055B40 File Offset: 0x00053D40
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list.Length;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the collection is read-only.</summary>
|
||||
/// <returns>true if GroupCollection is read-only; otherwise false.</returns>
|
||||
// Token: 0x170007D9 RID: 2009
|
||||
// (get) Token: 0x06001907 RID: 6407 RVA: 0x00055B4C File Offset: 0x00053D4C
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether access to the GroupCollection is synchronized (thread-safe).</summary>
|
||||
/// <returns>true if access is synchronized; otherwise false.</returns>
|
||||
// Token: 0x170007DA RID: 2010
|
||||
// (get) Token: 0x06001908 RID: 6408 RVA: 0x00055B50 File Offset: 0x00053D50
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Enables access to a member of the collection by integer index.</summary>
|
||||
/// <returns>The member of the collection specified by <paramref name="groupnum" />.</returns>
|
||||
/// <param name="groupnum">The zero-based index of the collection member to be retrieved. </param>
|
||||
// Token: 0x170007DB RID: 2011
|
||||
public Group this[int i]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (i >= this.gap)
|
||||
{
|
||||
Match match = (Match)this.list[0];
|
||||
i = ((match != Match.Empty) ? match.Regex.GetGroupIndex(i) : (-1));
|
||||
}
|
||||
return (i >= 0) ? this.list[i] : Group.Fail;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600190A RID: 6410 RVA: 0x00055BB4 File Offset: 0x00053DB4
|
||||
internal void SetValue(Group g, int i)
|
||||
{
|
||||
this.list[i] = g;
|
||||
}
|
||||
|
||||
/// <summary>Enables access to a member of the collection by string index.</summary>
|
||||
/// <returns>The member of the collection specified by <paramref name="groupname" />.</returns>
|
||||
/// <param name="groupname">The name of a capturing group. </param>
|
||||
// Token: 0x170007DC RID: 2012
|
||||
public Group this[string groupName]
|
||||
{
|
||||
get
|
||||
{
|
||||
Match match = (Match)this.list[0];
|
||||
if (match != Match.Empty)
|
||||
{
|
||||
int num = match.Regex.GroupNumberFromName(groupName);
|
||||
if (num != -1)
|
||||
{
|
||||
return this[num];
|
||||
}
|
||||
}
|
||||
return Group.Fail;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an object that can be used to synchronize access to the GroupCollection.</summary>
|
||||
/// <returns>A copy of the <see cref="T:System.Text.RegularExpressions.Match" /> object to synchronize.</returns>
|
||||
// Token: 0x170007DD RID: 2013
|
||||
// (get) Token: 0x0600190C RID: 6412 RVA: 0x00055C08 File Offset: 0x00053E08
|
||||
public object SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Copies all the elements of the collection to the given array beginning at the given index.</summary>
|
||||
/// <param name="array">The array the collection is to be copied into. </param>
|
||||
/// <param name="arrayIndex">The position in the destination array where the copying is to begin. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="array" /> is null.</exception>
|
||||
/// <exception cref="T:System.IndexOutOfRangeException">
|
||||
/// <paramref name="arrayIndex" /> is outside the bounds of <paramref name="array" />.-or-<paramref name="arrayIndex" /> plus <see cref="P:System.Text.RegularExpressions.GroupCollection.Count" /> is outside the bounds of <paramref name="array" />.</exception>
|
||||
// Token: 0x0600190D RID: 6413 RVA: 0x00055C10 File Offset: 0x00053E10
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
this.list.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>Returns an enumerator that can iterate through the collection.</summary>
|
||||
/// <returns>An object that contains all <see cref="T:System.Text.RegularExpressions.Group" /> objects in the <see cref="T:System.Text.RegularExpressions.GroupCollection" />.</returns>
|
||||
// Token: 0x0600190E RID: 6414 RVA: 0x00055C20 File Offset: 0x00053E20
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return this.list.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x040013C9 RID: 5065
|
||||
private Group[] list;
|
||||
|
||||
// Token: 0x040013CA RID: 5066
|
||||
private int gap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C6 RID: 710
|
||||
internal interface ICompiler
|
||||
{
|
||||
// Token: 0x060019B1 RID: 6577
|
||||
void Reset();
|
||||
|
||||
// Token: 0x060019B2 RID: 6578
|
||||
IMachineFactory GetMachineFactory();
|
||||
|
||||
// Token: 0x060019B3 RID: 6579
|
||||
void EmitFalse();
|
||||
|
||||
// Token: 0x060019B4 RID: 6580
|
||||
void EmitTrue();
|
||||
|
||||
// Token: 0x060019B5 RID: 6581
|
||||
void EmitCharacter(char c, bool negate, bool ignore, bool reverse);
|
||||
|
||||
// Token: 0x060019B6 RID: 6582
|
||||
void EmitCategory(Category cat, bool negate, bool reverse);
|
||||
|
||||
// Token: 0x060019B7 RID: 6583
|
||||
void EmitNotCategory(Category cat, bool negate, bool reverse);
|
||||
|
||||
// Token: 0x060019B8 RID: 6584
|
||||
void EmitRange(char lo, char hi, bool negate, bool ignore, bool reverse);
|
||||
|
||||
// Token: 0x060019B9 RID: 6585
|
||||
void EmitSet(char lo, BitArray set, bool negate, bool ignore, bool reverse);
|
||||
|
||||
// Token: 0x060019BA RID: 6586
|
||||
void EmitString(string str, bool ignore, bool reverse);
|
||||
|
||||
// Token: 0x060019BB RID: 6587
|
||||
void EmitPosition(Position pos);
|
||||
|
||||
// Token: 0x060019BC RID: 6588
|
||||
void EmitOpen(int gid);
|
||||
|
||||
// Token: 0x060019BD RID: 6589
|
||||
void EmitClose(int gid);
|
||||
|
||||
// Token: 0x060019BE RID: 6590
|
||||
void EmitBalanceStart(int gid, int balance, bool capture, LinkRef tail);
|
||||
|
||||
// Token: 0x060019BF RID: 6591
|
||||
void EmitBalance();
|
||||
|
||||
// Token: 0x060019C0 RID: 6592
|
||||
void EmitReference(int gid, bool ignore, bool reverse);
|
||||
|
||||
// Token: 0x060019C1 RID: 6593
|
||||
void EmitIfDefined(int gid, LinkRef tail);
|
||||
|
||||
// Token: 0x060019C2 RID: 6594
|
||||
void EmitSub(LinkRef tail);
|
||||
|
||||
// Token: 0x060019C3 RID: 6595
|
||||
void EmitTest(LinkRef yes, LinkRef tail);
|
||||
|
||||
// Token: 0x060019C4 RID: 6596
|
||||
void EmitBranch(LinkRef next);
|
||||
|
||||
// Token: 0x060019C5 RID: 6597
|
||||
void EmitJump(LinkRef target);
|
||||
|
||||
// Token: 0x060019C6 RID: 6598
|
||||
void EmitRepeat(int min, int max, bool lazy, LinkRef until);
|
||||
|
||||
// Token: 0x060019C7 RID: 6599
|
||||
void EmitUntil(LinkRef repeat);
|
||||
|
||||
// Token: 0x060019C8 RID: 6600
|
||||
void EmitIn(LinkRef tail);
|
||||
|
||||
// Token: 0x060019C9 RID: 6601
|
||||
void EmitInfo(int count, int min, int max);
|
||||
|
||||
// Token: 0x060019CA RID: 6602
|
||||
void EmitFastRepeat(int min, int max, bool lazy, LinkRef tail);
|
||||
|
||||
// Token: 0x060019CB RID: 6603
|
||||
void EmitAnchor(bool reverse, int offset, LinkRef tail);
|
||||
|
||||
// Token: 0x060019CC RID: 6604
|
||||
void EmitBranchEnd();
|
||||
|
||||
// Token: 0x060019CD RID: 6605
|
||||
void EmitAlternationEnd();
|
||||
|
||||
// Token: 0x060019CE RID: 6606
|
||||
LinkRef NewLink();
|
||||
|
||||
// Token: 0x060019CF RID: 6607
|
||||
void ResolveLink(LinkRef link);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002BD RID: 701
|
||||
internal interface IMachine
|
||||
{
|
||||
// Token: 0x06001992 RID: 6546
|
||||
Match Scan(Regex regex, string text, int start, int end);
|
||||
|
||||
// Token: 0x06001993 RID: 6547
|
||||
string[] Split(Regex regex, string input, int count, int startat);
|
||||
|
||||
// Token: 0x06001994 RID: 6548
|
||||
string Replace(Regex regex, string input, string replacement, int count, int startat);
|
||||
|
||||
// Token: 0x06001995 RID: 6549
|
||||
string Result(string replacement, Match match);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002BE RID: 702
|
||||
internal interface IMachineFactory
|
||||
{
|
||||
// Token: 0x06001996 RID: 6550
|
||||
IMachine NewInstance();
|
||||
|
||||
// Token: 0x170007FC RID: 2044
|
||||
// (get) Token: 0x06001997 RID: 6551
|
||||
// (set) Token: 0x06001998 RID: 6552
|
||||
IDictionary Mapping { get; set; }
|
||||
|
||||
// Token: 0x170007FD RID: 2045
|
||||
// (get) Token: 0x06001999 RID: 6553
|
||||
int GroupCount { get; }
|
||||
|
||||
// Token: 0x170007FE RID: 2046
|
||||
// (get) Token: 0x0600199A RID: 6554
|
||||
// (set) Token: 0x0600199B RID: 6555
|
||||
int Gap { get; set; }
|
||||
|
||||
// Token: 0x170007FF RID: 2047
|
||||
// (get) Token: 0x0600199C RID: 6556
|
||||
// (set) Token: 0x0600199D RID: 6557
|
||||
string[] NamesMapping { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,1355 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002CE RID: 718
|
||||
internal class Interpreter : BaseMachine
|
||||
{
|
||||
// Token: 0x06001A1A RID: 6682 RVA: 0x0005D280 File Offset: 0x0005B480
|
||||
public Interpreter(ushort[] program)
|
||||
{
|
||||
this.program = program;
|
||||
this.qs = null;
|
||||
this.group_count = this.ReadProgramCount(1) + 1;
|
||||
this.match_min = this.ReadProgramCount(3);
|
||||
this.program_start = 7;
|
||||
this.groups = new int[this.group_count];
|
||||
}
|
||||
|
||||
// Token: 0x06001A1B RID: 6683 RVA: 0x0005D2E4 File Offset: 0x0005B4E4
|
||||
private int ReadProgramCount(int ptr)
|
||||
{
|
||||
int num = (int)this.program[ptr + 1];
|
||||
num <<= 16;
|
||||
return num + (int)this.program[ptr];
|
||||
}
|
||||
|
||||
// Token: 0x06001A1C RID: 6684 RVA: 0x0005D310 File Offset: 0x0005B510
|
||||
public override Match Scan(Regex regex, string text, int start, int end)
|
||||
{
|
||||
this.text = text;
|
||||
this.text_end = end;
|
||||
this.scan_ptr = start;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref this.scan_ptr, this.program_start))
|
||||
{
|
||||
return this.GenerateMatch(regex);
|
||||
}
|
||||
return Match.Empty;
|
||||
}
|
||||
|
||||
// Token: 0x06001A1D RID: 6685 RVA: 0x0005D350 File Offset: 0x0005B550
|
||||
private void Reset()
|
||||
{
|
||||
this.ResetGroups();
|
||||
this.fast = (this.repeat = null);
|
||||
}
|
||||
|
||||
// Token: 0x06001A1E RID: 6686 RVA: 0x0005D374 File Offset: 0x0005B574
|
||||
private bool Eval(Interpreter.Mode mode, ref int ref_ptr, int pc)
|
||||
{
|
||||
int num = ref_ptr;
|
||||
Interpreter.RepeatContext repeatContext;
|
||||
int start;
|
||||
int count;
|
||||
for (;;)
|
||||
{
|
||||
OpFlags opFlags;
|
||||
for (;;)
|
||||
{
|
||||
ushort num2 = this.program[pc];
|
||||
OpCode opCode = (OpCode)(num2 & 255);
|
||||
opFlags = (OpFlags)(num2 & 65280);
|
||||
switch (opCode)
|
||||
{
|
||||
case OpCode.False:
|
||||
goto IL_4B8;
|
||||
case OpCode.True:
|
||||
goto IL_4BD;
|
||||
case OpCode.Position:
|
||||
if (!this.IsPosition((Position)this.program[pc + 1], num))
|
||||
{
|
||||
goto Block_44;
|
||||
}
|
||||
pc += 2;
|
||||
break;
|
||||
case OpCode.String:
|
||||
{
|
||||
bool flag = (ushort)(opFlags & OpFlags.RightToLeft) != 0;
|
||||
bool flag2 = (ushort)(opFlags & OpFlags.IgnoreCase) != 0;
|
||||
int num3 = (int)this.program[pc + 1];
|
||||
if (flag)
|
||||
{
|
||||
num -= num3;
|
||||
if (num < 0)
|
||||
{
|
||||
goto Block_46;
|
||||
}
|
||||
}
|
||||
else if (num + num3 > this.text_end)
|
||||
{
|
||||
goto Block_47;
|
||||
}
|
||||
pc += 2;
|
||||
for (int i = 0; i < num3; i++)
|
||||
{
|
||||
char c = this.text[num + i];
|
||||
if (flag2)
|
||||
{
|
||||
c = char.ToLower(c);
|
||||
}
|
||||
if (c != (char)this.program[pc++])
|
||||
{
|
||||
goto Block_49;
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
num += num3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OpCode.Reference:
|
||||
{
|
||||
bool flag3 = (ushort)(opFlags & OpFlags.RightToLeft) != 0;
|
||||
bool flag4 = (ushort)(opFlags & OpFlags.IgnoreCase) != 0;
|
||||
int lastDefined = this.GetLastDefined((int)this.program[pc + 1]);
|
||||
if (lastDefined < 0)
|
||||
{
|
||||
goto Block_52;
|
||||
}
|
||||
int index = this.marks[lastDefined].Index;
|
||||
int length = this.marks[lastDefined].Length;
|
||||
if (flag3)
|
||||
{
|
||||
num -= length;
|
||||
if (num < 0)
|
||||
{
|
||||
goto Block_54;
|
||||
}
|
||||
}
|
||||
else if (num + length > this.text_end)
|
||||
{
|
||||
goto Block_55;
|
||||
}
|
||||
pc += 2;
|
||||
if (flag4)
|
||||
{
|
||||
for (int j = 0; j < length; j++)
|
||||
{
|
||||
if (char.ToLower(this.text[num + j]) != char.ToLower(this.text[index + j]))
|
||||
{
|
||||
goto Block_57;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int k = 0; k < length; k++)
|
||||
{
|
||||
if (this.text[num + k] != this.text[index + k])
|
||||
{
|
||||
goto Block_59;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag3)
|
||||
{
|
||||
num += length;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OpCode.Character:
|
||||
case OpCode.Category:
|
||||
case OpCode.NotCategory:
|
||||
case OpCode.Range:
|
||||
case OpCode.Set:
|
||||
if (!this.EvalChar(mode, ref num, ref pc, false))
|
||||
{
|
||||
goto Block_61;
|
||||
}
|
||||
break;
|
||||
case OpCode.In:
|
||||
{
|
||||
int num4 = pc + (int)this.program[pc + 1];
|
||||
pc += 2;
|
||||
if (!this.EvalChar(mode, ref num, ref pc, true))
|
||||
{
|
||||
goto Block_62;
|
||||
}
|
||||
pc = num4;
|
||||
break;
|
||||
}
|
||||
case OpCode.Open:
|
||||
this.Open((int)this.program[pc + 1], num);
|
||||
pc += 2;
|
||||
break;
|
||||
case OpCode.Close:
|
||||
this.Close((int)this.program[pc + 1], num);
|
||||
pc += 2;
|
||||
break;
|
||||
case OpCode.Balance:
|
||||
goto IL_7DB;
|
||||
case OpCode.BalanceStart:
|
||||
{
|
||||
int num5 = num;
|
||||
if (!this.Eval(Interpreter.Mode.Match, ref num, pc + 5))
|
||||
{
|
||||
goto Block_63;
|
||||
}
|
||||
if (!this.Balance((int)this.program[pc + 1], (int)this.program[pc + 2], this.program[pc + 3] == 1, num5))
|
||||
{
|
||||
goto Block_65;
|
||||
}
|
||||
pc += (int)this.program[pc + 4];
|
||||
break;
|
||||
}
|
||||
case OpCode.IfDefined:
|
||||
{
|
||||
int lastDefined2 = this.GetLastDefined((int)this.program[pc + 2]);
|
||||
if (lastDefined2 < 0)
|
||||
{
|
||||
pc += (int)this.program[pc + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
pc += 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OpCode.Sub:
|
||||
if (!this.Eval(Interpreter.Mode.Match, ref num, pc + 2))
|
||||
{
|
||||
goto Block_67;
|
||||
}
|
||||
pc += (int)this.program[pc + 1];
|
||||
break;
|
||||
case OpCode.Test:
|
||||
{
|
||||
int num6 = this.Checkpoint();
|
||||
int num7 = num;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num7, pc + 3))
|
||||
{
|
||||
pc += (int)this.program[pc + 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Backtrack(num6);
|
||||
pc += (int)this.program[pc + 2];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OpCode.Branch:
|
||||
goto IL_88A;
|
||||
case OpCode.Jump:
|
||||
pc += (int)this.program[pc + 1];
|
||||
break;
|
||||
case OpCode.Repeat:
|
||||
goto IL_8EE;
|
||||
case OpCode.Until:
|
||||
goto IL_957;
|
||||
case OpCode.FastRepeat:
|
||||
goto IL_C6F;
|
||||
case OpCode.Anchor:
|
||||
goto IL_96;
|
||||
case OpCode.Info:
|
||||
goto IL_FE9;
|
||||
}
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
IL_88A:
|
||||
int num8 = this.Checkpoint();
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc + 2))
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.Backtrack(num8);
|
||||
pc += (int)this.program[pc + 1];
|
||||
if ((this.program[pc] & 255) == 0)
|
||||
{
|
||||
goto Block_70;
|
||||
}
|
||||
}
|
||||
IL_FF3:
|
||||
ref_ptr = num;
|
||||
if (mode == Interpreter.Mode.Match)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (mode != Interpreter.Mode.Count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.fast.Count++;
|
||||
if (this.fast.IsMaximum || (this.fast.IsLazy && this.fast.IsMinimum))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
pc = this.fast.Expression;
|
||||
continue;
|
||||
IL_96:
|
||||
int num9 = (int)this.program[pc + 1];
|
||||
int num10 = (int)this.program[pc + 2];
|
||||
bool flag5 = (ushort)(opFlags & OpFlags.RightToLeft) != 0;
|
||||
int num11 = ((!flag5) ? (num + num10) : (num - num10));
|
||||
int num12 = this.text_end - this.match_min + num10;
|
||||
int num13 = 0;
|
||||
OpCode opCode2 = (OpCode)(this.program[pc + 3] & 255);
|
||||
if (opCode2 == OpCode.Position && num9 == 6)
|
||||
{
|
||||
switch (this.program[pc + 4])
|
||||
{
|
||||
case 2:
|
||||
if (flag5 || num10 == 0)
|
||||
{
|
||||
if (flag5)
|
||||
{
|
||||
num = num10;
|
||||
}
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (num11 == 0)
|
||||
{
|
||||
num = 0;
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
num11++;
|
||||
}
|
||||
while ((flag5 && num11 >= 0) || (!flag5 && num11 <= num12))
|
||||
{
|
||||
if (num11 == 0 || this.text[num11 - 1] == '\n')
|
||||
{
|
||||
if (flag5)
|
||||
{
|
||||
num = ((num11 != num12) ? (num11 + num10) : num11);
|
||||
}
|
||||
else
|
||||
{
|
||||
num = ((num11 != 0) ? (num11 - num10) : num11);
|
||||
}
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
}
|
||||
if (flag5)
|
||||
{
|
||||
num11--;
|
||||
}
|
||||
else
|
||||
{
|
||||
num11++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (num11 == this.scan_ptr)
|
||||
{
|
||||
num = ((!flag5) ? (this.scan_ptr - num10) : (this.scan_ptr + num10));
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (this.qs != null || (opCode2 == OpCode.String && num9 == (int)(6 + this.program[pc + 4])))
|
||||
{
|
||||
bool flag6 = (this.program[pc + 3] & 1024) != 0;
|
||||
if (this.qs == null)
|
||||
{
|
||||
bool flag7 = (this.program[pc + 3] & 512) != 0;
|
||||
string @string = this.GetString(pc + 3);
|
||||
this.qs = new QuickSearch(@string, flag7, flag6);
|
||||
}
|
||||
while ((flag5 && num11 >= num13) || (!flag5 && num11 <= num12))
|
||||
{
|
||||
if (flag6)
|
||||
{
|
||||
num11 = this.qs.Search(this.text, num11, num13);
|
||||
if (num11 != -1)
|
||||
{
|
||||
num11 += this.qs.Length;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num11 = this.qs.Search(this.text, num11, num12);
|
||||
}
|
||||
if (num11 < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num = ((!flag6) ? (num11 - num10) : (num11 + num10));
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
if (flag6)
|
||||
{
|
||||
num11 -= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
num11++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (opCode2 == OpCode.True)
|
||||
{
|
||||
while ((flag5 && num11 >= num13) || (!flag5 && num11 <= num12))
|
||||
{
|
||||
num = num11;
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
if (flag5)
|
||||
{
|
||||
num11--;
|
||||
}
|
||||
else
|
||||
{
|
||||
num11++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
while ((flag5 && num11 >= num13) || (!flag5 && num11 <= num12))
|
||||
{
|
||||
num = num11;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc + 3))
|
||||
{
|
||||
num = ((!flag5) ? (num11 - num10) : (num11 + num10));
|
||||
if (this.TryMatch(ref num, pc + num9))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
}
|
||||
if (flag5)
|
||||
{
|
||||
num11--;
|
||||
}
|
||||
else
|
||||
{
|
||||
num11++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
IL_4BD:
|
||||
IL_7DB:
|
||||
goto IL_FF3;
|
||||
IL_8EE:
|
||||
this.repeat = new Interpreter.RepeatContext(this.repeat, this.ReadProgramCount(pc + 2), this.ReadProgramCount(pc + 4), (ushort)(opFlags & OpFlags.Lazy) != 0, pc + 6);
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc + (int)this.program[pc + 1]))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
goto IL_941;
|
||||
IL_957:
|
||||
repeatContext = this.repeat;
|
||||
if (this.deep == repeatContext)
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
start = repeatContext.Start;
|
||||
count = repeatContext.Count;
|
||||
while (!repeatContext.IsMinimum)
|
||||
{
|
||||
repeatContext.Count++;
|
||||
repeatContext.Start = num;
|
||||
this.deep = repeatContext;
|
||||
if (!this.Eval(Interpreter.Mode.Match, ref num, repeatContext.Expression))
|
||||
{
|
||||
goto Block_73;
|
||||
}
|
||||
if (this.deep != repeatContext)
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
}
|
||||
if (num == repeatContext.Start)
|
||||
{
|
||||
this.repeat = repeatContext.Previous;
|
||||
this.deep = null;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc + 1))
|
||||
{
|
||||
goto IL_FF3;
|
||||
}
|
||||
goto IL_A28;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (repeatContext.IsLazy)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
this.repeat = repeatContext.Previous;
|
||||
this.deep = null;
|
||||
int num14 = this.Checkpoint();
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc + 1))
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.Backtrack(num14);
|
||||
this.repeat = repeatContext;
|
||||
if (repeatContext.IsMaximum)
|
||||
{
|
||||
goto Block_80;
|
||||
}
|
||||
repeatContext.Count++;
|
||||
repeatContext.Start = num;
|
||||
this.deep = repeatContext;
|
||||
if (!this.Eval(Interpreter.Mode.Match, ref num, repeatContext.Expression))
|
||||
{
|
||||
goto Block_81;
|
||||
}
|
||||
if (this.deep != repeatContext)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (num == repeatContext.Start)
|
||||
{
|
||||
goto Block_83;
|
||||
}
|
||||
}
|
||||
goto IL_FF3;
|
||||
}
|
||||
int count2 = this.stack.Count;
|
||||
while (!repeatContext.IsMaximum)
|
||||
{
|
||||
int num15 = this.Checkpoint();
|
||||
int num16 = num;
|
||||
int start2 = repeatContext.Start;
|
||||
repeatContext.Count++;
|
||||
repeatContext.Start = num;
|
||||
this.deep = repeatContext;
|
||||
if (!this.Eval(Interpreter.Mode.Match, ref num, repeatContext.Expression))
|
||||
{
|
||||
repeatContext.Count--;
|
||||
repeatContext.Start = start2;
|
||||
this.Backtrack(num15);
|
||||
break;
|
||||
}
|
||||
if (this.deep != repeatContext)
|
||||
{
|
||||
this.stack.Count = count2;
|
||||
goto IL_FF3;
|
||||
}
|
||||
this.stack.Push(num15);
|
||||
this.stack.Push(num16);
|
||||
if (num == repeatContext.Start)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.repeat = repeatContext.Previous;
|
||||
for (;;)
|
||||
{
|
||||
this.deep = null;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc + 1))
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (this.stack.Count == count2)
|
||||
{
|
||||
goto Block_88;
|
||||
}
|
||||
repeatContext.Count--;
|
||||
num = this.stack.Pop();
|
||||
this.Backtrack(this.stack.Pop());
|
||||
}
|
||||
this.stack.Count = count2;
|
||||
goto IL_FF3;
|
||||
}
|
||||
IL_C6F:
|
||||
this.fast = new Interpreter.RepeatContext(this.fast, this.ReadProgramCount(pc + 2), this.ReadProgramCount(pc + 4), (ushort)(opFlags & OpFlags.Lazy) != 0, pc + 6);
|
||||
this.fast.Start = num;
|
||||
int num17 = this.Checkpoint();
|
||||
pc += (int)this.program[pc + 1];
|
||||
ushort num18 = this.program[pc];
|
||||
int num19 = -1;
|
||||
int num20 = -1;
|
||||
int num21 = 0;
|
||||
OpCode opCode3 = (OpCode)(num18 & 255);
|
||||
if (opCode3 == OpCode.Character || opCode3 == OpCode.String)
|
||||
{
|
||||
OpFlags opFlags2 = (OpFlags)(num18 & 65280);
|
||||
if ((ushort)(opFlags2 & OpFlags.Negate) == 0)
|
||||
{
|
||||
if (opCode3 == OpCode.String)
|
||||
{
|
||||
int num22 = 0;
|
||||
if ((ushort)(opFlags2 & OpFlags.RightToLeft) != 0)
|
||||
{
|
||||
num22 = (int)(this.program[pc + 1] - 1);
|
||||
}
|
||||
num19 = (int)this.program[pc + 2 + num22];
|
||||
}
|
||||
else
|
||||
{
|
||||
num19 = (int)this.program[pc + 1];
|
||||
}
|
||||
if ((ushort)(opFlags2 & OpFlags.IgnoreCase) != 0)
|
||||
{
|
||||
num20 = (int)char.ToUpper((char)num19);
|
||||
}
|
||||
else
|
||||
{
|
||||
num20 = num19;
|
||||
}
|
||||
if ((ushort)(opFlags2 & OpFlags.RightToLeft) != 0)
|
||||
{
|
||||
num21 = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
num21 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.fast.IsLazy)
|
||||
{
|
||||
if (!this.fast.IsMinimum && !this.Eval(Interpreter.Mode.Count, ref num, this.fast.Expression))
|
||||
{
|
||||
goto Block_97;
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
int num23 = num + num21;
|
||||
if (num19 < 0 || (num23 >= 0 && num23 < this.text_end && (num19 == (int)this.text[num23] || num20 == (int)this.text[num23])))
|
||||
{
|
||||
this.deep = null;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.fast.IsMaximum)
|
||||
{
|
||||
goto Block_103;
|
||||
}
|
||||
this.Backtrack(num17);
|
||||
if (!this.Eval(Interpreter.Mode.Count, ref num, this.fast.Expression))
|
||||
{
|
||||
goto Block_104;
|
||||
}
|
||||
}
|
||||
this.fast = this.fast.Previous;
|
||||
goto IL_FF3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!this.Eval(Interpreter.Mode.Count, ref num, this.fast.Expression))
|
||||
{
|
||||
goto Block_105;
|
||||
}
|
||||
int num24;
|
||||
if (this.fast.Count > 0)
|
||||
{
|
||||
num24 = (num - this.fast.Start) / this.fast.Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
num24 = 0;
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
int num25 = num + num21;
|
||||
if (num19 < 0 || (num25 >= 0 && num25 < this.text_end && (num19 == (int)this.text[num25] || num20 == (int)this.text[num25])))
|
||||
{
|
||||
this.deep = null;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.fast.Count--;
|
||||
if (!this.fast.IsMinimum)
|
||||
{
|
||||
goto Block_112;
|
||||
}
|
||||
num -= num24;
|
||||
this.Backtrack(num17);
|
||||
}
|
||||
this.fast = this.fast.Previous;
|
||||
goto IL_FF3;
|
||||
}
|
||||
}
|
||||
IL_4B8:
|
||||
Block_44:
|
||||
Block_46:
|
||||
Block_47:
|
||||
Block_49:
|
||||
Block_52:
|
||||
Block_54:
|
||||
Block_55:
|
||||
Block_57:
|
||||
Block_59:
|
||||
Block_61:
|
||||
Block_62:
|
||||
Block_63:
|
||||
Block_65:
|
||||
Block_67:
|
||||
Block_70:
|
||||
goto IL_1067;
|
||||
IL_941:
|
||||
this.repeat = this.repeat.Previous;
|
||||
goto IL_1067;
|
||||
Block_73:
|
||||
repeatContext.Start = start;
|
||||
repeatContext.Count = count;
|
||||
goto IL_1067;
|
||||
IL_A28:
|
||||
this.repeat = repeatContext;
|
||||
Block_80:
|
||||
goto IL_1067;
|
||||
Block_81:
|
||||
repeatContext.Start = start;
|
||||
repeatContext.Count = count;
|
||||
Block_83:
|
||||
goto IL_1067;
|
||||
Block_88:
|
||||
this.repeat = repeatContext;
|
||||
goto IL_1067;
|
||||
Block_97:
|
||||
this.fast = this.fast.Previous;
|
||||
goto IL_1067;
|
||||
Block_103:
|
||||
this.fast = this.fast.Previous;
|
||||
goto IL_1067;
|
||||
Block_104:
|
||||
this.fast = this.fast.Previous;
|
||||
goto IL_1067;
|
||||
Block_105:
|
||||
this.fast = this.fast.Previous;
|
||||
goto IL_1067;
|
||||
Block_112:
|
||||
this.fast = this.fast.Previous;
|
||||
IL_FE9:
|
||||
IL_1067:
|
||||
if (mode == Interpreter.Mode.Match)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (mode != Interpreter.Mode.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!this.fast.IsLazy && this.fast.IsMinimum)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
ref_ptr = this.fast.Start;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06001A1F RID: 6687 RVA: 0x0005E434 File Offset: 0x0005C634
|
||||
private bool EvalChar(Interpreter.Mode mode, ref int ptr, ref int pc, bool multi)
|
||||
{
|
||||
bool flag = false;
|
||||
char c = '\0';
|
||||
bool flag3;
|
||||
for (;;)
|
||||
{
|
||||
ushort num = this.program[pc];
|
||||
OpCode opCode = (OpCode)(num & 255);
|
||||
OpFlags opFlags = (OpFlags)(num & 65280);
|
||||
pc++;
|
||||
bool flag2 = (ushort)(opFlags & OpFlags.IgnoreCase) != 0;
|
||||
if (!flag)
|
||||
{
|
||||
if ((ushort)(opFlags & OpFlags.RightToLeft) != 0)
|
||||
{
|
||||
if (ptr <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
c = this.text[--ptr];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ptr >= this.text_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
c = this.text[ptr++];
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
c = char.ToLower(c);
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
flag3 = (ushort)(opFlags & OpFlags.Negate) != 0;
|
||||
switch (opCode)
|
||||
{
|
||||
case OpCode.False:
|
||||
return false;
|
||||
case OpCode.True:
|
||||
return true;
|
||||
case OpCode.Character:
|
||||
if (c == (char)this.program[pc++])
|
||||
{
|
||||
goto Block_7;
|
||||
}
|
||||
break;
|
||||
case OpCode.Category:
|
||||
if (CategoryUtils.IsCategory((Category)this.program[pc++], c))
|
||||
{
|
||||
goto Block_8;
|
||||
}
|
||||
break;
|
||||
case OpCode.NotCategory:
|
||||
if (!CategoryUtils.IsCategory((Category)this.program[pc++], c))
|
||||
{
|
||||
goto Block_9;
|
||||
}
|
||||
break;
|
||||
case OpCode.Range:
|
||||
{
|
||||
int num2 = (int)this.program[pc++];
|
||||
int num3 = (int)this.program[pc++];
|
||||
if (num2 <= (int)c && (int)c <= num3)
|
||||
{
|
||||
goto Block_11;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OpCode.Set:
|
||||
{
|
||||
int num4 = (int)this.program[pc++];
|
||||
int num5 = (int)this.program[pc++];
|
||||
int num6 = pc;
|
||||
pc += num5;
|
||||
int num7 = (int)c - num4;
|
||||
if (num7 >= 0 && num7 < num5 << 4)
|
||||
{
|
||||
if (((int)this.program[num6 + (num7 >> 4)] & (1 << (num7 & 15))) != 0)
|
||||
{
|
||||
goto Block_13;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!multi)
|
||||
{
|
||||
return flag3;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
Block_7:
|
||||
return !flag3;
|
||||
Block_8:
|
||||
return !flag3;
|
||||
Block_9:
|
||||
return !flag3;
|
||||
Block_11:
|
||||
return !flag3;
|
||||
Block_13:
|
||||
return !flag3;
|
||||
}
|
||||
|
||||
// Token: 0x06001A20 RID: 6688 RVA: 0x0005E66C File Offset: 0x0005C86C
|
||||
private bool TryMatch(ref int ref_ptr, int pc)
|
||||
{
|
||||
this.Reset();
|
||||
int num = ref_ptr;
|
||||
this.marks[this.groups[0]].Start = num;
|
||||
if (this.Eval(Interpreter.Mode.Match, ref num, pc))
|
||||
{
|
||||
this.marks[this.groups[0]].End = num;
|
||||
ref_ptr = num;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06001A21 RID: 6689 RVA: 0x0005E6CC File Offset: 0x0005C8CC
|
||||
private bool IsPosition(Position pos, int ptr)
|
||||
{
|
||||
switch (pos)
|
||||
{
|
||||
case Position.Start:
|
||||
case Position.StartOfString:
|
||||
return ptr == 0;
|
||||
case Position.StartOfLine:
|
||||
return ptr == 0 || this.text[ptr - 1] == '\n';
|
||||
case Position.StartOfScan:
|
||||
return ptr == this.scan_ptr;
|
||||
case Position.End:
|
||||
return ptr == this.text_end || (ptr == this.text_end - 1 && this.text[ptr] == '\n');
|
||||
case Position.EndOfString:
|
||||
return ptr == this.text_end;
|
||||
case Position.EndOfLine:
|
||||
return ptr == this.text_end || this.text[ptr] == '\n';
|
||||
case Position.Boundary:
|
||||
if (this.text_end == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ptr == 0)
|
||||
{
|
||||
return this.IsWordChar(this.text[ptr]);
|
||||
}
|
||||
if (ptr == this.text_end)
|
||||
{
|
||||
return this.IsWordChar(this.text[ptr - 1]);
|
||||
}
|
||||
return this.IsWordChar(this.text[ptr]) != this.IsWordChar(this.text[ptr - 1]);
|
||||
case Position.NonBoundary:
|
||||
if (this.text_end == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ptr == 0)
|
||||
{
|
||||
return !this.IsWordChar(this.text[ptr]);
|
||||
}
|
||||
if (ptr == this.text_end)
|
||||
{
|
||||
return !this.IsWordChar(this.text[ptr - 1]);
|
||||
}
|
||||
return this.IsWordChar(this.text[ptr]) == this.IsWordChar(this.text[ptr - 1]);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A22 RID: 6690 RVA: 0x0005E87C File Offset: 0x0005CA7C
|
||||
private bool IsWordChar(char c)
|
||||
{
|
||||
return CategoryUtils.IsCategory(Category.Word, c);
|
||||
}
|
||||
|
||||
// Token: 0x06001A23 RID: 6691 RVA: 0x0005E888 File Offset: 0x0005CA88
|
||||
private string GetString(int pc)
|
||||
{
|
||||
int num = (int)this.program[pc + 1];
|
||||
int num2 = pc + 2;
|
||||
char[] array = new char[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
array[i] = (char)this.program[num2++];
|
||||
}
|
||||
return new string(array);
|
||||
}
|
||||
|
||||
// Token: 0x06001A24 RID: 6692 RVA: 0x0005E8D4 File Offset: 0x0005CAD4
|
||||
private void Open(int gid, int ptr)
|
||||
{
|
||||
int num = this.groups[gid];
|
||||
if (num < this.mark_start || this.marks[num].IsDefined)
|
||||
{
|
||||
num = this.CreateMark(num);
|
||||
this.groups[gid] = num;
|
||||
}
|
||||
this.marks[num].Start = ptr;
|
||||
}
|
||||
|
||||
// Token: 0x06001A25 RID: 6693 RVA: 0x0005E930 File Offset: 0x0005CB30
|
||||
private void Close(int gid, int ptr)
|
||||
{
|
||||
this.marks[this.groups[gid]].End = ptr;
|
||||
}
|
||||
|
||||
// Token: 0x06001A26 RID: 6694 RVA: 0x0005E94C File Offset: 0x0005CB4C
|
||||
private bool Balance(int gid, int balance_gid, bool capture, int ptr)
|
||||
{
|
||||
int num = this.groups[balance_gid];
|
||||
if (num == -1 || this.marks[num].Index < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (gid > 0 && capture)
|
||||
{
|
||||
this.Open(gid, this.marks[num].Index + this.marks[num].Length);
|
||||
this.Close(gid, ptr);
|
||||
}
|
||||
this.groups[balance_gid] = this.marks[num].Previous;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06001A27 RID: 6695 RVA: 0x0005E9DC File Offset: 0x0005CBDC
|
||||
private int Checkpoint()
|
||||
{
|
||||
this.mark_start = this.mark_end;
|
||||
return this.mark_start;
|
||||
}
|
||||
|
||||
// Token: 0x06001A28 RID: 6696 RVA: 0x0005E9F0 File Offset: 0x0005CBF0
|
||||
private void Backtrack(int cp)
|
||||
{
|
||||
for (int i = 0; i < this.groups.Length; i++)
|
||||
{
|
||||
int num = this.groups[i];
|
||||
while (cp <= num)
|
||||
{
|
||||
num = this.marks[num].Previous;
|
||||
}
|
||||
this.groups[i] = num;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A29 RID: 6697 RVA: 0x0005EA48 File Offset: 0x0005CC48
|
||||
private void ResetGroups()
|
||||
{
|
||||
int num = this.groups.Length;
|
||||
if (this.marks == null)
|
||||
{
|
||||
this.marks = new Mark[num * 10];
|
||||
}
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
this.groups[i] = i;
|
||||
this.marks[i].Start = -1;
|
||||
this.marks[i].End = -1;
|
||||
this.marks[i].Previous = -1;
|
||||
}
|
||||
this.mark_start = 0;
|
||||
this.mark_end = num;
|
||||
}
|
||||
|
||||
// Token: 0x06001A2A RID: 6698 RVA: 0x0005EAD8 File Offset: 0x0005CCD8
|
||||
private int GetLastDefined(int gid)
|
||||
{
|
||||
int num = this.groups[gid];
|
||||
while (num >= 0 && !this.marks[num].IsDefined)
|
||||
{
|
||||
num = this.marks[num].Previous;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06001A2B RID: 6699 RVA: 0x0005EB24 File Offset: 0x0005CD24
|
||||
private int CreateMark(int previous)
|
||||
{
|
||||
if (this.mark_end == this.marks.Length)
|
||||
{
|
||||
Mark[] array = new Mark[this.marks.Length * 2];
|
||||
this.marks.CopyTo(array, 0);
|
||||
this.marks = array;
|
||||
}
|
||||
int num = this.mark_end++;
|
||||
this.marks[num].Start = (this.marks[num].End = -1);
|
||||
this.marks[num].Previous = previous;
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06001A2C RID: 6700 RVA: 0x0005EBB4 File Offset: 0x0005CDB4
|
||||
private void GetGroupInfo(int gid, out int first_mark_index, out int n_caps)
|
||||
{
|
||||
first_mark_index = -1;
|
||||
n_caps = 0;
|
||||
for (int i = this.groups[gid]; i >= 0; i = this.marks[i].Previous)
|
||||
{
|
||||
if (this.marks[i].IsDefined)
|
||||
{
|
||||
if (first_mark_index < 0)
|
||||
{
|
||||
first_mark_index = i;
|
||||
}
|
||||
n_caps++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A2D RID: 6701 RVA: 0x0005EC1C File Offset: 0x0005CE1C
|
||||
private void PopulateGroup(Group g, int first_mark_index, int n_caps)
|
||||
{
|
||||
int num = 1;
|
||||
for (int i = this.marks[first_mark_index].Previous; i >= 0; i = this.marks[i].Previous)
|
||||
{
|
||||
if (this.marks[i].IsDefined)
|
||||
{
|
||||
Capture capture = new Capture(this.text, this.marks[i].Index, this.marks[i].Length);
|
||||
g.Captures.SetValue(capture, n_caps - 1 - num);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A2E RID: 6702 RVA: 0x0005ECBC File Offset: 0x0005CEBC
|
||||
private Match GenerateMatch(Regex regex)
|
||||
{
|
||||
int num;
|
||||
int num2;
|
||||
this.GetGroupInfo(0, out num, out num2);
|
||||
if (!this.needs_groups_or_captures)
|
||||
{
|
||||
return new Match(regex, this, this.text, this.text_end, 0, this.marks[num].Index, this.marks[num].Length);
|
||||
}
|
||||
Match match = new Match(regex, this, this.text, this.text_end, this.groups.Length, this.marks[num].Index, this.marks[num].Length, num2);
|
||||
this.PopulateGroup(match, num, num2);
|
||||
for (int i = 1; i < this.groups.Length; i++)
|
||||
{
|
||||
this.GetGroupInfo(i, out num, out num2);
|
||||
Group group;
|
||||
if (num < 0)
|
||||
{
|
||||
group = Group.Fail;
|
||||
}
|
||||
else
|
||||
{
|
||||
group = new Group(this.text, this.marks[num].Index, this.marks[num].Length, num2);
|
||||
this.PopulateGroup(group, num, num2);
|
||||
}
|
||||
match.Groups.SetValue(group, i);
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
// Token: 0x0400157C RID: 5500
|
||||
private ushort[] program;
|
||||
|
||||
// Token: 0x0400157D RID: 5501
|
||||
private int program_start;
|
||||
|
||||
// Token: 0x0400157E RID: 5502
|
||||
private string text;
|
||||
|
||||
// Token: 0x0400157F RID: 5503
|
||||
private int text_end;
|
||||
|
||||
// Token: 0x04001580 RID: 5504
|
||||
private int group_count;
|
||||
|
||||
// Token: 0x04001581 RID: 5505
|
||||
private int match_min;
|
||||
|
||||
// Token: 0x04001582 RID: 5506
|
||||
private QuickSearch qs;
|
||||
|
||||
// Token: 0x04001583 RID: 5507
|
||||
private int scan_ptr;
|
||||
|
||||
// Token: 0x04001584 RID: 5508
|
||||
private Interpreter.RepeatContext repeat;
|
||||
|
||||
// Token: 0x04001585 RID: 5509
|
||||
private Interpreter.RepeatContext fast;
|
||||
|
||||
// Token: 0x04001586 RID: 5510
|
||||
private Interpreter.IntStack stack = default(Interpreter.IntStack);
|
||||
|
||||
// Token: 0x04001587 RID: 5511
|
||||
private Interpreter.RepeatContext deep;
|
||||
|
||||
// Token: 0x04001588 RID: 5512
|
||||
private Mark[] marks;
|
||||
|
||||
// Token: 0x04001589 RID: 5513
|
||||
private int mark_start;
|
||||
|
||||
// Token: 0x0400158A RID: 5514
|
||||
private int mark_end;
|
||||
|
||||
// Token: 0x0400158B RID: 5515
|
||||
private int[] groups;
|
||||
|
||||
// Token: 0x020002CF RID: 719
|
||||
private struct IntStack
|
||||
{
|
||||
// Token: 0x06001A2F RID: 6703 RVA: 0x0005EDE0 File Offset: 0x0005CFE0
|
||||
public int Pop()
|
||||
{
|
||||
return this.values[--this.count];
|
||||
}
|
||||
|
||||
// Token: 0x06001A30 RID: 6704 RVA: 0x0005EE08 File Offset: 0x0005D008
|
||||
public void Push(int value)
|
||||
{
|
||||
if (this.values == null)
|
||||
{
|
||||
this.values = new int[8];
|
||||
}
|
||||
else if (this.count == this.values.Length)
|
||||
{
|
||||
int num = this.values.Length;
|
||||
num += num >> 1;
|
||||
int[] array = new int[num];
|
||||
for (int i = 0; i < this.count; i++)
|
||||
{
|
||||
array[i] = this.values[i];
|
||||
}
|
||||
this.values = array;
|
||||
}
|
||||
this.values[this.count++] = value;
|
||||
}
|
||||
|
||||
// Token: 0x1700080B RID: 2059
|
||||
// (get) Token: 0x06001A31 RID: 6705 RVA: 0x0005EE9C File Offset: 0x0005D09C
|
||||
public int Top
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.values[this.count - 1];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700080C RID: 2060
|
||||
// (get) Token: 0x06001A32 RID: 6706 RVA: 0x0005EEB0 File Offset: 0x0005D0B0
|
||||
// (set) Token: 0x06001A33 RID: 6707 RVA: 0x0005EEB8 File Offset: 0x0005D0B8
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.count;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > this.count)
|
||||
{
|
||||
throw new SystemException("can only truncate the stack");
|
||||
}
|
||||
this.count = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400158C RID: 5516
|
||||
private int[] values;
|
||||
|
||||
// Token: 0x0400158D RID: 5517
|
||||
private int count;
|
||||
}
|
||||
|
||||
// Token: 0x020002D0 RID: 720
|
||||
private class RepeatContext
|
||||
{
|
||||
// Token: 0x06001A34 RID: 6708 RVA: 0x0005EED8 File Offset: 0x0005D0D8
|
||||
public RepeatContext(Interpreter.RepeatContext previous, int min, int max, bool lazy, int expr_pc)
|
||||
{
|
||||
this.previous = previous;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.lazy = lazy;
|
||||
this.expr_pc = expr_pc;
|
||||
this.start = -1;
|
||||
this.count = 0;
|
||||
}
|
||||
|
||||
// Token: 0x1700080D RID: 2061
|
||||
// (get) Token: 0x06001A35 RID: 6709 RVA: 0x0005EF14 File Offset: 0x0005D114
|
||||
// (set) Token: 0x06001A36 RID: 6710 RVA: 0x0005EF1C File Offset: 0x0005D11C
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.count;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.count = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700080E RID: 2062
|
||||
// (get) Token: 0x06001A37 RID: 6711 RVA: 0x0005EF28 File Offset: 0x0005D128
|
||||
// (set) Token: 0x06001A38 RID: 6712 RVA: 0x0005EF30 File Offset: 0x0005D130
|
||||
public int Start
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.start;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.start = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700080F RID: 2063
|
||||
// (get) Token: 0x06001A39 RID: 6713 RVA: 0x0005EF3C File Offset: 0x0005D13C
|
||||
public bool IsMinimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.min <= this.count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000810 RID: 2064
|
||||
// (get) Token: 0x06001A3A RID: 6714 RVA: 0x0005EF50 File Offset: 0x0005D150
|
||||
public bool IsMaximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.max <= this.count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000811 RID: 2065
|
||||
// (get) Token: 0x06001A3B RID: 6715 RVA: 0x0005EF64 File Offset: 0x0005D164
|
||||
public bool IsLazy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lazy;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000812 RID: 2066
|
||||
// (get) Token: 0x06001A3C RID: 6716 RVA: 0x0005EF6C File Offset: 0x0005D16C
|
||||
public int Expression
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.expr_pc;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000813 RID: 2067
|
||||
// (get) Token: 0x06001A3D RID: 6717 RVA: 0x0005EF74 File Offset: 0x0005D174
|
||||
public Interpreter.RepeatContext Previous
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.previous;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0400158E RID: 5518
|
||||
private int start;
|
||||
|
||||
// Token: 0x0400158F RID: 5519
|
||||
private int min;
|
||||
|
||||
// Token: 0x04001590 RID: 5520
|
||||
private int max;
|
||||
|
||||
// Token: 0x04001591 RID: 5521
|
||||
private bool lazy;
|
||||
|
||||
// Token: 0x04001592 RID: 5522
|
||||
private int expr_pc;
|
||||
|
||||
// Token: 0x04001593 RID: 5523
|
||||
private Interpreter.RepeatContext previous;
|
||||
|
||||
// Token: 0x04001594 RID: 5524
|
||||
private int count;
|
||||
}
|
||||
|
||||
// Token: 0x020002D1 RID: 721
|
||||
private enum Mode
|
||||
{
|
||||
// Token: 0x04001596 RID: 5526
|
||||
Search,
|
||||
// Token: 0x04001597 RID: 5527
|
||||
Match,
|
||||
// Token: 0x04001598 RID: 5528
|
||||
Count
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C7 RID: 711
|
||||
internal class InterpreterFactory : IMachineFactory
|
||||
{
|
||||
// Token: 0x060019D0 RID: 6608 RVA: 0x0005C4CC File Offset: 0x0005A6CC
|
||||
public InterpreterFactory(ushort[] pattern)
|
||||
{
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
// Token: 0x060019D1 RID: 6609 RVA: 0x0005C4DC File Offset: 0x0005A6DC
|
||||
public IMachine NewInstance()
|
||||
{
|
||||
return new Interpreter(this.pattern);
|
||||
}
|
||||
|
||||
// Token: 0x17000801 RID: 2049
|
||||
// (get) Token: 0x060019D2 RID: 6610 RVA: 0x0005C4EC File Offset: 0x0005A6EC
|
||||
public int GroupCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this.pattern[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000802 RID: 2050
|
||||
// (get) Token: 0x060019D3 RID: 6611 RVA: 0x0005C4F8 File Offset: 0x0005A6F8
|
||||
// (set) Token: 0x060019D4 RID: 6612 RVA: 0x0005C500 File Offset: 0x0005A700
|
||||
public int Gap
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.gap;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.gap = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000803 RID: 2051
|
||||
// (get) Token: 0x060019D5 RID: 6613 RVA: 0x0005C50C File Offset: 0x0005A70C
|
||||
// (set) Token: 0x060019D6 RID: 6614 RVA: 0x0005C514 File Offset: 0x0005A714
|
||||
public IDictionary Mapping
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mapping;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.mapping = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000804 RID: 2052
|
||||
// (get) Token: 0x060019D7 RID: 6615 RVA: 0x0005C520 File Offset: 0x0005A720
|
||||
// (set) Token: 0x060019D8 RID: 6616 RVA: 0x0005C528 File Offset: 0x0005A728
|
||||
public string[] NamesMapping
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.namesMapping;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.namesMapping = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001570 RID: 5488
|
||||
private IDictionary mapping;
|
||||
|
||||
// Token: 0x04001571 RID: 5489
|
||||
private ushort[] pattern;
|
||||
|
||||
// Token: 0x04001572 RID: 5490
|
||||
private string[] namesMapping;
|
||||
|
||||
// Token: 0x04001573 RID: 5491
|
||||
private int gap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002D2 RID: 722
|
||||
internal struct Interval : IComparable
|
||||
{
|
||||
// Token: 0x06001A3E RID: 6718 RVA: 0x0005EF7C File Offset: 0x0005D17C
|
||||
public Interval(int low, int high)
|
||||
{
|
||||
if (low > high)
|
||||
{
|
||||
int num = low;
|
||||
low = high;
|
||||
high = num;
|
||||
}
|
||||
this.low = low;
|
||||
this.high = high;
|
||||
this.contiguous = true;
|
||||
}
|
||||
|
||||
// Token: 0x17000814 RID: 2068
|
||||
// (get) Token: 0x06001A3F RID: 6719 RVA: 0x0005EFB0 File Offset: 0x0005D1B0
|
||||
public static Interval Empty
|
||||
{
|
||||
get
|
||||
{
|
||||
Interval interval;
|
||||
interval.low = 0;
|
||||
interval.high = interval.low - 1;
|
||||
interval.contiguous = true;
|
||||
return interval;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000815 RID: 2069
|
||||
// (get) Token: 0x06001A40 RID: 6720 RVA: 0x0005EFE0 File Offset: 0x0005D1E0
|
||||
public static Interval Entire
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Interval(int.MinValue, int.MaxValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000816 RID: 2070
|
||||
// (get) Token: 0x06001A41 RID: 6721 RVA: 0x0005EFF4 File Offset: 0x0005D1F4
|
||||
public bool IsDiscontiguous
|
||||
{
|
||||
get
|
||||
{
|
||||
return !this.contiguous;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000817 RID: 2071
|
||||
// (get) Token: 0x06001A42 RID: 6722 RVA: 0x0005F000 File Offset: 0x0005D200
|
||||
public bool IsSingleton
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.contiguous && this.low == this.high;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000818 RID: 2072
|
||||
// (get) Token: 0x06001A43 RID: 6723 RVA: 0x0005F020 File Offset: 0x0005D220
|
||||
public bool IsRange
|
||||
{
|
||||
get
|
||||
{
|
||||
return !this.IsSingleton && !this.IsEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000819 RID: 2073
|
||||
// (get) Token: 0x06001A44 RID: 6724 RVA: 0x0005F03C File Offset: 0x0005D23C
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.low > this.high;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700081A RID: 2074
|
||||
// (get) Token: 0x06001A45 RID: 6725 RVA: 0x0005F04C File Offset: 0x0005D24C
|
||||
public int Size
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.IsEmpty)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return this.high - this.low + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A46 RID: 6726 RVA: 0x0005F06C File Offset: 0x0005D26C
|
||||
public bool IsDisjoint(Interval i)
|
||||
{
|
||||
return this.IsEmpty || i.IsEmpty || (this.low > i.high || i.low > this.high);
|
||||
}
|
||||
|
||||
// Token: 0x06001A47 RID: 6727 RVA: 0x0005F0BC File Offset: 0x0005D2BC
|
||||
public bool IsAdjacent(Interval i)
|
||||
{
|
||||
return !this.IsEmpty && !i.IsEmpty && (this.low == i.high + 1 || this.high == i.low - 1);
|
||||
}
|
||||
|
||||
// Token: 0x06001A48 RID: 6728 RVA: 0x0005F10C File Offset: 0x0005D30C
|
||||
public bool Contains(Interval i)
|
||||
{
|
||||
return (!this.IsEmpty && i.IsEmpty) || (!this.IsEmpty && this.low <= i.low && i.high <= this.high);
|
||||
}
|
||||
|
||||
// Token: 0x06001A49 RID: 6729 RVA: 0x0005F168 File Offset: 0x0005D368
|
||||
public bool Contains(int i)
|
||||
{
|
||||
return this.low <= i && i <= this.high;
|
||||
}
|
||||
|
||||
// Token: 0x06001A4A RID: 6730 RVA: 0x0005F188 File Offset: 0x0005D388
|
||||
public bool Intersects(Interval i)
|
||||
{
|
||||
return !this.IsEmpty && !i.IsEmpty && ((this.Contains(i.low) && !this.Contains(i.high)) || (this.Contains(i.high) && !this.Contains(i.low)));
|
||||
}
|
||||
|
||||
// Token: 0x06001A4B RID: 6731 RVA: 0x0005F1FC File Offset: 0x0005D3FC
|
||||
public void Merge(Interval i)
|
||||
{
|
||||
if (i.IsEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.IsEmpty)
|
||||
{
|
||||
this.low = i.low;
|
||||
this.high = i.high;
|
||||
}
|
||||
if (i.low < this.low)
|
||||
{
|
||||
this.low = i.low;
|
||||
}
|
||||
if (i.high > this.high)
|
||||
{
|
||||
this.high = i.high;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A4C RID: 6732 RVA: 0x0005F27C File Offset: 0x0005D47C
|
||||
public void Intersect(Interval i)
|
||||
{
|
||||
if (this.IsDisjoint(i))
|
||||
{
|
||||
this.low = 0;
|
||||
this.high = this.low - 1;
|
||||
return;
|
||||
}
|
||||
if (i.low > this.low)
|
||||
{
|
||||
this.low = i.low;
|
||||
}
|
||||
if (i.high > this.high)
|
||||
{
|
||||
this.high = i.high;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A4D RID: 6733 RVA: 0x0005F2EC File Offset: 0x0005D4EC
|
||||
public int CompareTo(object o)
|
||||
{
|
||||
return this.low - ((Interval)o).low;
|
||||
}
|
||||
|
||||
// Token: 0x06001A4E RID: 6734 RVA: 0x0005F310 File Offset: 0x0005D510
|
||||
public new string ToString()
|
||||
{
|
||||
if (this.IsEmpty)
|
||||
{
|
||||
return "(EMPTY)";
|
||||
}
|
||||
if (!this.contiguous)
|
||||
{
|
||||
return string.Concat(new object[] { "{", this.low, ", ", this.high, "}" });
|
||||
}
|
||||
if (this.IsSingleton)
|
||||
{
|
||||
return "(" + this.low + ")";
|
||||
}
|
||||
return string.Concat(new object[] { "(", this.low, ", ", this.high, ")" });
|
||||
}
|
||||
|
||||
// Token: 0x04001599 RID: 5529
|
||||
public int low;
|
||||
|
||||
// Token: 0x0400159A RID: 5530
|
||||
public int high;
|
||||
|
||||
// Token: 0x0400159B RID: 5531
|
||||
public bool contiguous;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002D3 RID: 723
|
||||
internal class IntervalCollection : ICollection, IEnumerable
|
||||
{
|
||||
// Token: 0x06001A4F RID: 6735 RVA: 0x0005F3E0 File Offset: 0x0005D5E0
|
||||
public IntervalCollection()
|
||||
{
|
||||
this.intervals = new ArrayList();
|
||||
}
|
||||
|
||||
// Token: 0x1700081B RID: 2075
|
||||
public Interval this[int i]
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Interval)this.intervals[i];
|
||||
}
|
||||
set
|
||||
{
|
||||
this.intervals[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A52 RID: 6738 RVA: 0x0005F41C File Offset: 0x0005D61C
|
||||
public void Add(Interval i)
|
||||
{
|
||||
this.intervals.Add(i);
|
||||
}
|
||||
|
||||
// Token: 0x06001A53 RID: 6739 RVA: 0x0005F430 File Offset: 0x0005D630
|
||||
public void Clear()
|
||||
{
|
||||
this.intervals.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x06001A54 RID: 6740 RVA: 0x0005F440 File Offset: 0x0005D640
|
||||
public void Sort()
|
||||
{
|
||||
this.intervals.Sort();
|
||||
}
|
||||
|
||||
// Token: 0x06001A55 RID: 6741 RVA: 0x0005F450 File Offset: 0x0005D650
|
||||
public void Normalize()
|
||||
{
|
||||
this.intervals.Sort();
|
||||
int i = 0;
|
||||
while (i < this.intervals.Count - 1)
|
||||
{
|
||||
Interval interval = (Interval)this.intervals[i];
|
||||
Interval interval2 = (Interval)this.intervals[i + 1];
|
||||
if (!interval.IsDisjoint(interval2) || interval.IsAdjacent(interval2))
|
||||
{
|
||||
interval.Merge(interval2);
|
||||
this.intervals[i] = interval;
|
||||
this.intervals.RemoveAt(i + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A56 RID: 6742 RVA: 0x0005F4F4 File Offset: 0x0005D6F4
|
||||
public IntervalCollection GetMetaCollection(IntervalCollection.CostDelegate cost_del)
|
||||
{
|
||||
IntervalCollection intervalCollection = new IntervalCollection();
|
||||
this.Normalize();
|
||||
this.Optimize(0, this.Count - 1, intervalCollection, cost_del);
|
||||
intervalCollection.intervals.Sort();
|
||||
return intervalCollection;
|
||||
}
|
||||
|
||||
// Token: 0x06001A57 RID: 6743 RVA: 0x0005F52C File Offset: 0x0005D72C
|
||||
private void Optimize(int begin, int end, IntervalCollection meta, IntervalCollection.CostDelegate cost_del)
|
||||
{
|
||||
Interval interval;
|
||||
interval.contiguous = false;
|
||||
int num = -1;
|
||||
int num2 = -1;
|
||||
double num3 = 0.0;
|
||||
for (int i = begin; i <= end; i++)
|
||||
{
|
||||
interval.low = this[i].low;
|
||||
double num4 = 0.0;
|
||||
for (int j = i; j <= end; j++)
|
||||
{
|
||||
interval.high = this[j].high;
|
||||
num4 += cost_del(this[j]);
|
||||
double num5 = cost_del(interval);
|
||||
if (num5 < num4 && num4 > num3)
|
||||
{
|
||||
num = i;
|
||||
num2 = j;
|
||||
num3 = num4;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num < 0)
|
||||
{
|
||||
for (int k = begin; k <= end; k++)
|
||||
{
|
||||
meta.Add(this[k]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
interval.low = this[num].low;
|
||||
interval.high = this[num2].high;
|
||||
meta.Add(interval);
|
||||
if (num > begin)
|
||||
{
|
||||
this.Optimize(begin, num - 1, meta, cost_del);
|
||||
}
|
||||
if (num2 < end)
|
||||
{
|
||||
this.Optimize(num2 + 1, end, meta, cost_del);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700081C RID: 2076
|
||||
// (get) Token: 0x06001A58 RID: 6744 RVA: 0x0005F67C File Offset: 0x0005D87C
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.intervals.Count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700081D RID: 2077
|
||||
// (get) Token: 0x06001A59 RID: 6745 RVA: 0x0005F68C File Offset: 0x0005D88C
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700081E RID: 2078
|
||||
// (get) Token: 0x06001A5A RID: 6746 RVA: 0x0005F690 File Offset: 0x0005D890
|
||||
public object SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.intervals;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A5B RID: 6747 RVA: 0x0005F698 File Offset: 0x0005D898
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
foreach (object obj in this.intervals)
|
||||
{
|
||||
Interval interval = (Interval)obj;
|
||||
if (index > array.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
array.SetValue(interval, index++);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A5C RID: 6748 RVA: 0x0005F724 File Offset: 0x0005D924
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return new IntervalCollection.Enumerator(this.intervals);
|
||||
}
|
||||
|
||||
// Token: 0x0400159C RID: 5532
|
||||
private ArrayList intervals;
|
||||
|
||||
// Token: 0x020002D4 RID: 724
|
||||
private class Enumerator : IEnumerator
|
||||
{
|
||||
// Token: 0x06001A5D RID: 6749 RVA: 0x0005F734 File Offset: 0x0005D934
|
||||
public Enumerator(IList list)
|
||||
{
|
||||
this.list = list;
|
||||
this.Reset();
|
||||
}
|
||||
|
||||
// Token: 0x1700081F RID: 2079
|
||||
// (get) Token: 0x06001A5E RID: 6750 RVA: 0x0005F74C File Offset: 0x0005D94C
|
||||
public object Current
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ptr >= this.list.Count)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
return this.list[this.ptr];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A5F RID: 6751 RVA: 0x0005F77C File Offset: 0x0005D97C
|
||||
public bool MoveNext()
|
||||
{
|
||||
if (this.ptr > this.list.Count)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
return ++this.ptr < this.list.Count;
|
||||
}
|
||||
|
||||
// Token: 0x06001A60 RID: 6752 RVA: 0x0005F7C4 File Offset: 0x0005D9C4
|
||||
public void Reset()
|
||||
{
|
||||
this.ptr = -1;
|
||||
}
|
||||
|
||||
// Token: 0x0400159D RID: 5533
|
||||
private IList list;
|
||||
|
||||
// Token: 0x0400159E RID: 5534
|
||||
private int ptr;
|
||||
}
|
||||
|
||||
// Token: 0x0200031A RID: 794
|
||||
// (Invoke) Token: 0x06001C41 RID: 7233
|
||||
public delegate double CostDelegate(Interval i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C5 RID: 709
|
||||
internal abstract class LinkRef
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002CB RID: 715
|
||||
internal abstract class LinkStack : LinkRef
|
||||
{
|
||||
// Token: 0x06001A0A RID: 6666 RVA: 0x0005CB78 File Offset: 0x0005AD78
|
||||
public LinkStack()
|
||||
{
|
||||
this.stack = new Stack();
|
||||
}
|
||||
|
||||
// Token: 0x06001A0B RID: 6667 RVA: 0x0005CB8C File Offset: 0x0005AD8C
|
||||
public void Push()
|
||||
{
|
||||
this.stack.Push(this.GetCurrent());
|
||||
}
|
||||
|
||||
// Token: 0x06001A0C RID: 6668 RVA: 0x0005CBA0 File Offset: 0x0005ADA0
|
||||
public bool Pop()
|
||||
{
|
||||
if (this.stack.Count > 0)
|
||||
{
|
||||
this.SetCurrent(this.stack.Pop());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06001A0D RID: 6669
|
||||
protected abstract object GetCurrent();
|
||||
|
||||
// Token: 0x06001A0E RID: 6670
|
||||
protected abstract void SetCurrent(object l);
|
||||
|
||||
// Token: 0x04001578 RID: 5496
|
||||
private Stack stack;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C1 RID: 705
|
||||
internal class MRUList
|
||||
{
|
||||
// Token: 0x060019A8 RID: 6568 RVA: 0x0005B440 File Offset: 0x00059640
|
||||
public MRUList()
|
||||
{
|
||||
this.head = (this.tail = null);
|
||||
}
|
||||
|
||||
// Token: 0x060019A9 RID: 6569 RVA: 0x0005B464 File Offset: 0x00059664
|
||||
public void Use(object o)
|
||||
{
|
||||
MRUList.Node node;
|
||||
if (this.head == null)
|
||||
{
|
||||
node = new MRUList.Node(o);
|
||||
this.head = (this.tail = node);
|
||||
return;
|
||||
}
|
||||
node = this.head;
|
||||
while (node != null && !o.Equals(node.value))
|
||||
{
|
||||
node = node.previous;
|
||||
}
|
||||
if (node == null)
|
||||
{
|
||||
node = new MRUList.Node(o);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (node == this.head)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (node == this.tail)
|
||||
{
|
||||
this.tail = node.next;
|
||||
}
|
||||
else
|
||||
{
|
||||
node.previous.next = node.next;
|
||||
}
|
||||
node.next.previous = node.previous;
|
||||
}
|
||||
this.head.next = node;
|
||||
node.previous = this.head;
|
||||
node.next = null;
|
||||
this.head = node;
|
||||
}
|
||||
|
||||
// Token: 0x060019AA RID: 6570 RVA: 0x0005B544 File Offset: 0x00059744
|
||||
public object Evict()
|
||||
{
|
||||
if (this.tail == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
object value = this.tail.value;
|
||||
this.tail = this.tail.next;
|
||||
if (this.tail == null)
|
||||
{
|
||||
this.head = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.tail.previous = null;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// Token: 0x040014D9 RID: 5337
|
||||
private MRUList.Node head;
|
||||
|
||||
// Token: 0x040014DA RID: 5338
|
||||
private MRUList.Node tail;
|
||||
|
||||
// Token: 0x020002C2 RID: 706
|
||||
private class Node
|
||||
{
|
||||
// Token: 0x060019AB RID: 6571 RVA: 0x0005B5A0 File Offset: 0x000597A0
|
||||
public Node(object value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// Token: 0x040014DB RID: 5339
|
||||
public object value;
|
||||
|
||||
// Token: 0x040014DC RID: 5340
|
||||
public MRUList.Node previous;
|
||||
|
||||
// Token: 0x040014DD RID: 5341
|
||||
public MRUList.Node next;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002CC RID: 716
|
||||
internal struct Mark
|
||||
{
|
||||
// Token: 0x17000808 RID: 2056
|
||||
// (get) Token: 0x06001A0F RID: 6671 RVA: 0x0005CBC8 File Offset: 0x0005ADC8
|
||||
public bool IsDefined
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Start >= 0 && this.End >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000809 RID: 2057
|
||||
// (get) Token: 0x06001A10 RID: 6672 RVA: 0x0005CBE8 File Offset: 0x0005ADE8
|
||||
public int Index
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.Start >= this.End) ? this.End : this.Start;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700080A RID: 2058
|
||||
// (get) Token: 0x06001A11 RID: 6673 RVA: 0x0005CC18 File Offset: 0x0005AE18
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.Start >= this.End) ? (this.Start - this.End) : (this.End - this.Start);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001579 RID: 5497
|
||||
public int Start;
|
||||
|
||||
// Token: 0x0400157A RID: 5498
|
||||
public int End;
|
||||
|
||||
// Token: 0x0400157B RID: 5499
|
||||
public int Previous;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents the results from a single regular expression match.</summary>
|
||||
// Token: 0x020002AF RID: 687
|
||||
[Serializable]
|
||||
public class Match : Group
|
||||
{
|
||||
// Token: 0x0600190F RID: 6415 RVA: 0x00055C30 File Offset: 0x00053E30
|
||||
private Match()
|
||||
{
|
||||
this.regex = null;
|
||||
this.machine = null;
|
||||
this.text_length = 0;
|
||||
this.groups = new GroupCollection(1, 1);
|
||||
this.groups.SetValue(this, 0);
|
||||
}
|
||||
|
||||
// Token: 0x06001910 RID: 6416 RVA: 0x00055C68 File Offset: 0x00053E68
|
||||
internal Match(Regex regex, IMachine machine, string text, int text_length, int n_groups, int index, int length)
|
||||
: base(text, index, length)
|
||||
{
|
||||
this.regex = regex;
|
||||
this.machine = machine;
|
||||
this.text_length = text_length;
|
||||
}
|
||||
|
||||
// Token: 0x06001911 RID: 6417 RVA: 0x00055C8C File Offset: 0x00053E8C
|
||||
internal Match(Regex regex, IMachine machine, string text, int text_length, int n_groups, int index, int length, int n_caps)
|
||||
: base(text, index, length, n_caps)
|
||||
{
|
||||
this.regex = regex;
|
||||
this.machine = machine;
|
||||
this.text_length = text_length;
|
||||
this.groups = new GroupCollection(n_groups, regex.Gap);
|
||||
this.groups.SetValue(this, 0);
|
||||
}
|
||||
|
||||
/// <summary>Gets the empty group. All failed matches return this empty match.</summary>
|
||||
/// <returns>An empty <see cref="T:System.Text.RegularExpressions.Match" />.</returns>
|
||||
// Token: 0x170007DE RID: 2014
|
||||
// (get) Token: 0x06001913 RID: 6419 RVA: 0x00055CE8 File Offset: 0x00053EE8
|
||||
public static Match Empty
|
||||
{
|
||||
get
|
||||
{
|
||||
return Match.empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a <see cref="T:System.Text.RegularExpressions.Match" /> instance equivalent to the one supplied that is suitable to share between multiple threads.</summary>
|
||||
/// <returns>A match that is suitable to share between multiple threads.</returns>
|
||||
/// <param name="inner">A match equivalent to the one expected.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="inner" /> is null.</exception>
|
||||
// Token: 0x06001914 RID: 6420 RVA: 0x00055CF0 File Offset: 0x00053EF0
|
||||
[global::System.MonoTODO("not thread-safe")]
|
||||
public static Match Synchronized(Match inner)
|
||||
{
|
||||
if (inner == null)
|
||||
{
|
||||
throw new ArgumentNullException("inner");
|
||||
}
|
||||
return inner;
|
||||
}
|
||||
|
||||
/// <summary>Gets a collection of groups matched by the regular expression.</summary>
|
||||
/// <returns>The character groups matched by the pattern.</returns>
|
||||
// Token: 0x170007DF RID: 2015
|
||||
// (get) Token: 0x06001915 RID: 6421 RVA: 0x00055D04 File Offset: 0x00053F04
|
||||
public virtual GroupCollection Groups
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.groups;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns a new <see cref="T:System.Text.RegularExpressions.Match" /> object with the results for the next match, starting at the position at which the last match ended (at the character after the last matched character).</summary>
|
||||
/// <returns>The next regular expression match.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001916 RID: 6422 RVA: 0x00055D0C File Offset: 0x00053F0C
|
||||
public Match NextMatch()
|
||||
{
|
||||
if (this == Match.Empty)
|
||||
{
|
||||
return Match.Empty;
|
||||
}
|
||||
int num = ((!this.regex.RightToLeft) ? (base.Index + base.Length) : base.Index);
|
||||
if (base.Length == 0)
|
||||
{
|
||||
num += ((!this.regex.RightToLeft) ? 1 : (-1));
|
||||
}
|
||||
return this.machine.Scan(this.regex, base.Text, num, this.text_length);
|
||||
}
|
||||
|
||||
/// <summary>Returns the expansion of the specified replacement pattern. </summary>
|
||||
/// <returns>The expanded version of the <paramref name="replacement" /> parameter.</returns>
|
||||
/// <param name="replacement">The replacement pattern to use. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="replacement" /> is null.</exception>
|
||||
/// <exception cref="T:System.NotSupportedException">Expansion is not allowed for this pattern.</exception>
|
||||
// Token: 0x06001917 RID: 6423 RVA: 0x00055D98 File Offset: 0x00053F98
|
||||
public virtual string Result(string replacement)
|
||||
{
|
||||
if (replacement == null)
|
||||
{
|
||||
throw new ArgumentNullException("replacement");
|
||||
}
|
||||
if (this.machine == null)
|
||||
{
|
||||
throw new NotSupportedException("Result cannot be called on failed Match.");
|
||||
}
|
||||
return this.machine.Result(replacement, this);
|
||||
}
|
||||
|
||||
// Token: 0x170007E0 RID: 2016
|
||||
// (get) Token: 0x06001918 RID: 6424 RVA: 0x00055DDC File Offset: 0x00053FDC
|
||||
internal Regex Regex
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.regex;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040013CB RID: 5067
|
||||
private Regex regex;
|
||||
|
||||
// Token: 0x040013CC RID: 5068
|
||||
private IMachine machine;
|
||||
|
||||
// Token: 0x040013CD RID: 5069
|
||||
private int text_length;
|
||||
|
||||
// Token: 0x040013CE RID: 5070
|
||||
private GroupCollection groups;
|
||||
|
||||
// Token: 0x040013CF RID: 5071
|
||||
private static Match empty = new Match();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string.</summary>
|
||||
// Token: 0x020002B0 RID: 688
|
||||
[Serializable]
|
||||
public class MatchCollection : ICollection, IEnumerable
|
||||
{
|
||||
// Token: 0x06001919 RID: 6425 RVA: 0x00055DE4 File Offset: 0x00053FE4
|
||||
internal MatchCollection(Match start)
|
||||
{
|
||||
this.current = start;
|
||||
this.list = new ArrayList();
|
||||
}
|
||||
|
||||
/// <summary>Gets the number of matches.</summary>
|
||||
/// <returns>The number of matches.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x170007E1 RID: 2017
|
||||
// (get) Token: 0x0600191A RID: 6426 RVA: 0x00055E00 File Offset: 0x00054000
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.FullList.Count;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value that indicates whether the collection is read only.</summary>
|
||||
/// <returns>This value of this property is always true.</returns>
|
||||
// Token: 0x170007E2 RID: 2018
|
||||
// (get) Token: 0x0600191B RID: 6427 RVA: 0x00055E10 File Offset: 0x00054010
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether access to the collection is synchronized (thread-safe).</summary>
|
||||
/// <returns>The value of this property is always false.</returns>
|
||||
// Token: 0x170007E3 RID: 2019
|
||||
// (get) Token: 0x0600191C RID: 6428 RVA: 0x00055E14 File Offset: 0x00054014
|
||||
public bool IsSynchronized
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an individual member of the collection.</summary>
|
||||
/// <returns>The captured substring at position <paramref name="i" /> in the collection.</returns>
|
||||
/// <param name="i">Index into the Match collection. </param>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="i" /> is less than 0 or greater than or equal to <see cref="P:System.Text.RegularExpressions.MatchCollection.Count" />. </exception>
|
||||
// Token: 0x170007E4 RID: 2020
|
||||
public virtual Match this[int i]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (i < 0 || !this.TryToGet(i))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("i");
|
||||
}
|
||||
return (i >= this.list.Count) ? this.current : ((Match)this.list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets an object that can be used to synchronize access to the collection.</summary>
|
||||
/// <returns>An object that can be used to synchronize access to the collection. This property always returns the object itself.</returns>
|
||||
// Token: 0x170007E5 RID: 2021
|
||||
// (get) Token: 0x0600191E RID: 6430 RVA: 0x00055E70 File Offset: 0x00054070
|
||||
public object SyncRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.list;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Copies all the elements of the collection to the given array starting at the given index.</summary>
|
||||
/// <param name="array">The array the collection is to be copied into. </param>
|
||||
/// <param name="arrayIndex">The position in the array where copying is to begin. </param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="array" /> is a multi-dimensional array.</exception>
|
||||
/// <exception cref="T:System.IndexOutOfRangeException">
|
||||
/// <paramref name="arrayIndex" /> is outside the bounds of <paramref name="array" />.-or-<paramref name="arrayIndex" /> plus <see cref="P:System.Text.RegularExpressions.GroupCollection.Count" /> is outside the bounds of <paramref name="array" />.</exception>
|
||||
// Token: 0x0600191F RID: 6431 RVA: 0x00055E78 File Offset: 0x00054078
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
this.FullList.CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>Provides an enumerator in the same order as <see cref="P:System.Text.RegularExpressions.MatchCollection.Item(System.Int32)" />.</summary>
|
||||
/// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that contains all Match objects within the MatchCollection.</returns>
|
||||
// Token: 0x06001920 RID: 6432 RVA: 0x00055E88 File Offset: 0x00054088
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
IEnumerator enumerator2;
|
||||
if (this.current.Success)
|
||||
{
|
||||
IEnumerator enumerator = new MatchCollection.Enumerator(this);
|
||||
enumerator2 = enumerator;
|
||||
}
|
||||
else
|
||||
{
|
||||
enumerator2 = this.list.GetEnumerator();
|
||||
}
|
||||
return enumerator2;
|
||||
}
|
||||
|
||||
// Token: 0x06001921 RID: 6433 RVA: 0x00055EC0 File Offset: 0x000540C0
|
||||
private bool TryToGet(int i)
|
||||
{
|
||||
while (i > this.list.Count && this.current.Success)
|
||||
{
|
||||
this.list.Add(this.current);
|
||||
this.current = this.current.NextMatch();
|
||||
}
|
||||
return i < this.list.Count || this.current.Success;
|
||||
}
|
||||
|
||||
// Token: 0x170007E6 RID: 2022
|
||||
// (get) Token: 0x06001922 RID: 6434 RVA: 0x00055F38 File Offset: 0x00054138
|
||||
private ICollection FullList
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.TryToGet(2147483647))
|
||||
{
|
||||
throw new SystemException("too many matches");
|
||||
}
|
||||
return this.list;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040013D0 RID: 5072
|
||||
private Match current;
|
||||
|
||||
// Token: 0x040013D1 RID: 5073
|
||||
private ArrayList list;
|
||||
|
||||
// Token: 0x020002B1 RID: 689
|
||||
private class Enumerator : IEnumerator
|
||||
{
|
||||
// Token: 0x06001923 RID: 6435 RVA: 0x00055F5C File Offset: 0x0005415C
|
||||
internal Enumerator(MatchCollection coll)
|
||||
{
|
||||
this.coll = coll;
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
// Token: 0x06001924 RID: 6436 RVA: 0x00055F74 File Offset: 0x00054174
|
||||
void IEnumerator.Reset()
|
||||
{
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
// Token: 0x170007E7 RID: 2023
|
||||
// (get) Token: 0x06001925 RID: 6437 RVA: 0x00055F80 File Offset: 0x00054180
|
||||
object IEnumerator.Current
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.index < 0)
|
||||
{
|
||||
throw new InvalidOperationException("'Current' called before 'MoveNext()'");
|
||||
}
|
||||
if (this.index > this.coll.list.Count)
|
||||
{
|
||||
throw new SystemException("MatchCollection in invalid state");
|
||||
}
|
||||
if (this.index == this.coll.list.Count && !this.coll.current.Success)
|
||||
{
|
||||
throw new InvalidOperationException("'Current' called after 'MoveNext()' returned false");
|
||||
}
|
||||
return (this.index >= this.coll.list.Count) ? this.coll.current : this.coll.list[this.index];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001926 RID: 6438 RVA: 0x00056048 File Offset: 0x00054248
|
||||
bool IEnumerator.MoveNext()
|
||||
{
|
||||
if (this.index > this.coll.list.Count)
|
||||
{
|
||||
throw new SystemException("MatchCollection in invalid state");
|
||||
}
|
||||
return (this.index != this.coll.list.Count || this.coll.current.Success) && this.coll.TryToGet(++this.index);
|
||||
}
|
||||
|
||||
// Token: 0x040013D2 RID: 5074
|
||||
private int index;
|
||||
|
||||
// Token: 0x040013D3 RID: 5075
|
||||
private MatchCollection coll;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents the method that is called each time a regular expression match is found during a <see cref="Overload:System.Text.RegularExpressions.Regex.Replace" /> method operation.</summary>
|
||||
/// <returns>A string returned by the method that is represented by the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate.</returns>
|
||||
/// <param name="match">The <see cref="T:System.Text.RegularExpressions.Match" /> object that represents a single regular expression match during a <see cref="Overload:System.Text.RegularExpressions.Regex.Replace" /> method operation. </param>
|
||||
// Token: 0x02000340 RID: 832
|
||||
// (Invoke) Token: 0x06001CD9 RID: 7385
|
||||
[Serializable]
|
||||
public delegate string MatchEvaluator(Match match);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002BA RID: 698
|
||||
internal enum OpCode : ushort
|
||||
{
|
||||
// Token: 0x040014AA RID: 5290
|
||||
False,
|
||||
// Token: 0x040014AB RID: 5291
|
||||
True,
|
||||
// Token: 0x040014AC RID: 5292
|
||||
Position,
|
||||
// Token: 0x040014AD RID: 5293
|
||||
String,
|
||||
// Token: 0x040014AE RID: 5294
|
||||
Reference,
|
||||
// Token: 0x040014AF RID: 5295
|
||||
Character,
|
||||
// Token: 0x040014B0 RID: 5296
|
||||
Category,
|
||||
// Token: 0x040014B1 RID: 5297
|
||||
NotCategory,
|
||||
// Token: 0x040014B2 RID: 5298
|
||||
Range,
|
||||
// Token: 0x040014B3 RID: 5299
|
||||
Set,
|
||||
// Token: 0x040014B4 RID: 5300
|
||||
In,
|
||||
// Token: 0x040014B5 RID: 5301
|
||||
Open,
|
||||
// Token: 0x040014B6 RID: 5302
|
||||
Close,
|
||||
// Token: 0x040014B7 RID: 5303
|
||||
Balance,
|
||||
// Token: 0x040014B8 RID: 5304
|
||||
BalanceStart,
|
||||
// Token: 0x040014B9 RID: 5305
|
||||
IfDefined,
|
||||
// Token: 0x040014BA RID: 5306
|
||||
Sub,
|
||||
// Token: 0x040014BB RID: 5307
|
||||
Test,
|
||||
// Token: 0x040014BC RID: 5308
|
||||
Branch,
|
||||
// Token: 0x040014BD RID: 5309
|
||||
Jump,
|
||||
// Token: 0x040014BE RID: 5310
|
||||
Repeat,
|
||||
// Token: 0x040014BF RID: 5311
|
||||
Until,
|
||||
// Token: 0x040014C0 RID: 5312
|
||||
FastRepeat,
|
||||
// Token: 0x040014C1 RID: 5313
|
||||
Anchor,
|
||||
// Token: 0x040014C2 RID: 5314
|
||||
Info
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002BB RID: 699
|
||||
[Flags]
|
||||
internal enum OpFlags : ushort
|
||||
{
|
||||
// Token: 0x040014C4 RID: 5316
|
||||
None = 0,
|
||||
// Token: 0x040014C5 RID: 5317
|
||||
Negate = 256,
|
||||
// Token: 0x040014C6 RID: 5318
|
||||
IgnoreCase = 512,
|
||||
// Token: 0x040014C7 RID: 5319
|
||||
RightToLeft = 1024,
|
||||
// Token: 0x040014C8 RID: 5320
|
||||
Lazy = 2048
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002C8 RID: 712
|
||||
internal class PatternCompiler : ICompiler
|
||||
{
|
||||
// Token: 0x060019D9 RID: 6617 RVA: 0x0005C534 File Offset: 0x0005A734
|
||||
public PatternCompiler()
|
||||
{
|
||||
this.pgm = new ArrayList();
|
||||
}
|
||||
|
||||
// Token: 0x060019DA RID: 6618 RVA: 0x0005C548 File Offset: 0x0005A748
|
||||
public static ushort EncodeOp(OpCode op, OpFlags flags)
|
||||
{
|
||||
return (ushort)(op | (OpCode)(flags & (OpFlags)65280));
|
||||
}
|
||||
|
||||
// Token: 0x060019DB RID: 6619 RVA: 0x0005C554 File Offset: 0x0005A754
|
||||
public static void DecodeOp(ushort word, out OpCode op, out OpFlags flags)
|
||||
{
|
||||
op = (OpCode)(word & 255);
|
||||
flags = (OpFlags)(word & 65280);
|
||||
}
|
||||
|
||||
// Token: 0x060019DC RID: 6620 RVA: 0x0005C56C File Offset: 0x0005A76C
|
||||
public void Reset()
|
||||
{
|
||||
this.pgm.Clear();
|
||||
}
|
||||
|
||||
// Token: 0x060019DD RID: 6621 RVA: 0x0005C57C File Offset: 0x0005A77C
|
||||
public IMachineFactory GetMachineFactory()
|
||||
{
|
||||
ushort[] array = new ushort[this.pgm.Count];
|
||||
this.pgm.CopyTo(array);
|
||||
return new InterpreterFactory(array);
|
||||
}
|
||||
|
||||
// Token: 0x060019DE RID: 6622 RVA: 0x0005C5AC File Offset: 0x0005A7AC
|
||||
public void EmitFalse()
|
||||
{
|
||||
this.Emit(OpCode.False);
|
||||
}
|
||||
|
||||
// Token: 0x060019DF RID: 6623 RVA: 0x0005C5B8 File Offset: 0x0005A7B8
|
||||
public void EmitTrue()
|
||||
{
|
||||
this.Emit(OpCode.True);
|
||||
}
|
||||
|
||||
// Token: 0x060019E0 RID: 6624 RVA: 0x0005C5C4 File Offset: 0x0005A7C4
|
||||
private void EmitCount(int count)
|
||||
{
|
||||
this.Emit((ushort)(count & 65535));
|
||||
this.Emit((ushort)((uint)count >> 16));
|
||||
}
|
||||
|
||||
// Token: 0x060019E1 RID: 6625 RVA: 0x0005C5EC File Offset: 0x0005A7EC
|
||||
public void EmitCharacter(char c, bool negate, bool ignore, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.Character, PatternCompiler.MakeFlags(negate, ignore, reverse, false));
|
||||
if (ignore)
|
||||
{
|
||||
c = char.ToLower(c);
|
||||
}
|
||||
this.Emit((ushort)c);
|
||||
}
|
||||
|
||||
// Token: 0x060019E2 RID: 6626 RVA: 0x0005C620 File Offset: 0x0005A820
|
||||
public void EmitCategory(Category cat, bool negate, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.Category, PatternCompiler.MakeFlags(negate, false, reverse, false));
|
||||
this.Emit((ushort)cat);
|
||||
}
|
||||
|
||||
// Token: 0x060019E3 RID: 6627 RVA: 0x0005C63C File Offset: 0x0005A83C
|
||||
public void EmitNotCategory(Category cat, bool negate, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.NotCategory, PatternCompiler.MakeFlags(negate, false, reverse, false));
|
||||
this.Emit((ushort)cat);
|
||||
}
|
||||
|
||||
// Token: 0x060019E4 RID: 6628 RVA: 0x0005C658 File Offset: 0x0005A858
|
||||
public void EmitRange(char lo, char hi, bool negate, bool ignore, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.Range, PatternCompiler.MakeFlags(negate, ignore, reverse, false));
|
||||
this.Emit((ushort)lo);
|
||||
this.Emit((ushort)hi);
|
||||
}
|
||||
|
||||
// Token: 0x060019E5 RID: 6629 RVA: 0x0005C688 File Offset: 0x0005A888
|
||||
public void EmitSet(char lo, BitArray set, bool negate, bool ignore, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.Set, PatternCompiler.MakeFlags(negate, ignore, reverse, false));
|
||||
this.Emit((ushort)lo);
|
||||
int num = set.Length + 15 >> 4;
|
||||
this.Emit((ushort)num);
|
||||
int num2 = 0;
|
||||
while (num-- != 0)
|
||||
{
|
||||
ushort num3 = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (num2 >= set.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (set[num2++])
|
||||
{
|
||||
num3 |= (ushort)(1 << i);
|
||||
}
|
||||
}
|
||||
this.Emit(num3);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060019E6 RID: 6630 RVA: 0x0005C71C File Offset: 0x0005A91C
|
||||
public void EmitString(string str, bool ignore, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.String, PatternCompiler.MakeFlags(false, ignore, reverse, false));
|
||||
int length = str.Length;
|
||||
this.Emit((ushort)length);
|
||||
if (ignore)
|
||||
{
|
||||
str = str.ToLower();
|
||||
}
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
this.Emit((ushort)str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060019E7 RID: 6631 RVA: 0x0005C778 File Offset: 0x0005A978
|
||||
public void EmitPosition(Position pos)
|
||||
{
|
||||
this.Emit(OpCode.Position, OpFlags.None);
|
||||
this.Emit((ushort)pos);
|
||||
}
|
||||
|
||||
// Token: 0x060019E8 RID: 6632 RVA: 0x0005C78C File Offset: 0x0005A98C
|
||||
public void EmitOpen(int gid)
|
||||
{
|
||||
this.Emit(OpCode.Open);
|
||||
this.Emit((ushort)gid);
|
||||
}
|
||||
|
||||
// Token: 0x060019E9 RID: 6633 RVA: 0x0005C7A0 File Offset: 0x0005A9A0
|
||||
public void EmitClose(int gid)
|
||||
{
|
||||
this.Emit(OpCode.Close);
|
||||
this.Emit((ushort)gid);
|
||||
}
|
||||
|
||||
// Token: 0x060019EA RID: 6634 RVA: 0x0005C7B4 File Offset: 0x0005A9B4
|
||||
public void EmitBalanceStart(int gid, int balance, bool capture, LinkRef tail)
|
||||
{
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.BalanceStart);
|
||||
this.Emit((ushort)gid);
|
||||
this.Emit((ushort)balance);
|
||||
this.Emit((!capture) ? 0 : 1);
|
||||
this.EmitLink(tail);
|
||||
}
|
||||
|
||||
// Token: 0x060019EB RID: 6635 RVA: 0x0005C800 File Offset: 0x0005AA00
|
||||
public void EmitBalance()
|
||||
{
|
||||
this.Emit(OpCode.Balance);
|
||||
}
|
||||
|
||||
// Token: 0x060019EC RID: 6636 RVA: 0x0005C80C File Offset: 0x0005AA0C
|
||||
public void EmitReference(int gid, bool ignore, bool reverse)
|
||||
{
|
||||
this.Emit(OpCode.Reference, PatternCompiler.MakeFlags(false, ignore, reverse, false));
|
||||
this.Emit((ushort)gid);
|
||||
}
|
||||
|
||||
// Token: 0x060019ED RID: 6637 RVA: 0x0005C828 File Offset: 0x0005AA28
|
||||
public void EmitIfDefined(int gid, LinkRef tail)
|
||||
{
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.IfDefined);
|
||||
this.EmitLink(tail);
|
||||
this.Emit((ushort)gid);
|
||||
}
|
||||
|
||||
// Token: 0x060019EE RID: 6638 RVA: 0x0005C854 File Offset: 0x0005AA54
|
||||
public void EmitSub(LinkRef tail)
|
||||
{
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.Sub);
|
||||
this.EmitLink(tail);
|
||||
}
|
||||
|
||||
// Token: 0x060019EF RID: 6639 RVA: 0x0005C86C File Offset: 0x0005AA6C
|
||||
public void EmitTest(LinkRef yes, LinkRef tail)
|
||||
{
|
||||
this.BeginLink(yes);
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.Test);
|
||||
this.EmitLink(yes);
|
||||
this.EmitLink(tail);
|
||||
}
|
||||
|
||||
// Token: 0x060019F0 RID: 6640 RVA: 0x0005C8A0 File Offset: 0x0005AAA0
|
||||
public void EmitBranch(LinkRef next)
|
||||
{
|
||||
this.BeginLink(next);
|
||||
this.Emit(OpCode.Branch, OpFlags.None);
|
||||
this.EmitLink(next);
|
||||
}
|
||||
|
||||
// Token: 0x060019F1 RID: 6641 RVA: 0x0005C8BC File Offset: 0x0005AABC
|
||||
public void EmitJump(LinkRef target)
|
||||
{
|
||||
this.BeginLink(target);
|
||||
this.Emit(OpCode.Jump, OpFlags.None);
|
||||
this.EmitLink(target);
|
||||
}
|
||||
|
||||
// Token: 0x060019F2 RID: 6642 RVA: 0x0005C8D8 File Offset: 0x0005AAD8
|
||||
public void EmitRepeat(int min, int max, bool lazy, LinkRef until)
|
||||
{
|
||||
this.BeginLink(until);
|
||||
this.Emit(OpCode.Repeat, PatternCompiler.MakeFlags(false, false, false, lazy));
|
||||
this.EmitLink(until);
|
||||
this.EmitCount(min);
|
||||
this.EmitCount(max);
|
||||
}
|
||||
|
||||
// Token: 0x060019F3 RID: 6643 RVA: 0x0005C914 File Offset: 0x0005AB14
|
||||
public void EmitUntil(LinkRef repeat)
|
||||
{
|
||||
this.ResolveLink(repeat);
|
||||
this.Emit(OpCode.Until);
|
||||
}
|
||||
|
||||
// Token: 0x060019F4 RID: 6644 RVA: 0x0005C928 File Offset: 0x0005AB28
|
||||
public void EmitFastRepeat(int min, int max, bool lazy, LinkRef tail)
|
||||
{
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.FastRepeat, PatternCompiler.MakeFlags(false, false, false, lazy));
|
||||
this.EmitLink(tail);
|
||||
this.EmitCount(min);
|
||||
this.EmitCount(max);
|
||||
}
|
||||
|
||||
// Token: 0x060019F5 RID: 6645 RVA: 0x0005C964 File Offset: 0x0005AB64
|
||||
public void EmitIn(LinkRef tail)
|
||||
{
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.In);
|
||||
this.EmitLink(tail);
|
||||
}
|
||||
|
||||
// Token: 0x060019F6 RID: 6646 RVA: 0x0005C97C File Offset: 0x0005AB7C
|
||||
public void EmitAnchor(bool reverse, int offset, LinkRef tail)
|
||||
{
|
||||
this.BeginLink(tail);
|
||||
this.Emit(OpCode.Anchor, PatternCompiler.MakeFlags(false, false, reverse, false));
|
||||
this.EmitLink(tail);
|
||||
this.Emit((ushort)offset);
|
||||
}
|
||||
|
||||
// Token: 0x060019F7 RID: 6647 RVA: 0x0005C9B0 File Offset: 0x0005ABB0
|
||||
public void EmitInfo(int count, int min, int max)
|
||||
{
|
||||
this.Emit(OpCode.Info);
|
||||
this.EmitCount(count);
|
||||
this.EmitCount(min);
|
||||
this.EmitCount(max);
|
||||
}
|
||||
|
||||
// Token: 0x060019F8 RID: 6648 RVA: 0x0005C9DC File Offset: 0x0005ABDC
|
||||
public LinkRef NewLink()
|
||||
{
|
||||
return new PatternCompiler.PatternLinkStack();
|
||||
}
|
||||
|
||||
// Token: 0x060019F9 RID: 6649 RVA: 0x0005C9E4 File Offset: 0x0005ABE4
|
||||
public void ResolveLink(LinkRef lref)
|
||||
{
|
||||
PatternCompiler.PatternLinkStack patternLinkStack = (PatternCompiler.PatternLinkStack)lref;
|
||||
while (patternLinkStack.Pop())
|
||||
{
|
||||
this.pgm[patternLinkStack.OffsetAddress] = (ushort)patternLinkStack.GetOffset(this.CurrentAddress);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060019FA RID: 6650 RVA: 0x0005CA2C File Offset: 0x0005AC2C
|
||||
public void EmitBranchEnd()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060019FB RID: 6651 RVA: 0x0005CA30 File Offset: 0x0005AC30
|
||||
public void EmitAlternationEnd()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060019FC RID: 6652 RVA: 0x0005CA34 File Offset: 0x0005AC34
|
||||
private static OpFlags MakeFlags(bool negate, bool ignore, bool reverse, bool lazy)
|
||||
{
|
||||
OpFlags opFlags = OpFlags.None;
|
||||
if (negate)
|
||||
{
|
||||
opFlags |= OpFlags.Negate;
|
||||
}
|
||||
if (ignore)
|
||||
{
|
||||
opFlags |= OpFlags.IgnoreCase;
|
||||
}
|
||||
if (reverse)
|
||||
{
|
||||
opFlags |= OpFlags.RightToLeft;
|
||||
}
|
||||
if (lazy)
|
||||
{
|
||||
opFlags |= OpFlags.Lazy;
|
||||
}
|
||||
return opFlags;
|
||||
}
|
||||
|
||||
// Token: 0x060019FD RID: 6653 RVA: 0x0005CA80 File Offset: 0x0005AC80
|
||||
private void Emit(OpCode op)
|
||||
{
|
||||
this.Emit(op, OpFlags.None);
|
||||
}
|
||||
|
||||
// Token: 0x060019FE RID: 6654 RVA: 0x0005CA8C File Offset: 0x0005AC8C
|
||||
private void Emit(OpCode op, OpFlags flags)
|
||||
{
|
||||
this.Emit(PatternCompiler.EncodeOp(op, flags));
|
||||
}
|
||||
|
||||
// Token: 0x060019FF RID: 6655 RVA: 0x0005CA9C File Offset: 0x0005AC9C
|
||||
private void Emit(ushort word)
|
||||
{
|
||||
this.pgm.Add(word);
|
||||
}
|
||||
|
||||
// Token: 0x17000805 RID: 2053
|
||||
// (get) Token: 0x06001A00 RID: 6656 RVA: 0x0005CAB0 File Offset: 0x0005ACB0
|
||||
private int CurrentAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pgm.Count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A01 RID: 6657 RVA: 0x0005CAC0 File Offset: 0x0005ACC0
|
||||
private void BeginLink(LinkRef lref)
|
||||
{
|
||||
PatternCompiler.PatternLinkStack patternLinkStack = (PatternCompiler.PatternLinkStack)lref;
|
||||
patternLinkStack.BaseAddress = this.CurrentAddress;
|
||||
}
|
||||
|
||||
// Token: 0x06001A02 RID: 6658 RVA: 0x0005CAE0 File Offset: 0x0005ACE0
|
||||
private void EmitLink(LinkRef lref)
|
||||
{
|
||||
PatternCompiler.PatternLinkStack patternLinkStack = (PatternCompiler.PatternLinkStack)lref;
|
||||
patternLinkStack.OffsetAddress = this.CurrentAddress;
|
||||
this.Emit(0);
|
||||
patternLinkStack.Push();
|
||||
}
|
||||
|
||||
// Token: 0x04001574 RID: 5492
|
||||
private ArrayList pgm;
|
||||
|
||||
// Token: 0x020002C9 RID: 713
|
||||
private class PatternLinkStack : LinkStack
|
||||
{
|
||||
// Token: 0x17000806 RID: 2054
|
||||
// (set) Token: 0x06001A04 RID: 6660 RVA: 0x0005CB18 File Offset: 0x0005AD18
|
||||
public int BaseAddress
|
||||
{
|
||||
set
|
||||
{
|
||||
this.link.base_addr = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000807 RID: 2055
|
||||
// (get) Token: 0x06001A05 RID: 6661 RVA: 0x0005CB28 File Offset: 0x0005AD28
|
||||
// (set) Token: 0x06001A06 RID: 6662 RVA: 0x0005CB38 File Offset: 0x0005AD38
|
||||
public int OffsetAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.link.offset_addr;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.link.offset_addr = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A07 RID: 6663 RVA: 0x0005CB48 File Offset: 0x0005AD48
|
||||
public int GetOffset(int target_addr)
|
||||
{
|
||||
return target_addr - this.link.base_addr;
|
||||
}
|
||||
|
||||
// Token: 0x06001A08 RID: 6664 RVA: 0x0005CB58 File Offset: 0x0005AD58
|
||||
protected override object GetCurrent()
|
||||
{
|
||||
return this.link;
|
||||
}
|
||||
|
||||
// Token: 0x06001A09 RID: 6665 RVA: 0x0005CB68 File Offset: 0x0005AD68
|
||||
protected override void SetCurrent(object l)
|
||||
{
|
||||
this.link = (PatternCompiler.PatternLinkStack.Link)l;
|
||||
}
|
||||
|
||||
// Token: 0x04001575 RID: 5493
|
||||
private PatternCompiler.PatternLinkStack.Link link;
|
||||
|
||||
// Token: 0x020002CA RID: 714
|
||||
private struct Link
|
||||
{
|
||||
// Token: 0x04001576 RID: 5494
|
||||
public int base_addr;
|
||||
|
||||
// Token: 0x04001577 RID: 5495
|
||||
public int offset_addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002BC RID: 700
|
||||
internal enum Position : ushort
|
||||
{
|
||||
// Token: 0x040014CA RID: 5322
|
||||
Any,
|
||||
// Token: 0x040014CB RID: 5323
|
||||
Start,
|
||||
// Token: 0x040014CC RID: 5324
|
||||
StartOfString,
|
||||
// Token: 0x040014CD RID: 5325
|
||||
StartOfLine,
|
||||
// Token: 0x040014CE RID: 5326
|
||||
StartOfScan,
|
||||
// Token: 0x040014CF RID: 5327
|
||||
End,
|
||||
// Token: 0x040014D0 RID: 5328
|
||||
EndOfString,
|
||||
// Token: 0x040014D1 RID: 5329
|
||||
EndOfLine,
|
||||
// Token: 0x040014D2 RID: 5330
|
||||
Boundary,
|
||||
// Token: 0x040014D3 RID: 5331
|
||||
NonBoundary
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002D6 RID: 726
|
||||
internal class QuickSearch
|
||||
{
|
||||
// Token: 0x06001A83 RID: 6787 RVA: 0x00061A00 File Offset: 0x0005FC00
|
||||
public QuickSearch(string str, bool ignore)
|
||||
: this(str, ignore, false)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06001A84 RID: 6788 RVA: 0x00061A0C File Offset: 0x0005FC0C
|
||||
public QuickSearch(string str, bool ignore, bool reverse)
|
||||
{
|
||||
this.str = str;
|
||||
this.len = str.Length;
|
||||
this.ignore = ignore;
|
||||
this.reverse = reverse;
|
||||
if (ignore)
|
||||
{
|
||||
str = str.ToLower();
|
||||
}
|
||||
if (this.len > QuickSearch.THRESHOLD)
|
||||
{
|
||||
this.SetupShiftTable();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000820 RID: 2080
|
||||
// (get) Token: 0x06001A86 RID: 6790 RVA: 0x00061A6C File Offset: 0x0005FC6C
|
||||
public string String
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.str;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000821 RID: 2081
|
||||
// (get) Token: 0x06001A87 RID: 6791 RVA: 0x00061A74 File Offset: 0x0005FC74
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.len;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000822 RID: 2082
|
||||
// (get) Token: 0x06001A88 RID: 6792 RVA: 0x00061A7C File Offset: 0x0005FC7C
|
||||
public bool IgnoreCase
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ignore;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A89 RID: 6793 RVA: 0x00061A84 File Offset: 0x0005FC84
|
||||
public int Search(string text, int start, int end)
|
||||
{
|
||||
int i = start;
|
||||
if (this.reverse)
|
||||
{
|
||||
if (start < end)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (i > text.Length)
|
||||
{
|
||||
i = text.Length;
|
||||
}
|
||||
if (this.len == 1)
|
||||
{
|
||||
while (--i >= end)
|
||||
{
|
||||
if (this.str[0] == this.GetChar(text[i]))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (end < this.len)
|
||||
{
|
||||
end = this.len - 1;
|
||||
}
|
||||
for (i--; i >= end; i -= this.GetShiftDistance(text[i - this.len]))
|
||||
{
|
||||
int num = this.len - 1;
|
||||
while (this.str[num] == this.GetChar(text[i - this.len + 1 + num]))
|
||||
{
|
||||
if (--num < 0)
|
||||
{
|
||||
return i - this.len + 1;
|
||||
}
|
||||
}
|
||||
if (i <= end)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.len == 1)
|
||||
{
|
||||
while (i <= end)
|
||||
{
|
||||
if (this.str[0] == this.GetChar(text[i]))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (end > text.Length - this.len)
|
||||
{
|
||||
end = text.Length - this.len;
|
||||
}
|
||||
while (i <= end)
|
||||
{
|
||||
int num2 = this.len - 1;
|
||||
while (this.str[num2] == this.GetChar(text[i + num2]))
|
||||
{
|
||||
if (--num2 < 0)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
if (i >= end)
|
||||
{
|
||||
break;
|
||||
}
|
||||
i += this.GetShiftDistance(text[i + this.len]);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Token: 0x06001A8A RID: 6794 RVA: 0x00061C68 File Offset: 0x0005FE68
|
||||
private void SetupShiftTable()
|
||||
{
|
||||
bool flag = this.len > 254;
|
||||
byte b = 0;
|
||||
for (int i = 0; i < this.len; i++)
|
||||
{
|
||||
char c = this.str[i];
|
||||
if (c <= 'ÿ')
|
||||
{
|
||||
if ((byte)c > b)
|
||||
{
|
||||
b = (byte)c;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
this.shift = new byte[(int)(b + 1)];
|
||||
if (flag)
|
||||
{
|
||||
this.shiftExtended = new Hashtable();
|
||||
}
|
||||
int j = 0;
|
||||
int num = this.len;
|
||||
while (j < this.len)
|
||||
{
|
||||
char c2 = this.str[this.reverse ? (num - 1) : j];
|
||||
if ((int)c2 >= this.shift.Length)
|
||||
{
|
||||
goto IL_DD;
|
||||
}
|
||||
if (num >= 255)
|
||||
{
|
||||
this.shift[(int)c2] = byte.MaxValue;
|
||||
goto IL_DD;
|
||||
}
|
||||
this.shift[(int)c2] = (byte)num;
|
||||
IL_F6:
|
||||
j++;
|
||||
num--;
|
||||
continue;
|
||||
IL_DD:
|
||||
this.shiftExtended[c2] = num;
|
||||
goto IL_F6;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A8B RID: 6795 RVA: 0x00061D84 File Offset: 0x0005FF84
|
||||
private int GetShiftDistance(char c)
|
||||
{
|
||||
if (this.shift == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
c = this.GetChar(c);
|
||||
if ((int)c < this.shift.Length)
|
||||
{
|
||||
int num = (int)this.shift[(int)c];
|
||||
if (num == 0)
|
||||
{
|
||||
return this.len + 1;
|
||||
}
|
||||
if (num != 255)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
}
|
||||
else if (c < 'ÿ')
|
||||
{
|
||||
return this.len + 1;
|
||||
}
|
||||
if (this.shiftExtended == null)
|
||||
{
|
||||
return this.len + 1;
|
||||
}
|
||||
object obj = this.shiftExtended[c];
|
||||
return (obj == null) ? (this.len + 1) : ((int)obj);
|
||||
}
|
||||
|
||||
// Token: 0x06001A8C RID: 6796 RVA: 0x00061E34 File Offset: 0x00060034
|
||||
private char GetChar(char c)
|
||||
{
|
||||
return this.ignore ? char.ToLower(c) : c;
|
||||
}
|
||||
|
||||
// Token: 0x040015A5 RID: 5541
|
||||
private string str;
|
||||
|
||||
// Token: 0x040015A6 RID: 5542
|
||||
private int len;
|
||||
|
||||
// Token: 0x040015A7 RID: 5543
|
||||
private bool ignore;
|
||||
|
||||
// Token: 0x040015A8 RID: 5544
|
||||
private bool reverse;
|
||||
|
||||
// Token: 0x040015A9 RID: 5545
|
||||
private byte[] shift;
|
||||
|
||||
// Token: 0x040015AA RID: 5546
|
||||
private Hashtable shiftExtended;
|
||||
|
||||
// Token: 0x040015AB RID: 5547
|
||||
private static readonly int THRESHOLD = 5;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,1082 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.RegularExpressions.Syntax;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Represents an immutable regular expression.</summary>
|
||||
// Token: 0x020002B2 RID: 690
|
||||
[Serializable]
|
||||
public class Regex : ISerializable
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class.</summary>
|
||||
// Token: 0x06001927 RID: 6439 RVA: 0x000560CC File Offset: 0x000542CC
|
||||
protected Regex()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes and compiles a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class for the specified regular expression.</summary>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="pattern" /> is null.</exception>
|
||||
// Token: 0x06001928 RID: 6440 RVA: 0x000560D4 File Offset: 0x000542D4
|
||||
public Regex(string pattern)
|
||||
: this(pattern, RegexOptions.None)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes and compiles a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class for the specified regular expression, with options that modify the pattern.</summary>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="options">A bitwise OR combination of the enumeration values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="pattern" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> contains an invalid flag.</exception>
|
||||
// Token: 0x06001929 RID: 6441 RVA: 0x000560E0 File Offset: 0x000542E0
|
||||
public Regex(string pattern, RegexOptions options)
|
||||
{
|
||||
if (pattern == null)
|
||||
{
|
||||
throw new ArgumentNullException("pattern");
|
||||
}
|
||||
Regex.validate_options(options);
|
||||
this.pattern = pattern;
|
||||
this.roptions = options;
|
||||
this.Init();
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class using serialized data.</summary>
|
||||
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains a serialized pattern and <see cref="T:System.Text.RegularExpressions.RegexOptions" /> information.</param>
|
||||
/// <param name="context">The destination for this serialization. (This parameter is not used; specify null.)</param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred. </exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">The pattern that <paramref name="info" /> contains is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="info" /> contains an invalid <see cref="T:System.Text.RegularExpressions.RegexOptions" /> flag.</exception>
|
||||
// Token: 0x0600192A RID: 6442 RVA: 0x00056114 File Offset: 0x00054314
|
||||
protected Regex(SerializationInfo info, StreamingContext context)
|
||||
: this(info.GetString("pattern"), (RegexOptions)((int)info.GetValue("options", typeof(RegexOptions))))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the data necessary to deserialize the current <see cref="T:System.Text.RegularExpressions.Regex" /> object.</summary>
|
||||
/// <param name="si">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object to populate with serialization information.</param>
|
||||
/// <param name="context">The place to store and retrieve serialized data. Reserved for future use.</param>
|
||||
// Token: 0x0600192C RID: 6444 RVA: 0x0005615C File Offset: 0x0005435C
|
||||
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
info.AddValue("pattern", this.ToString(), typeof(string));
|
||||
info.AddValue("options", this.Options, typeof(RegexOptions));
|
||||
}
|
||||
|
||||
/// <summary>Compiles one or more specified <see cref="T:System.Text.RegularExpressions.Regex" /> objects to a named file.</summary>
|
||||
/// <param name="regexinfos">An array that describes the regular expressions to compile. </param>
|
||||
/// <param name="assemblyname">The file name of the assembly. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The value of the <paramref name="assemblyname" /> parameter's <see cref="P:System.Reflection.AssemblyName.Name" /> property is an empty or null string.-or-The regular expression pattern of one or more objects in <paramref name="regexinfos" /> contains invalid syntax.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="assemblyname" /> or <paramref name="regexinfos" /> is null. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600192D RID: 6445 RVA: 0x000561A4 File Offset: 0x000543A4
|
||||
[global::System.MonoTODO]
|
||||
public static void CompileToAssembly(RegexCompilationInfo[] regexes, AssemblyName aname)
|
||||
{
|
||||
Regex.CompileToAssembly(regexes, aname, new CustomAttributeBuilder[0], null);
|
||||
}
|
||||
|
||||
/// <summary>Compiles one or more specified <see cref="T:System.Text.RegularExpressions.Regex" /> objects to a named file with specified attributes.</summary>
|
||||
/// <param name="regexinfos">An array that describes the regular expressions to compile. </param>
|
||||
/// <param name="assemblyname">The file name of the assembly. </param>
|
||||
/// <param name="attributes">An array that defines the attributes to apply to the assembly. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The value of the <paramref name="assemblyname" /> parameter's <see cref="P:System.Reflection.AssemblyName.Name" /> property is an empty or null string.-or-The regular expression pattern of one or more objects in <paramref name="regexinfos" /> contains invalid syntax.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="assemblyname" /> or <paramref name="regexinfos" /> is null. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600192E RID: 6446 RVA: 0x000561B4 File Offset: 0x000543B4
|
||||
[global::System.MonoTODO]
|
||||
public static void CompileToAssembly(RegexCompilationInfo[] regexes, AssemblyName aname, CustomAttributeBuilder[] attribs)
|
||||
{
|
||||
Regex.CompileToAssembly(regexes, aname, attribs, null);
|
||||
}
|
||||
|
||||
/// <summary>Compiles one or more specified <see cref="T:System.Text.RegularExpressions.Regex" /> objects and a specified resource file to a named assembly with specified attributes.</summary>
|
||||
/// <param name="regexinfos">An array that describes the regular expressions to compile. </param>
|
||||
/// <param name="assemblyname">The file name of the assembly. </param>
|
||||
/// <param name="attributes">An array that defines the attributes to apply to the assembly. </param>
|
||||
/// <param name="resourceFile">The name of the Win32 resource file to include in the assembly. </param>
|
||||
/// <exception cref="T:System.ArgumentException">The value of the <paramref name="assemblyname" /> parameter's <see cref="P:System.Reflection.AssemblyName.Name" /> property is an empty or null string.-or-The regular expression pattern of one or more objects in <paramref name="regexinfos" /> contains invalid syntax.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="assemblyname" /> or <paramref name="regexinfos" /> is null. </exception>
|
||||
/// <exception cref="T:System.Runtime.InteropServices.COMException">The <paramref name="resourceFile" /> parameter designates an invalid Win32 resource file.</exception>
|
||||
/// <exception cref="T:System.IO.FileNotFoundException">The file designated by the <paramref name="resourceFile" /> parameter cannot be found. </exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600192F RID: 6447 RVA: 0x000561C0 File Offset: 0x000543C0
|
||||
[global::System.MonoTODO]
|
||||
public static void CompileToAssembly(RegexCompilationInfo[] regexes, AssemblyName aname, CustomAttributeBuilder[] attribs, string resourceFile)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>Escapes a minimal set of characters (\, *, +, ?, |, {, [, (,), ^, $,., #, and white space) by replacing them with their escape codes. This instructs the regular expression engine to interpret these characters literally rather than as metacharacters.</summary>
|
||||
/// <returns>A string of characters with metacharacters converted to their escaped form.</returns>
|
||||
/// <param name="str">The input string containing the text to convert. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="str" /> is null.</exception>
|
||||
// Token: 0x06001930 RID: 6448 RVA: 0x000561C8 File Offset: 0x000543C8
|
||||
public static string Escape(string str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
throw new ArgumentNullException("str");
|
||||
}
|
||||
return global::System.Text.RegularExpressions.Syntax.Parser.Escape(str);
|
||||
}
|
||||
|
||||
/// <summary>Converts any escaped characters in the input string.</summary>
|
||||
/// <returns>A string of characters with any escaped characters converted to their unescaped form.</returns>
|
||||
/// <param name="str">The input string containing the text to convert. </param>
|
||||
/// <exception cref="T:System.ArgumentException">
|
||||
/// <paramref name="str" /> includes an unrecognized escape sequence.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="str" /> is null.</exception>
|
||||
// Token: 0x06001931 RID: 6449 RVA: 0x000561E4 File Offset: 0x000543E4
|
||||
public static string Unescape(string str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
throw new ArgumentNullException("str");
|
||||
}
|
||||
return global::System.Text.RegularExpressions.Syntax.Parser.Unescape(str);
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the regular expression finds a match in the input string using the regular expression specified in the <paramref name="pattern" /> parameter.</summary>
|
||||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001932 RID: 6450 RVA: 0x00056200 File Offset: 0x00054400
|
||||
public static bool IsMatch(string input, string pattern)
|
||||
{
|
||||
return Regex.IsMatch(input, pattern, RegexOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the regular expression finds a match in the input string, using the regular expression specified in the <paramref name="pattern" /> parameter and the matching options supplied in the <paramref name="options" /> parameter.</summary>
|
||||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="options">A bitwise OR combination of the enumeration values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> is not a valid <see cref="T:System.Text.RegularExpressions.RegexOptions" /> value.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001933 RID: 6451 RVA: 0x0005620C File Offset: 0x0005440C
|
||||
public static bool IsMatch(string input, string pattern, RegexOptions options)
|
||||
{
|
||||
Regex regex = new Regex(pattern, options);
|
||||
return regex.IsMatch(input);
|
||||
}
|
||||
|
||||
/// <summary>Searches the specified input string for the first occurrence of the regular expression supplied in the <paramref name="pattern" /> parameter.</summary>
|
||||
/// <returns>An object that contains information about the match.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null. -or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001934 RID: 6452 RVA: 0x00056228 File Offset: 0x00054428
|
||||
public static Match Match(string input, string pattern)
|
||||
{
|
||||
return Regex.Match(input, pattern, RegexOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>Searches the input string for the first occurrence of the regular expression supplied in a <paramref name="pattern" /> parameter, using the matching options supplied in the <paramref name="options" /> parameter.</summary>
|
||||
/// <returns>An object that contains information about the match.</returns>
|
||||
/// <param name="input">The string to be tested for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="options">A bitwise OR combination of the enumeration values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> is not a valid bitwise combination of <see cref="T:System.Text.RegularExpressions.RegexOptions" /> values.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001935 RID: 6453 RVA: 0x00056234 File Offset: 0x00054434
|
||||
public static Match Match(string input, string pattern, RegexOptions options)
|
||||
{
|
||||
Regex regex = new Regex(pattern, options);
|
||||
return regex.Match(input);
|
||||
}
|
||||
|
||||
/// <summary>Searches the specified input string for all occurrences of the regular expression specified in the <paramref name="pattern" /> parameter.</summary>
|
||||
/// <returns>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001936 RID: 6454 RVA: 0x00056250 File Offset: 0x00054450
|
||||
public static MatchCollection Matches(string input, string pattern)
|
||||
{
|
||||
return Regex.Matches(input, pattern, RegexOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>Searches the specified input string for all occurrences of a specified regular expression, using the specified matching options.</summary>
|
||||
/// <returns>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="options">A bitwise combination of the enumeration values that specify options for matching.</param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> is not a valid bitwise combination of <see cref="T:System.Text.RegularExpressions.RegexOptions" /> values.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001937 RID: 6455 RVA: 0x0005625C File Offset: 0x0005445C
|
||||
public static MatchCollection Matches(string input, string pattern, RegexOptions options)
|
||||
{
|
||||
Regex regex = new Regex(pattern, options);
|
||||
return regex.Matches(input);
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate.</summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="evaluator">A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.-or-<paramref name="evaluator" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001938 RID: 6456 RVA: 0x00056278 File Offset: 0x00054478
|
||||
public static string Replace(string input, string pattern, MatchEvaluator evaluator)
|
||||
{
|
||||
return Regex.Replace(input, pattern, evaluator, RegexOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. Specified options modify the matching operation.</summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="evaluator">A custom method that examines each match and returns either the original matched string or a replacement string. </param>
|
||||
/// <param name="options">A bitwise OR combination of the enumeration values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.-or-<paramref name="evaluator" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> is not a valid bitwise combination of <see cref="T:System.Text.RegularExpressions.RegexOptions" /> values.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001939 RID: 6457 RVA: 0x00056284 File Offset: 0x00054484
|
||||
public static string Replace(string input, string pattern, MatchEvaluator evaluator, RegexOptions options)
|
||||
{
|
||||
Regex regex = new Regex(pattern, options);
|
||||
return regex.Replace(input, evaluator);
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="replacement">The replacement string. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.-or-<paramref name="replacement" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600193A RID: 6458 RVA: 0x000562A4 File Offset: 0x000544A4
|
||||
public static string Replace(string input, string pattern, string replacement)
|
||||
{
|
||||
return Regex.Replace(input, pattern, replacement, RegexOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Specified options modify the matching operation. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="replacement">The replacement string. </param>
|
||||
/// <param name="options">A bitwise OR combination of the enumeration values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.-or-<paramref name="replacement" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> is not a valid bitwise combination of <see cref="T:System.Text.RegularExpressions.RegexOptions" /> values.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600193B RID: 6459 RVA: 0x000562B0 File Offset: 0x000544B0
|
||||
public static string Replace(string input, string pattern, string replacement, RegexOptions options)
|
||||
{
|
||||
Regex regex = new Regex(pattern, options);
|
||||
return regex.Replace(input, replacement);
|
||||
}
|
||||
|
||||
/// <summary>Splits the input string at the positions defined by a regular expression pattern.</summary>
|
||||
/// <returns>An array of strings.</returns>
|
||||
/// <param name="input">The string to split. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600193C RID: 6460 RVA: 0x000562D0 File Offset: 0x000544D0
|
||||
public static string[] Split(string input, string pattern)
|
||||
{
|
||||
return Regex.Split(input, pattern, RegexOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>Splits the input string at the positions defined by a specified regular expression pattern. Specified options modify the matching operation.</summary>
|
||||
/// <returns>An array of strings.</returns>
|
||||
/// <param name="input">The string to split. </param>
|
||||
/// <param name="pattern">The regular expression pattern to match. </param>
|
||||
/// <param name="options">A bitwise OR combination of the enumeration values. </param>
|
||||
/// <exception cref="T:System.ArgumentException">A regular expression parsing error has occurred.</exception>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="pattern" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="options" /> is not a valid bitwise combination of <see cref="T:System.Text.RegularExpressions.RegexOptions" /> values.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600193D RID: 6461 RVA: 0x000562DC File Offset: 0x000544DC
|
||||
public static string[] Split(string input, string pattern, RegexOptions options)
|
||||
{
|
||||
Regex regex = new Regex(pattern, options);
|
||||
return regex.Split(input);
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the maximum number of entries in the current static cache of compiled regular expressions.</summary>
|
||||
/// <returns>The maximum number of entries in the static cache.</returns>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">The value in a set operation is less than zero.</exception>
|
||||
// Token: 0x170007E8 RID: 2024
|
||||
// (get) Token: 0x0600193E RID: 6462 RVA: 0x000562F8 File Offset: 0x000544F8
|
||||
// (set) Token: 0x0600193F RID: 6463 RVA: 0x00056304 File Offset: 0x00054504
|
||||
public static int CacheSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return Regex.cache.Capacity;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("CacheSize");
|
||||
}
|
||||
Regex.cache.Capacity = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001940 RID: 6464 RVA: 0x00056324 File Offset: 0x00054524
|
||||
private static void validate_options(RegexOptions options)
|
||||
{
|
||||
if ((options & ~(RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.ExplicitCapture | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.RightToLeft | RegexOptions.ECMAScript | RegexOptions.CultureInvariant)) != RegexOptions.None)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("options");
|
||||
}
|
||||
if ((options & RegexOptions.ECMAScript) != RegexOptions.None && (options & ~(RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.ECMAScript)) != RegexOptions.None)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("options");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001941 RID: 6465 RVA: 0x0005636C File Offset: 0x0005456C
|
||||
private void Init()
|
||||
{
|
||||
this.machineFactory = Regex.cache.Lookup(this.pattern, this.roptions);
|
||||
if (this.machineFactory == null)
|
||||
{
|
||||
this.InitNewRegex();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.group_count = this.machineFactory.GroupCount;
|
||||
this.gap = this.machineFactory.Gap;
|
||||
this.mapping = this.machineFactory.Mapping;
|
||||
this.group_names = this.machineFactory.NamesMapping;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001942 RID: 6466 RVA: 0x000563F0 File Offset: 0x000545F0
|
||||
private void InitNewRegex()
|
||||
{
|
||||
this.machineFactory = Regex.CreateMachineFactory(this.pattern, this.roptions);
|
||||
Regex.cache.Add(this.pattern, this.roptions, this.machineFactory);
|
||||
this.group_count = this.machineFactory.GroupCount;
|
||||
this.gap = this.machineFactory.Gap;
|
||||
this.mapping = this.machineFactory.Mapping;
|
||||
this.group_names = this.machineFactory.NamesMapping;
|
||||
}
|
||||
|
||||
// Token: 0x06001943 RID: 6467 RVA: 0x00056474 File Offset: 0x00054674
|
||||
private static IMachineFactory CreateMachineFactory(string pattern, RegexOptions options)
|
||||
{
|
||||
global::System.Text.RegularExpressions.Syntax.Parser parser = new global::System.Text.RegularExpressions.Syntax.Parser();
|
||||
global::System.Text.RegularExpressions.Syntax.RegularExpression regularExpression = parser.ParseRegularExpression(pattern, options);
|
||||
ICompiler compiler = new PatternCompiler();
|
||||
regularExpression.Compile(compiler, (options & RegexOptions.RightToLeft) != RegexOptions.None);
|
||||
IMachineFactory machineFactory = compiler.GetMachineFactory();
|
||||
Hashtable hashtable = new Hashtable();
|
||||
machineFactory.Gap = parser.GetMapping(hashtable);
|
||||
machineFactory.Mapping = hashtable;
|
||||
machineFactory.NamesMapping = Regex.GetGroupNamesArray(machineFactory.GroupCount, machineFactory.Mapping);
|
||||
return machineFactory;
|
||||
}
|
||||
|
||||
/// <summary>Returns the options passed into the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</summary>
|
||||
/// <returns>The <paramref name="options" /> parameter that was passed into the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</returns>
|
||||
// Token: 0x170007E9 RID: 2025
|
||||
// (get) Token: 0x06001944 RID: 6468 RVA: 0x000564E4 File Offset: 0x000546E4
|
||||
public RegexOptions Options
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.roptions;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a value indicating whether the regular expression searches from right to left.</summary>
|
||||
/// <returns>true if the regular expression searches from right to left; otherwise false.</returns>
|
||||
// Token: 0x170007EA RID: 2026
|
||||
// (get) Token: 0x06001945 RID: 6469 RVA: 0x000564EC File Offset: 0x000546EC
|
||||
public bool RightToLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.roptions & RegexOptions.RightToLeft) != RegexOptions.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns an array of capturing group names for the regular expression.</summary>
|
||||
/// <returns>A string array of group names.</returns>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001946 RID: 6470 RVA: 0x00056500 File Offset: 0x00054700
|
||||
public string[] GetGroupNames()
|
||||
{
|
||||
string[] array = new string[1 + this.group_count];
|
||||
Array.Copy(this.group_names, array, 1 + this.group_count);
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>Returns an array of capturing group numbers that correspond to group names in an array.</summary>
|
||||
/// <returns>An integer array of group numbers.</returns>
|
||||
// Token: 0x06001947 RID: 6471 RVA: 0x00056530 File Offset: 0x00054730
|
||||
public int[] GetGroupNumbers()
|
||||
{
|
||||
int[] array = new int[1 + this.group_count];
|
||||
Array.Copy(this.GroupNumbers, array, 1 + this.group_count);
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>Returns the group name that corresponds to the specified group number.</summary>
|
||||
/// <returns>A string that contains the group name associated with the specified group number. If there is no group name that corresponds to <paramref name="i" />, the method returns <see cref="F:System.String.Empty" />.</returns>
|
||||
/// <param name="i">The group number to convert to the corresponding group name. </param>
|
||||
// Token: 0x06001948 RID: 6472 RVA: 0x00056560 File Offset: 0x00054760
|
||||
public string GroupNameFromNumber(int i)
|
||||
{
|
||||
i = this.GetGroupIndex(i);
|
||||
if (i < 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
return this.group_names[i];
|
||||
}
|
||||
|
||||
/// <summary>Returns the group number that corresponds to the specified group name.</summary>
|
||||
/// <returns>The group number that corresponds to the specified group name.</returns>
|
||||
/// <param name="name">The group name to convert to the corresponding group number. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="name" /> is null.</exception>
|
||||
// Token: 0x06001949 RID: 6473 RVA: 0x00056580 File Offset: 0x00054780
|
||||
public int GroupNumberFromName(string name)
|
||||
{
|
||||
if (!this.mapping.Contains(name))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
int num = (int)this.mapping[name];
|
||||
if (num >= this.gap)
|
||||
{
|
||||
num = int.Parse(name);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x0600194A RID: 6474 RVA: 0x000565C8 File Offset: 0x000547C8
|
||||
internal int GetGroupIndex(int number)
|
||||
{
|
||||
if (number < this.gap)
|
||||
{
|
||||
return number;
|
||||
}
|
||||
if (this.gap > this.group_count)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return Array.BinarySearch<int>(this.GroupNumbers, this.gap, this.group_count - this.gap + 1, number);
|
||||
}
|
||||
|
||||
// Token: 0x0600194B RID: 6475 RVA: 0x00056618 File Offset: 0x00054818
|
||||
private int default_startat(string input)
|
||||
{
|
||||
return (!this.RightToLeft || input == null) ? 0 : input.Length;
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor finds a match in the input string.</summary>
|
||||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600194C RID: 6476 RVA: 0x00056638 File Offset: 0x00054838
|
||||
public bool IsMatch(string input)
|
||||
{
|
||||
return this.IsMatch(input, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Indicates whether the regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor finds a match in the input string beginning at the specified starting position in the string.</summary>
|
||||
/// <returns>true if the regular expression finds a match; otherwise, false.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="startat">The character position at which to start the search. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startat" /> cannot be less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600194D RID: 6477 RVA: 0x00056648 File Offset: 0x00054848
|
||||
public bool IsMatch(string input, int startat)
|
||||
{
|
||||
return this.Match(input, startat).Success;
|
||||
}
|
||||
|
||||
/// <summary>Searches the specified input string for the first occurrence of the regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</summary>
|
||||
/// <returns>An object that contains information about the match.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600194E RID: 6478 RVA: 0x00056658 File Offset: 0x00054858
|
||||
public Match Match(string input)
|
||||
{
|
||||
return this.Match(input, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position in the string.</summary>
|
||||
/// <returns>An object that contains information about the match.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="startat">The zero-based character position at which to start the search. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startat" /> is less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600194F RID: 6479 RVA: 0x00056668 File Offset: 0x00054868
|
||||
public Match Match(string input, int startat)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException("input");
|
||||
}
|
||||
if (startat < 0 || startat > input.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("startat");
|
||||
}
|
||||
return this.CreateMachine().Scan(this, input, startat, input.Length);
|
||||
}
|
||||
|
||||
/// <summary>Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position and searching only the specified number of characters.</summary>
|
||||
/// <returns>An object that contains information about the match.</returns>
|
||||
/// <param name="input">The string to be tested for a match. </param>
|
||||
/// <param name="beginning">The zero-based character position in the input string at which to begin the search. </param>
|
||||
/// <param name="length">The number of characters in the substring to include in the search. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="beginning" /> is less than zero or greater than the length of <paramref name="input" />.-or-<paramref name="length" /> is less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001950 RID: 6480 RVA: 0x000566B8 File Offset: 0x000548B8
|
||||
public Match Match(string input, int startat, int length)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException("input");
|
||||
}
|
||||
if (startat < 0 || startat > input.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("startat");
|
||||
}
|
||||
if (length < 0 || length > input.Length - startat)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("length");
|
||||
}
|
||||
return this.CreateMachine().Scan(this, input, startat, startat + length);
|
||||
}
|
||||
|
||||
/// <summary>Searches the specified input string for all occurrences of a regular expression.</summary>
|
||||
/// <returns>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001951 RID: 6481 RVA: 0x00056728 File Offset: 0x00054928
|
||||
public MatchCollection Matches(string input)
|
||||
{
|
||||
return this.Matches(input, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Searches the specified input string for all occurrences of a regular expression, beginning at the specified starting position in the string.</summary>
|
||||
/// <returns>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="startat">The character position in the input string at which to start the search. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startat" /> is less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001952 RID: 6482 RVA: 0x00056738 File Offset: 0x00054938
|
||||
public MatchCollection Matches(string input, int startat)
|
||||
{
|
||||
Match match = this.Match(input, startat);
|
||||
return new MatchCollection(match);
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="evaluator">A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="evaluator" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001953 RID: 6483 RVA: 0x00056754 File Offset: 0x00054954
|
||||
public string Replace(string input, MatchEvaluator evaluator)
|
||||
{
|
||||
return this.Replace(input, evaluator, int.MaxValue, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="evaluator">A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||||
/// <param name="count">The maximum number of times the replacement will occur. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="evaluator" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001954 RID: 6484 RVA: 0x0005676C File Offset: 0x0005496C
|
||||
public string Replace(string input, MatchEvaluator evaluator, int count)
|
||||
{
|
||||
return this.Replace(input, evaluator, count, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input substring, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="evaluator">A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||||
/// <param name="count">The maximum number of times the replacement will occur. </param>
|
||||
/// <param name="startat">The character position in the input string where the search begins. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="evaluator" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startat" /> is less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001955 RID: 6485 RVA: 0x00056780 File Offset: 0x00054980
|
||||
public string Replace(string input, MatchEvaluator evaluator, int count, int startat)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException("input");
|
||||
}
|
||||
if (evaluator == null)
|
||||
{
|
||||
throw new ArgumentNullException("evaluator");
|
||||
}
|
||||
if (count < -1)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
if (startat < 0 || startat > input.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("startat");
|
||||
}
|
||||
BaseMachine baseMachine = (BaseMachine)this.CreateMachine();
|
||||
if (this.RightToLeft)
|
||||
{
|
||||
return baseMachine.RTLReplace(this, input, evaluator, count, startat);
|
||||
}
|
||||
Regex.Adapter adapter = new Regex.Adapter(evaluator);
|
||||
return baseMachine.LTRReplace(this, input, new BaseMachine.MatchAppendEvaluator(adapter.Evaluate), count, startat);
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces all strings that match a regular expression pattern with a specified replacement string. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="replacement">The replacement string. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="replacement" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001956 RID: 6486 RVA: 0x00056824 File Offset: 0x00054A24
|
||||
public string Replace(string input, string replacement)
|
||||
{
|
||||
return this.Replace(input, replacement, int.MaxValue, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="replacement">The replacement string. </param>
|
||||
/// <param name="count">The maximum number of times the replacement can occur. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="replacement" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001957 RID: 6487 RVA: 0x0005683C File Offset: 0x00054A3C
|
||||
public string Replace(string input, string replacement, int count)
|
||||
{
|
||||
return this.Replace(input, replacement, count, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Within a specified input substring, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string. </summary>
|
||||
/// <returns>A new string that is identical to the input string, except that a replacement string takes the place of each matched string.</returns>
|
||||
/// <param name="input">The string to search for a match. </param>
|
||||
/// <param name="replacement">The replacement string. </param>
|
||||
/// <param name="count">Maximum number of times the replacement can occur. </param>
|
||||
/// <param name="startat">The character position in the input string where the search begins. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.-or-<paramref name="replacement" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startat" /> is less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001958 RID: 6488 RVA: 0x00056850 File Offset: 0x00054A50
|
||||
public string Replace(string input, string replacement, int count, int startat)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException("input");
|
||||
}
|
||||
if (replacement == null)
|
||||
{
|
||||
throw new ArgumentNullException("replacement");
|
||||
}
|
||||
if (count < -1)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
if (startat < 0 || startat > input.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("startat");
|
||||
}
|
||||
return this.CreateMachine().Replace(this, input, replacement, count, startat);
|
||||
}
|
||||
|
||||
/// <summary>Splits the specified input string at the positions defined by a regular expression pattern specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</summary>
|
||||
/// <returns>An array of strings.</returns>
|
||||
/// <param name="input">The string to split. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x06001959 RID: 6489 RVA: 0x000568C4 File Offset: 0x00054AC4
|
||||
public string[] Split(string input)
|
||||
{
|
||||
return this.Split(input, int.MaxValue, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Splits the specified input string a specified maximum number of times at the positions defined by a regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</summary>
|
||||
/// <returns>An array of strings.</returns>
|
||||
/// <param name="input">The string to be split. </param>
|
||||
/// <param name="count">The maximum number of times the split can occur. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600195A RID: 6490 RVA: 0x000568DC File Offset: 0x00054ADC
|
||||
public string[] Split(string input, int count)
|
||||
{
|
||||
return this.Split(input, count, this.default_startat(input));
|
||||
}
|
||||
|
||||
/// <summary>Splits the specified input string a specified maximum number of times at the positions defined by a regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor. The search for the regular expression pattern starts at a specified character position in the input string.</summary>
|
||||
/// <returns>An array of strings.</returns>
|
||||
/// <param name="input">The string to be split. </param>
|
||||
/// <param name="count">The maximum number of times the split can occur. </param>
|
||||
/// <param name="startat">The character position in the input string where the search will begin. </param>
|
||||
/// <exception cref="T:System.ArgumentNullException">
|
||||
/// <paramref name="input" /> is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentOutOfRangeException">
|
||||
/// <paramref name="startat" /> is less than zero or greater than the length of <paramref name="input" />.</exception>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
|
||||
/// </PermissionSet>
|
||||
// Token: 0x0600195B RID: 6491 RVA: 0x000568F0 File Offset: 0x00054AF0
|
||||
public string[] Split(string input, int count, int startat)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
throw new ArgumentNullException("input");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count");
|
||||
}
|
||||
if (startat < 0 || startat > input.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("startat");
|
||||
}
|
||||
return this.CreateMachine().Split(this, input, count, startat);
|
||||
}
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
/// <exception cref="T:System.NotSupportedException">References have already been initialized. </exception>
|
||||
// Token: 0x0600195C RID: 6492 RVA: 0x00056950 File Offset: 0x00054B50
|
||||
protected void InitializeReferences()
|
||||
{
|
||||
if (this.refsInitialized)
|
||||
{
|
||||
throw new NotSupportedException("This operation is only allowed once per object.");
|
||||
}
|
||||
this.refsInitialized = true;
|
||||
this.Init();
|
||||
}
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method.</summary>
|
||||
/// <returns>true if the <see cref="P:System.Text.RegularExpressions.Regex.Options" /> property contains the <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> option; otherwise, false.</returns>
|
||||
// Token: 0x0600195D RID: 6493 RVA: 0x00056978 File Offset: 0x00054B78
|
||||
protected bool UseOptionR()
|
||||
{
|
||||
return (this.roptions & RegexOptions.RightToLeft) != RegexOptions.None;
|
||||
}
|
||||
|
||||
/// <summary>Returns the regular expression pattern that was passed into the Regex constructor.</summary>
|
||||
/// <returns>The <paramref name="pattern" /> parameter that was passed into the Regex constructor.</returns>
|
||||
// Token: 0x0600195E RID: 6494 RVA: 0x0005698C File Offset: 0x00054B8C
|
||||
public override string ToString()
|
||||
{
|
||||
return this.pattern;
|
||||
}
|
||||
|
||||
// Token: 0x170007EB RID: 2027
|
||||
// (get) Token: 0x0600195F RID: 6495 RVA: 0x00056994 File Offset: 0x00054B94
|
||||
internal int GroupCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.group_count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007EC RID: 2028
|
||||
// (get) Token: 0x06001960 RID: 6496 RVA: 0x0005699C File Offset: 0x00054B9C
|
||||
internal int Gap
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.gap;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001961 RID: 6497 RVA: 0x000569A4 File Offset: 0x00054BA4
|
||||
private IMachine CreateMachine()
|
||||
{
|
||||
return this.machineFactory.NewInstance();
|
||||
}
|
||||
|
||||
// Token: 0x06001962 RID: 6498 RVA: 0x000569B4 File Offset: 0x00054BB4
|
||||
private static string[] GetGroupNamesArray(int groupCount, IDictionary mapping)
|
||||
{
|
||||
string[] array = new string[groupCount + 1];
|
||||
IDictionaryEnumerator enumerator = mapping.GetEnumerator();
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
array[(int)enumerator.Value] = (string)enumerator.Key;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x170007ED RID: 2029
|
||||
// (get) Token: 0x06001963 RID: 6499 RVA: 0x000569FC File Offset: 0x00054BFC
|
||||
private int[] GroupNumbers
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.group_numbers == null)
|
||||
{
|
||||
this.group_numbers = new int[1 + this.group_count];
|
||||
for (int i = 0; i < this.gap; i++)
|
||||
{
|
||||
this.group_numbers[i] = i;
|
||||
}
|
||||
for (int j = this.gap; j <= this.group_count; j++)
|
||||
{
|
||||
this.group_numbers[j] = int.Parse(this.group_names[j]);
|
||||
}
|
||||
return this.group_numbers;
|
||||
}
|
||||
return this.group_numbers;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040013D4 RID: 5076
|
||||
private static FactoryCache cache = new FactoryCache(15);
|
||||
|
||||
// Token: 0x040013D5 RID: 5077
|
||||
private IMachineFactory machineFactory;
|
||||
|
||||
// Token: 0x040013D6 RID: 5078
|
||||
private IDictionary mapping;
|
||||
|
||||
// Token: 0x040013D7 RID: 5079
|
||||
private int group_count;
|
||||
|
||||
// Token: 0x040013D8 RID: 5080
|
||||
private int gap;
|
||||
|
||||
// Token: 0x040013D9 RID: 5081
|
||||
private bool refsInitialized;
|
||||
|
||||
// Token: 0x040013DA RID: 5082
|
||||
private string[] group_names;
|
||||
|
||||
// Token: 0x040013DB RID: 5083
|
||||
private int[] group_numbers;
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
// Token: 0x040013DC RID: 5084
|
||||
protected internal string pattern;
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
// Token: 0x040013DD RID: 5085
|
||||
protected internal RegexOptions roptions;
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
// Token: 0x040013DE RID: 5086
|
||||
[global::System.MonoTODO]
|
||||
internal Dictionary<string, int> capnames;
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
// Token: 0x040013DF RID: 5087
|
||||
[global::System.MonoTODO]
|
||||
internal Dictionary<int, int> caps;
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
// Token: 0x040013E0 RID: 5088
|
||||
[global::System.MonoTODO]
|
||||
protected internal int capsize;
|
||||
|
||||
/// <summary>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </summary>
|
||||
// Token: 0x040013E1 RID: 5089
|
||||
[global::System.MonoTODO]
|
||||
protected internal string[] capslist;
|
||||
|
||||
// Token: 0x020002B3 RID: 691
|
||||
private class Adapter
|
||||
{
|
||||
// Token: 0x06001964 RID: 6500 RVA: 0x00056A88 File Offset: 0x00054C88
|
||||
public Adapter(MatchEvaluator ev)
|
||||
{
|
||||
this.ev = ev;
|
||||
}
|
||||
|
||||
// Token: 0x06001965 RID: 6501 RVA: 0x00056A98 File Offset: 0x00054C98
|
||||
public void Evaluate(Match m, StringBuilder sb)
|
||||
{
|
||||
sb.Append(this.ev(m));
|
||||
}
|
||||
|
||||
// Token: 0x040013E2 RID: 5090
|
||||
private MatchEvaluator ev;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Provides information about a regular expression that is used to compile a regular expression to a stand-alone assembly. </summary>
|
||||
// Token: 0x020002B4 RID: 692
|
||||
[Serializable]
|
||||
public class RegexCompilationInfo
|
||||
{
|
||||
/// <summary>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.RegexCompilationInfo" /> class that contains information about a regular expression to be included in an assembly. </summary>
|
||||
/// <param name="pattern">The regular expression to compile. </param>
|
||||
/// <param name="options">The regular expression options to use when compiling the regular expression. </param>
|
||||
/// <param name="name">The name of the type that represents the compiled regular expression. </param>
|
||||
/// <param name="fullnamespace">The namespace to which the new type belongs. </param>
|
||||
/// <param name="ispublic">true to make the compiled regular expression publicly visible; otherwise, false. </param>
|
||||
// Token: 0x06001966 RID: 6502 RVA: 0x00056AB0 File Offset: 0x00054CB0
|
||||
public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic)
|
||||
{
|
||||
this.Pattern = pattern;
|
||||
this.Options = options;
|
||||
this.Name = name;
|
||||
this.Namespace = fullnamespace;
|
||||
this.IsPublic = ispublic;
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets a value that indicates whether the compiled regular expression has public visibility.</summary>
|
||||
/// <returns>true if the regular expression has public visibility; otherwise, false.</returns>
|
||||
// Token: 0x170007EE RID: 2030
|
||||
// (get) Token: 0x06001967 RID: 6503 RVA: 0x00056AE8 File Offset: 0x00054CE8
|
||||
// (set) Token: 0x06001968 RID: 6504 RVA: 0x00056AF0 File Offset: 0x00054CF0
|
||||
public bool IsPublic
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isPublic;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.isPublic = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the name of the type that represents the compiled regular expression.</summary>
|
||||
/// <returns>The name of the new type.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The value for this property is null.</exception>
|
||||
/// <exception cref="T:System.ArgumentException">The value for this property is an empty string.</exception>
|
||||
// Token: 0x170007EF RID: 2031
|
||||
// (get) Token: 0x06001969 RID: 6505 RVA: 0x00056AFC File Offset: 0x00054CFC
|
||||
// (set) Token: 0x0600196A RID: 6506 RVA: 0x00056B04 File Offset: 0x00054D04
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("Name");
|
||||
}
|
||||
if (value.Length == 0)
|
||||
{
|
||||
throw new ArgumentException("Name");
|
||||
}
|
||||
this.name = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the namespace to which the new type belongs.</summary>
|
||||
/// <returns>The namespace of the new type.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The value for this property is null.</exception>
|
||||
// Token: 0x170007F0 RID: 2032
|
||||
// (get) Token: 0x0600196B RID: 6507 RVA: 0x00056B40 File Offset: 0x00054D40
|
||||
// (set) Token: 0x0600196C RID: 6508 RVA: 0x00056B48 File Offset: 0x00054D48
|
||||
public string Namespace
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.nspace;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("Namespace");
|
||||
}
|
||||
this.nspace = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the options to use when compiling the regular expression.</summary>
|
||||
/// <returns>A bitwise combination of the enumeration values.</returns>
|
||||
// Token: 0x170007F1 RID: 2033
|
||||
// (get) Token: 0x0600196D RID: 6509 RVA: 0x00056B64 File Offset: 0x00054D64
|
||||
// (set) Token: 0x0600196E RID: 6510 RVA: 0x00056B6C File Offset: 0x00054D6C
|
||||
public RegexOptions Options
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.options;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.options = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets or sets the regular expression to compile.</summary>
|
||||
/// <returns>The regular expression to compile.</returns>
|
||||
/// <exception cref="T:System.ArgumentNullException">The value for this property is null.</exception>
|
||||
// Token: 0x170007F2 RID: 2034
|
||||
// (get) Token: 0x0600196F RID: 6511 RVA: 0x00056B78 File Offset: 0x00054D78
|
||||
// (set) Token: 0x06001970 RID: 6512 RVA: 0x00056B80 File Offset: 0x00054D80
|
||||
public string Pattern
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pattern;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("pattern");
|
||||
}
|
||||
this.pattern = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040013E3 RID: 5091
|
||||
private string pattern;
|
||||
|
||||
// Token: 0x040013E4 RID: 5092
|
||||
private string name;
|
||||
|
||||
// Token: 0x040013E5 RID: 5093
|
||||
private string nspace;
|
||||
|
||||
// Token: 0x040013E6 RID: 5094
|
||||
private RegexOptions options;
|
||||
|
||||
// Token: 0x040013E7 RID: 5095
|
||||
private bool isPublic;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
/// <summary>Provides enumerated values to use to set regular expression options.</summary>
|
||||
// Token: 0x020002B5 RID: 693
|
||||
[Flags]
|
||||
public enum RegexOptions
|
||||
{
|
||||
/// <summary>Specifies that no options are set.</summary>
|
||||
// Token: 0x040013E9 RID: 5097
|
||||
None = 0,
|
||||
/// <summary>Specifies case-insensitive matching.</summary>
|
||||
// Token: 0x040013EA RID: 5098
|
||||
IgnoreCase = 1,
|
||||
/// <summary>Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.</summary>
|
||||
// Token: 0x040013EB RID: 5099
|
||||
Multiline = 2,
|
||||
/// <summary>Specifies that the only valid captures are explicitly named or numbered groups of the form (?<name>…). This allows unnamed parentheses to act as noncapturing groups without the syntactic clumsiness of the expression (?:…).</summary>
|
||||
// Token: 0x040013EC RID: 5100
|
||||
ExplicitCapture = 4,
|
||||
/// <summary>Specifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).</summary>
|
||||
// Token: 0x040013ED RID: 5101
|
||||
Singleline = 16,
|
||||
/// <summary>Eliminates unescaped white space from the pattern and enables comments marked with #. However, the <see cref="F:System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace" /> value does not affect or eliminate white space in character classes. </summary>
|
||||
// Token: 0x040013EE RID: 5102
|
||||
IgnorePatternWhitespace = 32,
|
||||
/// <summary>Specifies that the search will be from right to left instead of from left to right.</summary>
|
||||
// Token: 0x040013EF RID: 5103
|
||||
RightToLeft = 64,
|
||||
/// <summary>Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the <see cref="F:System.Text.RegularExpressions.RegexOptions.IgnoreCase" />, <see cref="F:System.Text.RegularExpressions.RegexOptions.Multiline" />, and <see cref="F:System.Text.RegularExpressions.RegexOptions.Compiled" /> values. The use of this value with any other values results in an exception.</summary>
|
||||
// Token: 0x040013F0 RID: 5104
|
||||
ECMAScript = 256,
|
||||
/// <summary>Specifies that cultural differences in language is ignored. See Performing Culture-Insensitive Operations in the RegularExpressions Namespace for more information.</summary>
|
||||
// Token: 0x040013F1 RID: 5105
|
||||
CultureInvariant = 512
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions.Syntax;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002D7 RID: 727
|
||||
internal class ReplacementEvaluator
|
||||
{
|
||||
// Token: 0x06001A8D RID: 6797 RVA: 0x00061E50 File Offset: 0x00060050
|
||||
public ReplacementEvaluator(Regex regex, string replacement)
|
||||
{
|
||||
this.regex = regex;
|
||||
this.replacement = replacement;
|
||||
this.pieces = null;
|
||||
this.n_pieces = 0;
|
||||
this.Compile();
|
||||
}
|
||||
|
||||
// Token: 0x06001A8E RID: 6798 RVA: 0x00061E88 File Offset: 0x00060088
|
||||
public static string Evaluate(string replacement, Match match)
|
||||
{
|
||||
ReplacementEvaluator replacementEvaluator = new ReplacementEvaluator(match.Regex, replacement);
|
||||
return replacementEvaluator.Evaluate(match);
|
||||
}
|
||||
|
||||
// Token: 0x06001A8F RID: 6799 RVA: 0x00061EAC File Offset: 0x000600AC
|
||||
public string Evaluate(Match match)
|
||||
{
|
||||
if (this.n_pieces == 0)
|
||||
{
|
||||
return this.replacement;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
this.EvaluateAppend(match, stringBuilder);
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
|
||||
// Token: 0x06001A90 RID: 6800 RVA: 0x00061EE0 File Offset: 0x000600E0
|
||||
public void EvaluateAppend(Match match, StringBuilder sb)
|
||||
{
|
||||
if (this.n_pieces == 0)
|
||||
{
|
||||
sb.Append(this.replacement);
|
||||
return;
|
||||
}
|
||||
int i = 0;
|
||||
while (i < this.n_pieces)
|
||||
{
|
||||
int num = this.pieces[i++];
|
||||
if (num >= 0)
|
||||
{
|
||||
int num2 = this.pieces[i++];
|
||||
sb.Append(this.replacement, num, num2);
|
||||
}
|
||||
else if (num < -3)
|
||||
{
|
||||
global::System.Text.RegularExpressions.Group group = match.Groups[-(num + 4)];
|
||||
sb.Append(group.Text, group.Index, group.Length);
|
||||
}
|
||||
else if (num == -1)
|
||||
{
|
||||
sb.Append(match.Text);
|
||||
}
|
||||
else if (num == -2)
|
||||
{
|
||||
sb.Append(match.Text, 0, match.Index);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num3 = match.Index + match.Length;
|
||||
sb.Append(match.Text, num3, match.Text.Length - num3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000823 RID: 2083
|
||||
// (get) Token: 0x06001A91 RID: 6801 RVA: 0x00061FEC File Offset: 0x000601EC
|
||||
public bool NeedsGroupsOrCaptures
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.n_pieces != 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A92 RID: 6802 RVA: 0x00061FFC File Offset: 0x000601FC
|
||||
private void Ensure(int size)
|
||||
{
|
||||
if (this.pieces == null)
|
||||
{
|
||||
int num = 4;
|
||||
if (num < size)
|
||||
{
|
||||
num = size;
|
||||
}
|
||||
this.pieces = new int[num];
|
||||
}
|
||||
else if (size >= this.pieces.Length)
|
||||
{
|
||||
int num = this.pieces.Length + (this.pieces.Length >> 1);
|
||||
if (num < size)
|
||||
{
|
||||
num = size;
|
||||
}
|
||||
int[] array = new int[num];
|
||||
Array.Copy(this.pieces, array, this.n_pieces);
|
||||
this.pieces = array;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A93 RID: 6803 RVA: 0x0006207C File Offset: 0x0006027C
|
||||
private void AddFromReplacement(int start, int end)
|
||||
{
|
||||
if (start == end)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.Ensure(this.n_pieces + 2);
|
||||
this.pieces[this.n_pieces++] = start;
|
||||
this.pieces[this.n_pieces++] = end - start;
|
||||
}
|
||||
|
||||
// Token: 0x06001A94 RID: 6804 RVA: 0x000620D4 File Offset: 0x000602D4
|
||||
private void AddInt(int i)
|
||||
{
|
||||
this.Ensure(this.n_pieces + 1);
|
||||
this.pieces[this.n_pieces++] = i;
|
||||
}
|
||||
|
||||
// Token: 0x06001A95 RID: 6805 RVA: 0x00062108 File Offset: 0x00060308
|
||||
private void Compile()
|
||||
{
|
||||
int num = 0;
|
||||
int i = 0;
|
||||
while (i < this.replacement.Length)
|
||||
{
|
||||
char c = this.replacement[i++];
|
||||
if (c == '$')
|
||||
{
|
||||
if (i == this.replacement.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (this.replacement[i] == '$')
|
||||
{
|
||||
this.AddFromReplacement(num, i);
|
||||
i = (num = i + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = i - 1;
|
||||
int num3 = this.CompileTerm(ref i);
|
||||
if (num3 < 0)
|
||||
{
|
||||
this.AddFromReplacement(num, num2);
|
||||
this.AddInt(num3);
|
||||
num = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num != 0)
|
||||
{
|
||||
this.AddFromReplacement(num, i);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A96 RID: 6806 RVA: 0x000621C4 File Offset: 0x000603C4
|
||||
private int CompileTerm(ref int ptr)
|
||||
{
|
||||
char c = this.replacement[ptr];
|
||||
if (char.IsDigit(c))
|
||||
{
|
||||
int num = global::System.Text.RegularExpressions.Syntax.Parser.ParseDecimal(this.replacement, ref ptr);
|
||||
if (num < 0 || num > this.regex.GroupCount)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return -num - 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr++;
|
||||
char c2 = c;
|
||||
switch (c2)
|
||||
{
|
||||
case '&':
|
||||
return -4;
|
||||
case '\'':
|
||||
return -3;
|
||||
default:
|
||||
{
|
||||
if (c2 == '_')
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (c2 == '`')
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
if (c2 != '{')
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int num2 = -1;
|
||||
string text;
|
||||
try
|
||||
{
|
||||
if (char.IsDigit(this.replacement[ptr]))
|
||||
{
|
||||
num2 = global::System.Text.RegularExpressions.Syntax.Parser.ParseDecimal(this.replacement, ref ptr);
|
||||
text = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = global::System.Text.RegularExpressions.Syntax.Parser.ParseName(this.replacement, ref ptr);
|
||||
}
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
ptr = this.replacement.Length;
|
||||
return 0;
|
||||
}
|
||||
if (ptr == this.replacement.Length || this.replacement[ptr] != '}' || text == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
ptr++;
|
||||
if (text != string.Empty)
|
||||
{
|
||||
num2 = this.regex.GroupNumberFromName(text);
|
||||
}
|
||||
if (num2 < 0 || num2 > this.regex.GroupCount)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return -num2 - 4;
|
||||
}
|
||||
case '+':
|
||||
return -this.regex.GroupCount - 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040015AC RID: 5548
|
||||
private Regex regex;
|
||||
|
||||
// Token: 0x040015AD RID: 5549
|
||||
private int n_pieces;
|
||||
|
||||
// Token: 0x040015AE RID: 5550
|
||||
private int[] pieces;
|
||||
|
||||
// Token: 0x040015AF RID: 5551
|
||||
private string replacement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3207 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002B6 RID: 694
|
||||
internal sealed class RxInterpreter : BaseMachine
|
||||
{
|
||||
// Token: 0x06001971 RID: 6513 RVA: 0x00056B9C File Offset: 0x00054D9C
|
||||
public RxInterpreter(byte[] program, EvalDelegate eval_del)
|
||||
{
|
||||
this.program = program;
|
||||
this.eval_del = eval_del;
|
||||
this.group_count = 1 + ((int)program[1] | ((int)program[2] << 8));
|
||||
this.groups = new int[this.group_count];
|
||||
this.stack = default(RxInterpreter.IntStack);
|
||||
this.ResetGroups();
|
||||
}
|
||||
|
||||
// Token: 0x06001973 RID: 6515 RVA: 0x00056BF8 File Offset: 0x00054DF8
|
||||
private static int ReadInt(byte[] code, int pc)
|
||||
{
|
||||
int num = (int)code[pc];
|
||||
num |= (int)code[pc + 1] << 8;
|
||||
num |= (int)code[pc + 2] << 16;
|
||||
return num | ((int)code[pc + 3] << 24);
|
||||
}
|
||||
|
||||
// Token: 0x06001974 RID: 6516 RVA: 0x00056C2C File Offset: 0x00054E2C
|
||||
public override Match Scan(Regex regex, string text, int start, int end)
|
||||
{
|
||||
this.str = text;
|
||||
this.string_start = start;
|
||||
this.string_end = end;
|
||||
int num = 0;
|
||||
bool flag;
|
||||
if (this.eval_del != null)
|
||||
{
|
||||
flag = this.eval_del(this, start, ref num);
|
||||
}
|
||||
else
|
||||
{
|
||||
flag = this.EvalByteCode(11, start, ref num);
|
||||
}
|
||||
this.marks[this.groups[0]].End = num;
|
||||
if (flag)
|
||||
{
|
||||
return this.GenerateMatch(regex);
|
||||
}
|
||||
return Match.Empty;
|
||||
}
|
||||
|
||||
// Token: 0x06001975 RID: 6517 RVA: 0x00056CAC File Offset: 0x00054EAC
|
||||
private void Open(int gid, int ptr)
|
||||
{
|
||||
int num = this.groups[gid];
|
||||
if (num < this.mark_start || this.marks[num].IsDefined)
|
||||
{
|
||||
num = this.CreateMark(num);
|
||||
this.groups[gid] = num;
|
||||
}
|
||||
this.marks[num].Start = ptr;
|
||||
}
|
||||
|
||||
// Token: 0x06001976 RID: 6518 RVA: 0x00056D08 File Offset: 0x00054F08
|
||||
private void Close(int gid, int ptr)
|
||||
{
|
||||
this.marks[this.groups[gid]].End = ptr;
|
||||
}
|
||||
|
||||
// Token: 0x06001977 RID: 6519 RVA: 0x00056D24 File Offset: 0x00054F24
|
||||
private bool Balance(int gid, int balance_gid, bool capture, int ptr)
|
||||
{
|
||||
int num = this.groups[balance_gid];
|
||||
if (num == -1 || this.marks[num].Index < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (gid > 0 && capture)
|
||||
{
|
||||
this.Open(gid, this.marks[num].Index + this.marks[num].Length);
|
||||
this.Close(gid, ptr);
|
||||
}
|
||||
this.groups[balance_gid] = this.marks[num].Previous;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06001978 RID: 6520 RVA: 0x00056DB4 File Offset: 0x00054FB4
|
||||
private int Checkpoint()
|
||||
{
|
||||
this.mark_start = this.mark_end;
|
||||
return this.mark_start;
|
||||
}
|
||||
|
||||
// Token: 0x06001979 RID: 6521 RVA: 0x00056DC8 File Offset: 0x00054FC8
|
||||
private void Backtrack(int cp)
|
||||
{
|
||||
for (int i = 0; i < this.groups.Length; i++)
|
||||
{
|
||||
int num = this.groups[i];
|
||||
while (cp <= num)
|
||||
{
|
||||
num = this.marks[num].Previous;
|
||||
}
|
||||
this.groups[i] = num;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600197A RID: 6522 RVA: 0x00056E20 File Offset: 0x00055020
|
||||
private void ResetGroups()
|
||||
{
|
||||
int num = this.groups.Length;
|
||||
if (this.marks == null)
|
||||
{
|
||||
this.marks = new Mark[num];
|
||||
}
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
this.groups[i] = i;
|
||||
this.marks[i].Start = -1;
|
||||
this.marks[i].End = -1;
|
||||
this.marks[i].Previous = -1;
|
||||
}
|
||||
this.mark_start = 0;
|
||||
this.mark_end = num;
|
||||
}
|
||||
|
||||
// Token: 0x0600197B RID: 6523 RVA: 0x00056EAC File Offset: 0x000550AC
|
||||
private int GetLastDefined(int gid)
|
||||
{
|
||||
int num = this.groups[gid];
|
||||
while (num >= 0 && !this.marks[num].IsDefined)
|
||||
{
|
||||
num = this.marks[num].Previous;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x0600197C RID: 6524 RVA: 0x00056EF8 File Offset: 0x000550F8
|
||||
private int CreateMark(int previous)
|
||||
{
|
||||
if (this.mark_end == this.marks.Length)
|
||||
{
|
||||
Mark[] array = new Mark[this.marks.Length * 2];
|
||||
this.marks.CopyTo(array, 0);
|
||||
this.marks = array;
|
||||
}
|
||||
int num = this.mark_end++;
|
||||
this.marks[num].Start = (this.marks[num].End = -1);
|
||||
this.marks[num].Previous = previous;
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x0600197D RID: 6525 RVA: 0x00056F88 File Offset: 0x00055188
|
||||
private void GetGroupInfo(int gid, out int first_mark_index, out int n_caps)
|
||||
{
|
||||
first_mark_index = -1;
|
||||
n_caps = 0;
|
||||
for (int i = this.groups[gid]; i >= 0; i = this.marks[i].Previous)
|
||||
{
|
||||
if (this.marks[i].IsDefined)
|
||||
{
|
||||
if (first_mark_index < 0)
|
||||
{
|
||||
first_mark_index = i;
|
||||
}
|
||||
n_caps++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600197E RID: 6526 RVA: 0x00056FF0 File Offset: 0x000551F0
|
||||
private void PopulateGroup(Group g, int first_mark_index, int n_caps)
|
||||
{
|
||||
int num = 1;
|
||||
for (int i = this.marks[first_mark_index].Previous; i >= 0; i = this.marks[i].Previous)
|
||||
{
|
||||
if (this.marks[i].IsDefined)
|
||||
{
|
||||
Capture capture = new Capture(this.str, this.marks[i].Index, this.marks[i].Length);
|
||||
g.Captures.SetValue(capture, n_caps - 1 - num);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600197F RID: 6527 RVA: 0x00057090 File Offset: 0x00055290
|
||||
private Match GenerateMatch(Regex regex)
|
||||
{
|
||||
int num;
|
||||
int num2;
|
||||
this.GetGroupInfo(0, out num, out num2);
|
||||
if (!this.needs_groups_or_captures)
|
||||
{
|
||||
return new Match(regex, this, this.str, this.string_end, 0, this.marks[num].Index, this.marks[num].Length);
|
||||
}
|
||||
Match match = new Match(regex, this, this.str, this.string_end, this.groups.Length, this.marks[num].Index, this.marks[num].Length, num2);
|
||||
this.PopulateGroup(match, num, num2);
|
||||
for (int i = 1; i < this.groups.Length; i++)
|
||||
{
|
||||
this.GetGroupInfo(i, out num, out num2);
|
||||
Group group;
|
||||
if (num < 0)
|
||||
{
|
||||
group = Group.Fail;
|
||||
}
|
||||
else
|
||||
{
|
||||
group = new Group(this.str, this.marks[num].Index, this.marks[num].Length, num2);
|
||||
this.PopulateGroup(group, num, num2);
|
||||
}
|
||||
match.Groups.SetValue(group, i);
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
// Token: 0x06001980 RID: 6528 RVA: 0x000571B4 File Offset: 0x000553B4
|
||||
internal void SetStartOfMatch(int pos)
|
||||
{
|
||||
this.marks[this.groups[0]].Start = pos;
|
||||
}
|
||||
|
||||
// Token: 0x06001981 RID: 6529 RVA: 0x000571D0 File Offset: 0x000553D0
|
||||
private static bool IsWordChar(char c)
|
||||
{
|
||||
return char.IsLetterOrDigit(c) || char.GetUnicodeCategory(c) == UnicodeCategory.ConnectorPunctuation;
|
||||
}
|
||||
|
||||
// Token: 0x06001982 RID: 6530 RVA: 0x000571EC File Offset: 0x000553EC
|
||||
private bool EvalByteCode(int pc, int strpos, ref int strpos_result)
|
||||
{
|
||||
int num = 0;
|
||||
int i;
|
||||
int j;
|
||||
int num2;
|
||||
int num33;
|
||||
for (;;)
|
||||
{
|
||||
if (RxInterpreter.trace_rx)
|
||||
{
|
||||
Console.WriteLine("evaluating: {0} at pc: {1}, strpos: {2}, cge: {3}", new object[]
|
||||
{
|
||||
(RxOp)this.program[pc],
|
||||
pc,
|
||||
strpos,
|
||||
num
|
||||
});
|
||||
}
|
||||
switch (this.program[pc])
|
||||
{
|
||||
case 1:
|
||||
return false;
|
||||
case 2:
|
||||
if (num != 0)
|
||||
{
|
||||
pc = num;
|
||||
num = 0;
|
||||
continue;
|
||||
}
|
||||
goto IL_2DF;
|
||||
case 3:
|
||||
pc++;
|
||||
continue;
|
||||
case 4:
|
||||
if (strpos != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 5:
|
||||
if (strpos == 0 || this.str[strpos - 1] == '\n')
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
case 6:
|
||||
if (strpos != this.string_start)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 7:
|
||||
if (strpos != this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 8:
|
||||
if (strpos == this.string_end || this.str[strpos] == '\n')
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
case 9:
|
||||
if (strpos == this.string_end || (strpos == this.string_end - 1 && this.str[strpos] == '\n'))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
case 10:
|
||||
if (this.string_end == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (strpos == 0)
|
||||
{
|
||||
if (RxInterpreter.IsWordChar(this.str[strpos]))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (strpos == this.string_end)
|
||||
{
|
||||
if (RxInterpreter.IsWordChar(this.str[strpos - 1]))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RxInterpreter.IsWordChar(this.str[strpos]) != RxInterpreter.IsWordChar(this.str[strpos - 1]))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (this.string_end == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (strpos == 0)
|
||||
{
|
||||
if (!RxInterpreter.IsWordChar(this.str[strpos]))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (strpos == this.string_end)
|
||||
{
|
||||
if (!RxInterpreter.IsWordChar(this.str[strpos - 1]))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RxInterpreter.IsWordChar(this.str[strpos]) == RxInterpreter.IsWordChar(this.str[strpos - 1]))
|
||||
{
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
i = pc + 2;
|
||||
j = (int)this.program[pc + 1];
|
||||
if (strpos + j > this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[strpos] != (char)this.program[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos++;
|
||||
i++;
|
||||
}
|
||||
pc = num2;
|
||||
continue;
|
||||
case 13:
|
||||
i = pc + 2;
|
||||
j = (int)this.program[pc + 1];
|
||||
if (strpos + j > this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[strpos] != (char)this.program[i] && char.ToLower(this.str[strpos]) != (char)this.program[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos++;
|
||||
i++;
|
||||
}
|
||||
pc = num2;
|
||||
continue;
|
||||
case 14:
|
||||
{
|
||||
i = pc + 2;
|
||||
j = (int)this.program[pc + 1];
|
||||
if (strpos < j)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num3 = strpos - j;
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[num3] != (char)this.program[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
num3++;
|
||||
}
|
||||
strpos -= j;
|
||||
pc = num2;
|
||||
continue;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
i = pc + 2;
|
||||
j = (int)this.program[pc + 1];
|
||||
if (strpos < j)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num4 = strpos - j;
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[num4] != (char)this.program[i] && char.ToLower(this.str[num4]) != (char)this.program[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
num4++;
|
||||
}
|
||||
strpos -= j;
|
||||
pc = num2;
|
||||
continue;
|
||||
}
|
||||
case 16:
|
||||
i = pc + 3;
|
||||
j = (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
if (strpos + j > this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = i + j * 2;
|
||||
while (i < num2)
|
||||
{
|
||||
int num5 = (int)this.program[i] | ((int)this.program[i + 1] << 8);
|
||||
if ((int)this.str[strpos] != num5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos++;
|
||||
i += 2;
|
||||
}
|
||||
pc = num2;
|
||||
continue;
|
||||
case 17:
|
||||
i = pc + 3;
|
||||
j = (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
if (strpos + j > this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = i + j * 2;
|
||||
while (i < num2)
|
||||
{
|
||||
int num6 = (int)this.program[i] | ((int)this.program[i + 1] << 8);
|
||||
if ((int)this.str[strpos] != num6 && (int)char.ToLower(this.str[strpos]) != num6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos++;
|
||||
i += 2;
|
||||
}
|
||||
pc = num2;
|
||||
continue;
|
||||
case 18:
|
||||
{
|
||||
i = pc + 3;
|
||||
j = (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
if (strpos < j)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num7 = strpos - j;
|
||||
num2 = i + j * 2;
|
||||
while (i < num2)
|
||||
{
|
||||
int num8 = (int)this.program[i] | ((int)this.program[i + 1] << 8);
|
||||
if ((int)this.str[num7] != num8)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i += 2;
|
||||
num7 += 2;
|
||||
}
|
||||
strpos -= j;
|
||||
pc = num2;
|
||||
continue;
|
||||
}
|
||||
case 19:
|
||||
{
|
||||
i = pc + 3;
|
||||
j = (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
if (strpos < j)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num9 = strpos - j;
|
||||
num2 = i + j * 2;
|
||||
while (i < num2)
|
||||
{
|
||||
int num10 = (int)this.program[i] | ((int)this.program[i + 1] << 8);
|
||||
if ((int)this.str[num9] != num10 && (int)char.ToLower(this.str[num9]) != num10)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i += 2;
|
||||
num9 += 2;
|
||||
}
|
||||
strpos -= j;
|
||||
pc = num2;
|
||||
continue;
|
||||
}
|
||||
case 20:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c = this.str[strpos];
|
||||
if (c == (char)this.program[pc + 1])
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 21:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c2 = this.str[strpos];
|
||||
if (c2 != (char)this.program[pc + 1])
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 22:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c3 = char.ToLower(this.str[strpos]);
|
||||
if (c3 == (char)this.program[pc + 1])
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 23:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c4 = char.ToLower(this.str[strpos]);
|
||||
if (c4 != (char)this.program[pc + 1])
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 24:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c5 = this.str[strpos - 1];
|
||||
if (c5 == (char)this.program[pc + 1])
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 25:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c6 = this.str[strpos - 1];
|
||||
if (c6 != (char)this.program[pc + 1])
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 26:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c7 = char.ToLower(this.str[strpos - 1]);
|
||||
if (c7 == (char)this.program[pc + 1])
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 27:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c8 = char.ToLower(this.str[strpos - 1]);
|
||||
if (c8 != (char)this.program[pc + 1])
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 28:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c9 = this.str[strpos];
|
||||
if (c9 >= (char)this.program[pc + 1] && c9 <= (char)this.program[pc + 2])
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 29:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c10 = this.str[strpos];
|
||||
if (c10 < (char)this.program[pc + 1] || c10 > (char)this.program[pc + 2])
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 30:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c11 = char.ToLower(this.str[strpos]);
|
||||
if (c11 >= (char)this.program[pc + 1] && c11 <= (char)this.program[pc + 2])
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 31:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c12 = char.ToLower(this.str[strpos]);
|
||||
if (c12 < (char)this.program[pc + 1] || c12 > (char)this.program[pc + 2])
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 32:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c13 = this.str[strpos - 1];
|
||||
if (c13 >= (char)this.program[pc + 1] && c13 <= (char)this.program[pc + 2])
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 33:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c14 = this.str[strpos - 1];
|
||||
if (c14 < (char)this.program[pc + 1] || c14 > (char)this.program[pc + 2])
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 34:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c15 = char.ToLower(this.str[strpos - 1]);
|
||||
if (c15 >= (char)this.program[pc + 1] && c15 <= (char)this.program[pc + 2])
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 35:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c16 = char.ToLower(this.str[strpos - 1]);
|
||||
if (c16 < (char)this.program[pc + 1] || c16 > (char)this.program[pc + 2])
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 36:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c17 = this.str[strpos];
|
||||
int num11 = (int)c17;
|
||||
num11 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num11 >= 0 && num11 < j << 3 && ((int)this.program[pc + 3 + (num11 >> 3)] & (1 << (num11 & 7))) != 0)
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
case 37:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c18 = this.str[strpos];
|
||||
int num12 = (int)c18;
|
||||
num12 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num12 < 0 || num12 >= j << 3 || ((int)this.program[pc + 3 + (num12 >> 3)] & (1 << (num12 & 7))) == 0)
|
||||
{
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 38:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c19 = char.ToLower(this.str[strpos]);
|
||||
int num13 = (int)c19;
|
||||
num13 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num13 >= 0 && num13 < j << 3 && ((int)this.program[pc + 3 + (num13 >> 3)] & (1 << (num13 & 7))) != 0)
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
case 39:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c20 = char.ToLower(this.str[strpos]);
|
||||
int num14 = (int)c20;
|
||||
num14 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num14 < 0 || num14 >= j << 3 || ((int)this.program[pc + 3 + (num14 >> 3)] & (1 << (num14 & 7))) == 0)
|
||||
{
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 40:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c21 = this.str[strpos - 1];
|
||||
int num15 = (int)c21;
|
||||
num15 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num15 >= 0 && num15 < j << 3 && ((int)this.program[pc + 3 + (num15 >> 3)] & (1 << (num15 & 7))) != 0)
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
case 41:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c22 = this.str[strpos - 1];
|
||||
int num16 = (int)c22;
|
||||
num16 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num16 < 0 || num16 >= j << 3 || ((int)this.program[pc + 3 + (num16 >> 3)] & (1 << (num16 & 7))) == 0)
|
||||
{
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 42:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c23 = char.ToLower(this.str[strpos - 1]);
|
||||
int num17 = (int)c23;
|
||||
num17 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num17 >= 0 && num17 < j << 3 && ((int)this.program[pc + 3 + (num17 >> 3)] & (1 << (num17 & 7))) != 0)
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
continue;
|
||||
case 43:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c24 = char.ToLower(this.str[strpos - 1]);
|
||||
int num18 = (int)c24;
|
||||
num18 -= (int)this.program[pc + 1];
|
||||
j = (int)this.program[pc + 2];
|
||||
if (num18 < 0 || num18 >= j << 3 || ((int)this.program[pc + 3 + (num18 >> 3)] & (1 << (num18 & 7))) == 0)
|
||||
{
|
||||
pc += (int)(3 + this.program[pc + 2]);
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 44:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c25 = this.str[strpos];
|
||||
if ((int)c25 == ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 45:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c26 = this.str[strpos];
|
||||
if ((int)c26 != ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 46:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c27 = char.ToLower(this.str[strpos]);
|
||||
if ((int)c27 == ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 47:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c28 = char.ToLower(this.str[strpos]);
|
||||
if ((int)c28 != ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 48:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c29 = this.str[strpos - 1];
|
||||
if ((int)c29 == ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 49:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c30 = this.str[strpos - 1];
|
||||
if ((int)c30 != ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 50:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c31 = char.ToLower(this.str[strpos - 1]);
|
||||
if ((int)c31 == ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 51:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c32 = char.ToLower(this.str[strpos - 1]);
|
||||
if ((int)c32 != ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)))
|
||||
{
|
||||
pc += 3;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 52:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c33 = this.str[strpos];
|
||||
if ((int)c33 >= ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) && (int)c33 <= ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
case 53:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c34 = this.str[strpos];
|
||||
if ((int)c34 < ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) || (int)c34 > ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
pc += 5;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 54:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c35 = char.ToLower(this.str[strpos]);
|
||||
if ((int)c35 >= ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) && (int)c35 <= ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
case 55:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c36 = char.ToLower(this.str[strpos]);
|
||||
if ((int)c36 < ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) || (int)c36 > ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
pc += 5;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 56:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c37 = this.str[strpos - 1];
|
||||
if ((int)c37 >= ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) && (int)c37 <= ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
case 57:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c38 = this.str[strpos - 1];
|
||||
if ((int)c38 < ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) || (int)c38 > ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
pc += 5;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 58:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c39 = char.ToLower(this.str[strpos - 1]);
|
||||
if ((int)c39 >= ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) && (int)c39 <= ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5;
|
||||
continue;
|
||||
case 59:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c40 = char.ToLower(this.str[strpos - 1]);
|
||||
if ((int)c40 < ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8)) || (int)c40 > ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)))
|
||||
{
|
||||
pc += 5;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 60:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c41 = this.str[strpos];
|
||||
int num19 = (int)c41;
|
||||
num19 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num19 >= 0 && num19 < j << 3 && ((int)this.program[pc + 5 + (num19 >> 3)] & (1 << (num19 & 7))) != 0)
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
case 61:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c42 = this.str[strpos];
|
||||
int num20 = (int)c42;
|
||||
num20 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num20 < 0 || num20 >= j << 3 || ((int)this.program[pc + 5 + (num20 >> 3)] & (1 << (num20 & 7))) == 0)
|
||||
{
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 62:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c43 = char.ToLower(this.str[strpos]);
|
||||
int num21 = (int)c43;
|
||||
num21 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num21 >= 0 && num21 < j << 3 && ((int)this.program[pc + 5 + (num21 >> 3)] & (1 << (num21 & 7))) != 0)
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
case 63:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c44 = char.ToLower(this.str[strpos]);
|
||||
int num22 = (int)c44;
|
||||
num22 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num22 < 0 || num22 >= j << 3 || ((int)this.program[pc + 5 + (num22 >> 3)] & (1 << (num22 & 7))) == 0)
|
||||
{
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 64:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c45 = this.str[strpos - 1];
|
||||
int num23 = (int)c45;
|
||||
num23 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num23 >= 0 && num23 < j << 3 && ((int)this.program[pc + 5 + (num23 >> 3)] & (1 << (num23 & 7))) != 0)
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
case 65:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c46 = this.str[strpos - 1];
|
||||
int num24 = (int)c46;
|
||||
num24 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num24 < 0 || num24 >= j << 3 || ((int)this.program[pc + 5 + (num24 >> 3)] & (1 << (num24 & 7))) == 0)
|
||||
{
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 66:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c47 = char.ToLower(this.str[strpos - 1]);
|
||||
int num25 = (int)c47;
|
||||
num25 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num25 >= 0 && num25 < j << 3 && ((int)this.program[pc + 5 + (num25 >> 3)] & (1 << (num25 & 7))) != 0)
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
continue;
|
||||
case 67:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c48 = char.ToLower(this.str[strpos - 1]);
|
||||
int num26 = (int)c48;
|
||||
num26 -= (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
if (num26 < 0 || num26 >= j << 3 || ((int)this.program[pc + 5 + (num26 >> 3)] & (1 << (num26 & 7))) == 0)
|
||||
{
|
||||
pc += 5 + ((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8));
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 68:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c49 = this.str[strpos];
|
||||
if (c49 != '\n')
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 69:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c50 = this.str[strpos];
|
||||
if (c50 == '\n')
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 70:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c51 = this.str[strpos - 1];
|
||||
if (c51 != '\n')
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 71:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c52 = this.str[strpos - 1];
|
||||
if (c52 == '\n')
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 72:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c53 = this.str[strpos];
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 73:
|
||||
goto IL_1C0E;
|
||||
case 74:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c54 = this.str[strpos - 1];
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 75:
|
||||
goto IL_2FF7;
|
||||
case 76:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c55 = this.str[strpos];
|
||||
if (char.IsDigit(c55))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 77:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c56 = this.str[strpos];
|
||||
if (!char.IsDigit(c56))
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 78:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c57 = this.str[strpos - 1];
|
||||
if (char.IsDigit(c57))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 79:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c58 = this.str[strpos - 1];
|
||||
if (!char.IsDigit(c58))
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 80:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c59 = this.str[strpos];
|
||||
if (char.IsLetterOrDigit(c59) || char.GetUnicodeCategory(c59) == UnicodeCategory.ConnectorPunctuation)
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 81:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c60 = this.str[strpos];
|
||||
if (!char.IsLetterOrDigit(c60) && char.GetUnicodeCategory(c60) != UnicodeCategory.ConnectorPunctuation)
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 82:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c61 = this.str[strpos - 1];
|
||||
if (char.IsLetterOrDigit(c61) || char.GetUnicodeCategory(c61) == UnicodeCategory.ConnectorPunctuation)
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 83:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c62 = this.str[strpos - 1];
|
||||
if (!char.IsLetterOrDigit(c62) && char.GetUnicodeCategory(c62) != UnicodeCategory.ConnectorPunctuation)
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 84:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c63 = this.str[strpos];
|
||||
if (char.IsWhiteSpace(c63))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 85:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c64 = this.str[strpos];
|
||||
if (!char.IsWhiteSpace(c64))
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 86:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c65 = this.str[strpos - 1];
|
||||
if (char.IsWhiteSpace(c65))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 87:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c66 = this.str[strpos - 1];
|
||||
if (!char.IsWhiteSpace(c66))
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 88:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c67 = this.str[strpos];
|
||||
if (('a' <= c67 && c67 <= 'z') || ('A' <= c67 && c67 <= 'Z') || ('0' <= c67 && c67 <= '9') || c67 == '_')
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 89:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c68 = this.str[strpos];
|
||||
if (('a' > c68 || c68 > 'z') && ('A' > c68 || c68 > 'Z') && ('0' > c68 || c68 > '9') && c68 != '_')
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 90:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c69 = this.str[strpos - 1];
|
||||
if (('a' <= c69 && c69 <= 'z') || ('A' <= c69 && c69 <= 'Z') || ('0' <= c69 && c69 <= '9') || c69 == '_')
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 91:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c70 = this.str[strpos - 1];
|
||||
if (('a' > c70 || c70 > 'z') && ('A' > c70 || c70 > 'Z') && ('0' > c70 || c70 > '9') && c70 != '_')
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 92:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c71 = this.str[strpos];
|
||||
if (c71 == ' ' || c71 == '\t' || c71 == '\n' || c71 == '\r' || c71 == '\f' || c71 == '\v')
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 93:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c72 = this.str[strpos];
|
||||
if (c72 != ' ' && c72 != '\t' && c72 != '\n' && c72 != '\r' && c72 != '\f' && c72 != '\v')
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 94:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c73 = this.str[strpos - 1];
|
||||
if (c73 == ' ' || c73 == '\t' || c73 == '\n' || c73 == '\r' || c73 == '\f' || c73 == '\v')
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 95:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c74 = this.str[strpos - 1];
|
||||
if (c74 != ' ' && c74 != '\t' && c74 != '\n' && c74 != '\r' && c74 != '\f' && c74 != '\v')
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 96:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c75 = this.str[strpos];
|
||||
if (char.GetUnicodeCategory(c75) == (UnicodeCategory)this.program[pc + 1])
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 97:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c76 = this.str[strpos];
|
||||
if (char.GetUnicodeCategory(c76) != (UnicodeCategory)this.program[pc + 1])
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 98:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c77 = this.str[strpos - 1];
|
||||
if (char.GetUnicodeCategory(c77) == (UnicodeCategory)this.program[pc + 1])
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 99:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c78 = this.str[strpos - 1];
|
||||
if (char.GetUnicodeCategory(c78) != (UnicodeCategory)this.program[pc + 1])
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 124:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c79 = this.str[strpos];
|
||||
if (('\ufeff' <= c79 && c79 <= '\ufeff') || ('\ufff0' <= c79 && c79 <= '\ufffd'))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 125:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c80 = this.str[strpos];
|
||||
if (('\ufeff' > c80 || c80 > '\ufeff') && ('\ufff0' > c80 || c80 > '\ufffd'))
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 126:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c81 = this.str[strpos - 1];
|
||||
if (('\ufeff' <= c81 && c81 <= '\ufeff') || ('\ufff0' <= c81 && c81 <= '\ufffd'))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc++;
|
||||
continue;
|
||||
case 127:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c82 = this.str[strpos - 1];
|
||||
if (('\ufeff' > c82 || c82 > '\ufeff') && ('\ufff0' > c82 || c82 > '\ufffd'))
|
||||
{
|
||||
pc++;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 132:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c83 = this.str[strpos];
|
||||
if (CategoryUtils.IsCategory((Category)this.program[pc + 1], c83))
|
||||
{
|
||||
strpos++;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 133:
|
||||
{
|
||||
if (strpos >= this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c84 = this.str[strpos];
|
||||
if (!CategoryUtils.IsCategory((Category)this.program[pc + 1], c84))
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos++;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 134:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c85 = this.str[strpos - 1];
|
||||
if (CategoryUtils.IsCategory((Category)this.program[pc + 1], c85))
|
||||
{
|
||||
strpos--;
|
||||
if (num != 0)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pc += 2;
|
||||
continue;
|
||||
case 135:
|
||||
{
|
||||
if (strpos <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
char c86 = this.str[strpos - 1];
|
||||
if (!CategoryUtils.IsCategory((Category)this.program[pc + 1], c86))
|
||||
{
|
||||
pc += 2;
|
||||
if (num == 0 || pc + 1 == num)
|
||||
{
|
||||
strpos--;
|
||||
if (pc + 1 == num)
|
||||
{
|
||||
goto IL_3E1B;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 136:
|
||||
j = this.GetLastDefined((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8));
|
||||
if (j < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i = this.marks[j].Index;
|
||||
j = this.marks[j].Length;
|
||||
if (strpos + j > this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[strpos] != this.str[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos++;
|
||||
i++;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 137:
|
||||
j = this.GetLastDefined((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8));
|
||||
if (j < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i = this.marks[j].Index;
|
||||
j = this.marks[j].Length;
|
||||
if (strpos + j > this.string_end)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[strpos] != this.str[i] && char.ToLower(this.str[strpos]) != char.ToLower(this.str[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos++;
|
||||
i++;
|
||||
}
|
||||
pc += 3;
|
||||
continue;
|
||||
case 138:
|
||||
{
|
||||
j = this.GetLastDefined((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8));
|
||||
if (j < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i = this.marks[j].Index;
|
||||
j = this.marks[j].Length;
|
||||
if (strpos - j < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num27 = strpos - j;
|
||||
num2 = i + j;
|
||||
while (i < num2)
|
||||
{
|
||||
if (this.str[num27] != this.str[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
i++;
|
||||
num27++;
|
||||
}
|
||||
strpos -= j;
|
||||
pc += 3;
|
||||
continue;
|
||||
}
|
||||
case 140:
|
||||
this.Open((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8), strpos);
|
||||
pc += 3;
|
||||
continue;
|
||||
case 141:
|
||||
this.Close((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8), strpos);
|
||||
pc += 3;
|
||||
continue;
|
||||
case 142:
|
||||
{
|
||||
int num28 = 0;
|
||||
if (!this.EvalByteCode(pc + 8, strpos, ref num28))
|
||||
{
|
||||
goto Block_58;
|
||||
}
|
||||
int num29 = (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
int num30 = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
bool flag = this.program[pc + 5] > 0;
|
||||
if (!this.Balance(num29, num30, flag, strpos))
|
||||
{
|
||||
goto Block_59;
|
||||
}
|
||||
strpos = num28;
|
||||
pc += (int)this.program[pc + 6] | ((int)this.program[pc + 7] << 8);
|
||||
continue;
|
||||
}
|
||||
case 143:
|
||||
goto IL_BAD;
|
||||
case 144:
|
||||
if (this.GetLastDefined((int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8)) >= 0)
|
||||
{
|
||||
pc += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
pc += (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
}
|
||||
continue;
|
||||
case 145:
|
||||
pc += (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
continue;
|
||||
case 146:
|
||||
{
|
||||
int num31 = 0;
|
||||
if (this.EvalByteCode(pc + 3, strpos, ref num31))
|
||||
{
|
||||
pc += (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
strpos = num31;
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case 147:
|
||||
{
|
||||
int num32 = 0;
|
||||
if (this.EvalByteCode(pc + 5, strpos, ref num32))
|
||||
{
|
||||
pc += (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
pc += (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
case 148:
|
||||
num33 = 0;
|
||||
if (this.EvalByteCode(pc + 3, strpos, ref num33))
|
||||
{
|
||||
goto Block_498;
|
||||
}
|
||||
pc += (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
continue;
|
||||
case 149:
|
||||
num = pc + ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8));
|
||||
pc += 3;
|
||||
continue;
|
||||
case 150:
|
||||
goto IL_4FD;
|
||||
case 151:
|
||||
goto IL_71A;
|
||||
case 152:
|
||||
case 153:
|
||||
goto IL_37FA;
|
||||
case 154:
|
||||
goto IL_3884;
|
||||
case 155:
|
||||
case 156:
|
||||
goto IL_3C23;
|
||||
}
|
||||
break;
|
||||
IL_3E1B:
|
||||
pc = num;
|
||||
num = 0;
|
||||
}
|
||||
goto IL_3DE6;
|
||||
IL_2DF:
|
||||
strpos_result = strpos;
|
||||
return true;
|
||||
IL_4FD:
|
||||
int num34 = (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
int num35 = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
int num36 = pc + 5;
|
||||
RxOp rxOp = (RxOp)(this.program[num36] & byte.MaxValue);
|
||||
bool flag2 = false;
|
||||
if ((rxOp == RxOp.String || rxOp == RxOp.StringIgnoreCase) && pc + num34 == num36 + 2 + (int)this.program[num36 + 1] + 1)
|
||||
{
|
||||
flag2 = true;
|
||||
if (RxInterpreter.trace_rx)
|
||||
{
|
||||
Console.WriteLine(" string anchor at {0}, offset {1}", num36, num35);
|
||||
}
|
||||
}
|
||||
pc += num34;
|
||||
if (this.program[pc] == 4)
|
||||
{
|
||||
if (strpos == 0)
|
||||
{
|
||||
int num37 = strpos;
|
||||
if (this.groups.Length > 1)
|
||||
{
|
||||
this.ResetGroups();
|
||||
this.marks[this.groups[0]].Start = strpos;
|
||||
}
|
||||
if (this.EvalByteCode(pc + 1, strpos, ref num37))
|
||||
{
|
||||
this.marks[this.groups[0]].Start = strpos;
|
||||
if (this.groups.Length > 1)
|
||||
{
|
||||
this.marks[this.groups[0]].End = num37;
|
||||
}
|
||||
strpos_result = num37;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
num2 = this.string_end + 1;
|
||||
while (strpos < num2)
|
||||
{
|
||||
if (flag2 && (rxOp == RxOp.String || rxOp == RxOp.StringIgnoreCase))
|
||||
{
|
||||
int num38 = strpos;
|
||||
if (!this.EvalByteCode(num36, strpos + num35, ref num38))
|
||||
{
|
||||
strpos++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
int num39 = strpos;
|
||||
if (this.groups.Length > 1)
|
||||
{
|
||||
this.ResetGroups();
|
||||
this.marks[this.groups[0]].Start = strpos;
|
||||
}
|
||||
if (this.EvalByteCode(pc, strpos, ref num39))
|
||||
{
|
||||
this.marks[this.groups[0]].Start = strpos;
|
||||
if (this.groups.Length > 1)
|
||||
{
|
||||
this.marks[this.groups[0]].End = num39;
|
||||
}
|
||||
strpos_result = num39;
|
||||
return true;
|
||||
}
|
||||
strpos++;
|
||||
}
|
||||
return false;
|
||||
IL_71A:
|
||||
j = (int)this.program[pc + 3] | ((int)this.program[pc + 4] << 8);
|
||||
pc += (int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8);
|
||||
while (strpos >= 0)
|
||||
{
|
||||
int num40 = strpos;
|
||||
if (this.groups.Length > 1)
|
||||
{
|
||||
this.ResetGroups();
|
||||
this.marks[this.groups[0]].Start = strpos;
|
||||
}
|
||||
if (this.EvalByteCode(pc, strpos, ref num40))
|
||||
{
|
||||
this.marks[this.groups[0]].Start = strpos;
|
||||
if (this.groups.Length > 1)
|
||||
{
|
||||
this.marks[this.groups[0]].End = num40;
|
||||
}
|
||||
strpos_result = num40;
|
||||
return true;
|
||||
}
|
||||
strpos--;
|
||||
}
|
||||
return false;
|
||||
Block_58:
|
||||
Block_59:
|
||||
return false;
|
||||
IL_BAD:
|
||||
goto IL_3E14;
|
||||
IL_1C0E:
|
||||
if (strpos < this.string_end)
|
||||
{
|
||||
char c87 = this.str[strpos];
|
||||
}
|
||||
return false;
|
||||
IL_2FF7:
|
||||
if (strpos > 0)
|
||||
{
|
||||
char c88 = this.str[strpos - 1];
|
||||
}
|
||||
return false;
|
||||
Block_498:
|
||||
strpos_result = num33;
|
||||
return true;
|
||||
IL_37FA:
|
||||
int num41 = 0;
|
||||
this.repeat = new RxInterpreter.RepeatContext(this.repeat, RxInterpreter.ReadInt(this.program, pc + 3), RxInterpreter.ReadInt(this.program, pc + 7), this.program[pc] == 153, pc + 11);
|
||||
int num42 = pc + ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8));
|
||||
if (!this.EvalByteCode(num42, strpos, ref num41))
|
||||
{
|
||||
this.repeat = this.repeat.Previous;
|
||||
return false;
|
||||
}
|
||||
strpos = num41;
|
||||
strpos_result = strpos;
|
||||
return true;
|
||||
IL_3884:
|
||||
RxInterpreter.RepeatContext repeatContext = this.repeat;
|
||||
int num43 = 0;
|
||||
if (this.deep == repeatContext)
|
||||
{
|
||||
goto IL_3E14;
|
||||
}
|
||||
i = repeatContext.Start;
|
||||
int count = repeatContext.Count;
|
||||
while (!repeatContext.IsMinimum)
|
||||
{
|
||||
repeatContext.Count++;
|
||||
repeatContext.Start = strpos;
|
||||
this.deep = repeatContext;
|
||||
if (!this.EvalByteCode(repeatContext.Expression, strpos, ref num43))
|
||||
{
|
||||
repeatContext.Start = i;
|
||||
repeatContext.Count = count;
|
||||
return false;
|
||||
}
|
||||
strpos = num43;
|
||||
if (this.deep != repeatContext)
|
||||
{
|
||||
goto IL_3E14;
|
||||
}
|
||||
}
|
||||
if (strpos == repeatContext.Start)
|
||||
{
|
||||
this.repeat = repeatContext.Previous;
|
||||
this.deep = null;
|
||||
if (this.EvalByteCode(pc + 1, strpos, ref num43))
|
||||
{
|
||||
strpos = num43;
|
||||
goto IL_3E14;
|
||||
}
|
||||
this.repeat = repeatContext;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (repeatContext.IsLazy)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
this.repeat = repeatContext.Previous;
|
||||
this.deep = null;
|
||||
int num44 = this.Checkpoint();
|
||||
if (this.EvalByteCode(pc + 1, strpos, ref num43))
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.Backtrack(num44);
|
||||
this.repeat = repeatContext;
|
||||
if (repeatContext.IsMaximum)
|
||||
{
|
||||
goto Block_508;
|
||||
}
|
||||
repeatContext.Count++;
|
||||
repeatContext.Start = strpos;
|
||||
this.deep = repeatContext;
|
||||
if (!this.EvalByteCode(repeatContext.Expression, strpos, ref num43))
|
||||
{
|
||||
goto Block_509;
|
||||
}
|
||||
strpos = num43;
|
||||
if (this.deep != repeatContext)
|
||||
{
|
||||
goto Block_510;
|
||||
}
|
||||
if (strpos == repeatContext.Start)
|
||||
{
|
||||
goto Block_511;
|
||||
}
|
||||
}
|
||||
strpos = num43;
|
||||
goto IL_3E14;
|
||||
Block_508:
|
||||
return false;
|
||||
Block_509:
|
||||
repeatContext.Start = i;
|
||||
repeatContext.Count = count;
|
||||
return false;
|
||||
Block_510:
|
||||
goto IL_3E14;
|
||||
Block_511:
|
||||
return false;
|
||||
}
|
||||
int count2 = this.stack.Count;
|
||||
while (!repeatContext.IsMaximum)
|
||||
{
|
||||
int num45 = this.Checkpoint();
|
||||
int num46 = strpos;
|
||||
int start = repeatContext.Start;
|
||||
repeatContext.Count++;
|
||||
if (RxInterpreter.trace_rx)
|
||||
{
|
||||
Console.WriteLine("recurse with count {0}.", repeatContext.Count);
|
||||
}
|
||||
repeatContext.Start = strpos;
|
||||
this.deep = repeatContext;
|
||||
if (!this.EvalByteCode(repeatContext.Expression, strpos, ref num43))
|
||||
{
|
||||
repeatContext.Count--;
|
||||
repeatContext.Start = start;
|
||||
this.Backtrack(num45);
|
||||
break;
|
||||
}
|
||||
strpos = num43;
|
||||
if (this.deep != repeatContext)
|
||||
{
|
||||
this.stack.Count = count2;
|
||||
goto IL_3E14;
|
||||
}
|
||||
this.stack.Push(num45);
|
||||
this.stack.Push(num46);
|
||||
if (strpos == repeatContext.Start)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (RxInterpreter.trace_rx)
|
||||
{
|
||||
Console.WriteLine("matching tail: {0} pc={1}", strpos, pc + 1);
|
||||
}
|
||||
this.repeat = repeatContext.Previous;
|
||||
for (;;)
|
||||
{
|
||||
this.deep = null;
|
||||
if (this.EvalByteCode(pc + 1, strpos, ref num43))
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (this.stack.Count == count2)
|
||||
{
|
||||
goto Block_518;
|
||||
}
|
||||
repeatContext.Count--;
|
||||
strpos = this.stack.Pop();
|
||||
this.Backtrack(this.stack.Pop());
|
||||
if (RxInterpreter.trace_rx)
|
||||
{
|
||||
Console.WriteLine("backtracking to {0} expr={1} pc={2}", strpos, repeatContext.Expression, pc);
|
||||
}
|
||||
}
|
||||
strpos = num43;
|
||||
this.stack.Count = count2;
|
||||
goto IL_3E14;
|
||||
Block_518:
|
||||
this.repeat = repeatContext;
|
||||
return false;
|
||||
}
|
||||
IL_3C23:
|
||||
bool flag3 = this.program[pc] == 156;
|
||||
int num47 = 0;
|
||||
int num48 = pc + ((int)this.program[pc + 1] | ((int)this.program[pc + 2] << 8));
|
||||
i = RxInterpreter.ReadInt(this.program, pc + 3);
|
||||
num2 = RxInterpreter.ReadInt(this.program, pc + 7);
|
||||
j = 0;
|
||||
this.deep = null;
|
||||
while (j < i)
|
||||
{
|
||||
if (!this.EvalByteCode(pc + 11, strpos, ref num47))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos = num47;
|
||||
j++;
|
||||
}
|
||||
if (flag3)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
int num49 = this.Checkpoint();
|
||||
if (this.EvalByteCode(num48, strpos, ref num47))
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.Backtrack(num49);
|
||||
if (j >= num2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!this.EvalByteCode(pc + 11, strpos, ref num47))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos = num47;
|
||||
j++;
|
||||
}
|
||||
strpos = num47;
|
||||
}
|
||||
else
|
||||
{
|
||||
int count3 = this.stack.Count;
|
||||
while (j < num2)
|
||||
{
|
||||
int num50 = this.Checkpoint();
|
||||
if (!this.EvalByteCode(pc + 11, strpos, ref num47))
|
||||
{
|
||||
this.Backtrack(num50);
|
||||
break;
|
||||
}
|
||||
this.stack.Push(num50);
|
||||
this.stack.Push(strpos);
|
||||
strpos = num47;
|
||||
j++;
|
||||
}
|
||||
if (num48 <= pc)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
while (!this.EvalByteCode(num48, strpos, ref num47))
|
||||
{
|
||||
if (this.stack.Count == count3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
strpos = this.stack.Pop();
|
||||
this.Backtrack(this.stack.Pop());
|
||||
if (RxInterpreter.trace_rx)
|
||||
{
|
||||
Console.WriteLine("backtracking to: {0}", strpos);
|
||||
}
|
||||
}
|
||||
strpos = num47;
|
||||
this.stack.Count = count3;
|
||||
}
|
||||
goto IL_3E14;
|
||||
IL_3DE6:
|
||||
Console.WriteLine("evaluating: {0} at pc: {1}, strpos: {2}", (RxOp)this.program[pc], pc, strpos);
|
||||
throw new NotSupportedException();
|
||||
IL_3E14:
|
||||
strpos_result = strpos;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x040013F2 RID: 5106
|
||||
private byte[] program;
|
||||
|
||||
// Token: 0x040013F3 RID: 5107
|
||||
private string str;
|
||||
|
||||
// Token: 0x040013F4 RID: 5108
|
||||
private int string_start;
|
||||
|
||||
// Token: 0x040013F5 RID: 5109
|
||||
private int string_end;
|
||||
|
||||
// Token: 0x040013F6 RID: 5110
|
||||
private int group_count;
|
||||
|
||||
// Token: 0x040013F7 RID: 5111
|
||||
private int[] groups;
|
||||
|
||||
// Token: 0x040013F8 RID: 5112
|
||||
private EvalDelegate eval_del;
|
||||
|
||||
// Token: 0x040013F9 RID: 5113
|
||||
private Mark[] marks;
|
||||
|
||||
// Token: 0x040013FA RID: 5114
|
||||
private int mark_start;
|
||||
|
||||
// Token: 0x040013FB RID: 5115
|
||||
private int mark_end;
|
||||
|
||||
// Token: 0x040013FC RID: 5116
|
||||
private RxInterpreter.IntStack stack;
|
||||
|
||||
// Token: 0x040013FD RID: 5117
|
||||
private RxInterpreter.RepeatContext repeat;
|
||||
|
||||
// Token: 0x040013FE RID: 5118
|
||||
private RxInterpreter.RepeatContext deep;
|
||||
|
||||
// Token: 0x040013FF RID: 5119
|
||||
public static readonly bool trace_rx;
|
||||
|
||||
// Token: 0x020002B7 RID: 695
|
||||
internal struct IntStack
|
||||
{
|
||||
// Token: 0x06001983 RID: 6531 RVA: 0x0005B024 File Offset: 0x00059224
|
||||
public int Pop()
|
||||
{
|
||||
return this.values[--this.count];
|
||||
}
|
||||
|
||||
// Token: 0x06001984 RID: 6532 RVA: 0x0005B04C File Offset: 0x0005924C
|
||||
public void Push(int value)
|
||||
{
|
||||
if (this.values == null)
|
||||
{
|
||||
this.values = new int[8];
|
||||
}
|
||||
else if (this.count == this.values.Length)
|
||||
{
|
||||
int num = this.values.Length;
|
||||
num += num >> 1;
|
||||
int[] array = new int[num];
|
||||
for (int i = 0; i < this.count; i++)
|
||||
{
|
||||
array[i] = this.values[i];
|
||||
}
|
||||
this.values = array;
|
||||
}
|
||||
this.values[this.count++] = value;
|
||||
}
|
||||
|
||||
// Token: 0x170007F3 RID: 2035
|
||||
// (get) Token: 0x06001985 RID: 6533 RVA: 0x0005B0E0 File Offset: 0x000592E0
|
||||
public int Top
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.values[this.count - 1];
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007F4 RID: 2036
|
||||
// (get) Token: 0x06001986 RID: 6534 RVA: 0x0005B0F4 File Offset: 0x000592F4
|
||||
// (set) Token: 0x06001987 RID: 6535 RVA: 0x0005B0FC File Offset: 0x000592FC
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.count;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > this.count)
|
||||
{
|
||||
throw new SystemException("can only truncate the stack");
|
||||
}
|
||||
this.count = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001400 RID: 5120
|
||||
private int[] values;
|
||||
|
||||
// Token: 0x04001401 RID: 5121
|
||||
private int count;
|
||||
}
|
||||
|
||||
// Token: 0x020002B8 RID: 696
|
||||
private class RepeatContext
|
||||
{
|
||||
// Token: 0x06001988 RID: 6536 RVA: 0x0005B11C File Offset: 0x0005931C
|
||||
public RepeatContext(RxInterpreter.RepeatContext previous, int min, int max, bool lazy, int expr_pc)
|
||||
{
|
||||
this.previous = previous;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.lazy = lazy;
|
||||
this.expr_pc = expr_pc;
|
||||
this.start = -1;
|
||||
this.count = 0;
|
||||
}
|
||||
|
||||
// Token: 0x170007F5 RID: 2037
|
||||
// (get) Token: 0x06001989 RID: 6537 RVA: 0x0005B158 File Offset: 0x00059358
|
||||
// (set) Token: 0x0600198A RID: 6538 RVA: 0x0005B160 File Offset: 0x00059360
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.count;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.count = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007F6 RID: 2038
|
||||
// (get) Token: 0x0600198B RID: 6539 RVA: 0x0005B16C File Offset: 0x0005936C
|
||||
// (set) Token: 0x0600198C RID: 6540 RVA: 0x0005B174 File Offset: 0x00059374
|
||||
public int Start
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.start;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.start = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007F7 RID: 2039
|
||||
// (get) Token: 0x0600198D RID: 6541 RVA: 0x0005B180 File Offset: 0x00059380
|
||||
public bool IsMinimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.min <= this.count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007F8 RID: 2040
|
||||
// (get) Token: 0x0600198E RID: 6542 RVA: 0x0005B194 File Offset: 0x00059394
|
||||
public bool IsMaximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.max <= this.count;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007F9 RID: 2041
|
||||
// (get) Token: 0x0600198F RID: 6543 RVA: 0x0005B1A8 File Offset: 0x000593A8
|
||||
public bool IsLazy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lazy;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007FA RID: 2042
|
||||
// (get) Token: 0x06001990 RID: 6544 RVA: 0x0005B1B0 File Offset: 0x000593B0
|
||||
public int Expression
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.expr_pc;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170007FB RID: 2043
|
||||
// (get) Token: 0x06001991 RID: 6545 RVA: 0x0005B1B8 File Offset: 0x000593B8
|
||||
public RxInterpreter.RepeatContext Previous
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.previous;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04001402 RID: 5122
|
||||
private int start;
|
||||
|
||||
// Token: 0x04001403 RID: 5123
|
||||
private int min;
|
||||
|
||||
// Token: 0x04001404 RID: 5124
|
||||
private int max;
|
||||
|
||||
// Token: 0x04001405 RID: 5125
|
||||
private bool lazy;
|
||||
|
||||
// Token: 0x04001406 RID: 5126
|
||||
private int expr_pc;
|
||||
|
||||
// Token: 0x04001407 RID: 5127
|
||||
private RxInterpreter.RepeatContext previous;
|
||||
|
||||
// Token: 0x04001408 RID: 5128
|
||||
private int count;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions
|
||||
{
|
||||
// Token: 0x020002B9 RID: 697
|
||||
internal enum RxOp : byte
|
||||
{
|
||||
// Token: 0x0400140A RID: 5130
|
||||
Info,
|
||||
// Token: 0x0400140B RID: 5131
|
||||
False,
|
||||
// Token: 0x0400140C RID: 5132
|
||||
True,
|
||||
// Token: 0x0400140D RID: 5133
|
||||
AnyPosition,
|
||||
// Token: 0x0400140E RID: 5134
|
||||
StartOfString,
|
||||
// Token: 0x0400140F RID: 5135
|
||||
StartOfLine,
|
||||
// Token: 0x04001410 RID: 5136
|
||||
StartOfScan,
|
||||
// Token: 0x04001411 RID: 5137
|
||||
EndOfString,
|
||||
// Token: 0x04001412 RID: 5138
|
||||
EndOfLine,
|
||||
// Token: 0x04001413 RID: 5139
|
||||
End,
|
||||
// Token: 0x04001414 RID: 5140
|
||||
WordBoundary,
|
||||
// Token: 0x04001415 RID: 5141
|
||||
NoWordBoundary,
|
||||
// Token: 0x04001416 RID: 5142
|
||||
String,
|
||||
// Token: 0x04001417 RID: 5143
|
||||
StringIgnoreCase,
|
||||
// Token: 0x04001418 RID: 5144
|
||||
StringReverse,
|
||||
// Token: 0x04001419 RID: 5145
|
||||
StringIgnoreCaseReverse,
|
||||
// Token: 0x0400141A RID: 5146
|
||||
UnicodeString,
|
||||
// Token: 0x0400141B RID: 5147
|
||||
UnicodeStringIgnoreCase,
|
||||
// Token: 0x0400141C RID: 5148
|
||||
UnicodeStringReverse,
|
||||
// Token: 0x0400141D RID: 5149
|
||||
UnicodeStringIgnoreCaseReverse,
|
||||
// Token: 0x0400141E RID: 5150
|
||||
Char,
|
||||
// Token: 0x0400141F RID: 5151
|
||||
NoChar,
|
||||
// Token: 0x04001420 RID: 5152
|
||||
CharIgnoreCase,
|
||||
// Token: 0x04001421 RID: 5153
|
||||
NoCharIgnoreCase,
|
||||
// Token: 0x04001422 RID: 5154
|
||||
CharReverse,
|
||||
// Token: 0x04001423 RID: 5155
|
||||
NoCharReverse,
|
||||
// Token: 0x04001424 RID: 5156
|
||||
CharIgnoreCaseReverse,
|
||||
// Token: 0x04001425 RID: 5157
|
||||
NoCharIgnoreCaseReverse,
|
||||
// Token: 0x04001426 RID: 5158
|
||||
Range,
|
||||
// Token: 0x04001427 RID: 5159
|
||||
NoRange,
|
||||
// Token: 0x04001428 RID: 5160
|
||||
RangeIgnoreCase,
|
||||
// Token: 0x04001429 RID: 5161
|
||||
NoRangeIgnoreCase,
|
||||
// Token: 0x0400142A RID: 5162
|
||||
RangeReverse,
|
||||
// Token: 0x0400142B RID: 5163
|
||||
NoRangeReverse,
|
||||
// Token: 0x0400142C RID: 5164
|
||||
RangeIgnoreCaseReverse,
|
||||
// Token: 0x0400142D RID: 5165
|
||||
NoRangeIgnoreCaseReverse,
|
||||
// Token: 0x0400142E RID: 5166
|
||||
Bitmap,
|
||||
// Token: 0x0400142F RID: 5167
|
||||
NoBitmap,
|
||||
// Token: 0x04001430 RID: 5168
|
||||
BitmapIgnoreCase,
|
||||
// Token: 0x04001431 RID: 5169
|
||||
NoBitmapIgnoreCase,
|
||||
// Token: 0x04001432 RID: 5170
|
||||
BitmapReverse,
|
||||
// Token: 0x04001433 RID: 5171
|
||||
NoBitmapReverse,
|
||||
// Token: 0x04001434 RID: 5172
|
||||
BitmapIgnoreCaseReverse,
|
||||
// Token: 0x04001435 RID: 5173
|
||||
NoBitmapIgnoreCaseReverse,
|
||||
// Token: 0x04001436 RID: 5174
|
||||
UnicodeChar,
|
||||
// Token: 0x04001437 RID: 5175
|
||||
NoUnicodeChar,
|
||||
// Token: 0x04001438 RID: 5176
|
||||
UnicodeCharIgnoreCase,
|
||||
// Token: 0x04001439 RID: 5177
|
||||
NoUnicodeCharIgnoreCase,
|
||||
// Token: 0x0400143A RID: 5178
|
||||
UnicodeCharReverse,
|
||||
// Token: 0x0400143B RID: 5179
|
||||
NoUnicodeCharReverse,
|
||||
// Token: 0x0400143C RID: 5180
|
||||
UnicodeCharIgnoreCaseReverse,
|
||||
// Token: 0x0400143D RID: 5181
|
||||
NoUnicodeCharIgnoreCaseReverse,
|
||||
// Token: 0x0400143E RID: 5182
|
||||
UnicodeRange,
|
||||
// Token: 0x0400143F RID: 5183
|
||||
NoUnicodeRange,
|
||||
// Token: 0x04001440 RID: 5184
|
||||
UnicodeRangeIgnoreCase,
|
||||
// Token: 0x04001441 RID: 5185
|
||||
NoUnicodeRangeIgnoreCase,
|
||||
// Token: 0x04001442 RID: 5186
|
||||
UnicodeRangeReverse,
|
||||
// Token: 0x04001443 RID: 5187
|
||||
NoUnicodeRangeReverse,
|
||||
// Token: 0x04001444 RID: 5188
|
||||
UnicodeRangeIgnoreCaseReverse,
|
||||
// Token: 0x04001445 RID: 5189
|
||||
NoUnicodeRangeIgnoreCaseReverse,
|
||||
// Token: 0x04001446 RID: 5190
|
||||
UnicodeBitmap,
|
||||
// Token: 0x04001447 RID: 5191
|
||||
NoUnicodeBitmap,
|
||||
// Token: 0x04001448 RID: 5192
|
||||
UnicodeBitmapIgnoreCase,
|
||||
// Token: 0x04001449 RID: 5193
|
||||
NoUnicodeBitmapIgnoreCase,
|
||||
// Token: 0x0400144A RID: 5194
|
||||
UnicodeBitmapReverse,
|
||||
// Token: 0x0400144B RID: 5195
|
||||
NoUnicodeBitmapReverse,
|
||||
// Token: 0x0400144C RID: 5196
|
||||
UnicodeBitmapIgnoreCaseReverse,
|
||||
// Token: 0x0400144D RID: 5197
|
||||
NoUnicodeBitmapIgnoreCaseReverse,
|
||||
// Token: 0x0400144E RID: 5198
|
||||
CategoryAny,
|
||||
// Token: 0x0400144F RID: 5199
|
||||
NoCategoryAny,
|
||||
// Token: 0x04001450 RID: 5200
|
||||
CategoryAnyReverse,
|
||||
// Token: 0x04001451 RID: 5201
|
||||
NoCategoryAnyReverse,
|
||||
// Token: 0x04001452 RID: 5202
|
||||
CategoryAnySingleline,
|
||||
// Token: 0x04001453 RID: 5203
|
||||
NoCategoryAnySingleline,
|
||||
// Token: 0x04001454 RID: 5204
|
||||
CategoryAnySinglelineReverse,
|
||||
// Token: 0x04001455 RID: 5205
|
||||
NoCategoryAnySinglelineReverse,
|
||||
// Token: 0x04001456 RID: 5206
|
||||
CategoryDigit,
|
||||
// Token: 0x04001457 RID: 5207
|
||||
NoCategoryDigit,
|
||||
// Token: 0x04001458 RID: 5208
|
||||
CategoryDigitReverse,
|
||||
// Token: 0x04001459 RID: 5209
|
||||
NoCategoryDigitReverse,
|
||||
// Token: 0x0400145A RID: 5210
|
||||
CategoryWord,
|
||||
// Token: 0x0400145B RID: 5211
|
||||
NoCategoryWord,
|
||||
// Token: 0x0400145C RID: 5212
|
||||
CategoryWordReverse,
|
||||
// Token: 0x0400145D RID: 5213
|
||||
NoCategoryWordReverse,
|
||||
// Token: 0x0400145E RID: 5214
|
||||
CategoryWhiteSpace,
|
||||
// Token: 0x0400145F RID: 5215
|
||||
NoCategoryWhiteSpace,
|
||||
// Token: 0x04001460 RID: 5216
|
||||
CategoryWhiteSpaceReverse,
|
||||
// Token: 0x04001461 RID: 5217
|
||||
NoCategoryWhiteSpaceReverse,
|
||||
// Token: 0x04001462 RID: 5218
|
||||
CategoryEcmaWord,
|
||||
// Token: 0x04001463 RID: 5219
|
||||
NoCategoryEcmaWord,
|
||||
// Token: 0x04001464 RID: 5220
|
||||
CategoryEcmaWordReverse,
|
||||
// Token: 0x04001465 RID: 5221
|
||||
NoCategoryEcmaWordReverse,
|
||||
// Token: 0x04001466 RID: 5222
|
||||
CategoryEcmaWhiteSpace,
|
||||
// Token: 0x04001467 RID: 5223
|
||||
NoCategoryEcmaWhiteSpace,
|
||||
// Token: 0x04001468 RID: 5224
|
||||
CategoryEcmaWhiteSpaceReverse,
|
||||
// Token: 0x04001469 RID: 5225
|
||||
NoCategoryEcmaWhiteSpaceReverse,
|
||||
// Token: 0x0400146A RID: 5226
|
||||
CategoryUnicode,
|
||||
// Token: 0x0400146B RID: 5227
|
||||
NoCategoryUnicode,
|
||||
// Token: 0x0400146C RID: 5228
|
||||
CategoryUnicodeReverse,
|
||||
// Token: 0x0400146D RID: 5229
|
||||
NoCategoryUnicodeReverse,
|
||||
// Token: 0x0400146E RID: 5230
|
||||
CategoryUnicodeLetter,
|
||||
// Token: 0x0400146F RID: 5231
|
||||
NoCategoryUnicodeLetter,
|
||||
// Token: 0x04001470 RID: 5232
|
||||
CategoryUnicodeLetterReverse,
|
||||
// Token: 0x04001471 RID: 5233
|
||||
NoCategoryUnicodeLetterReverse,
|
||||
// Token: 0x04001472 RID: 5234
|
||||
CategoryUnicodeMark,
|
||||
// Token: 0x04001473 RID: 5235
|
||||
NoCategoryUnicodeMark,
|
||||
// Token: 0x04001474 RID: 5236
|
||||
CategoryUnicodeMarkReverse,
|
||||
// Token: 0x04001475 RID: 5237
|
||||
NoCategoryUnicodeMarkReverse,
|
||||
// Token: 0x04001476 RID: 5238
|
||||
CategoryUnicodeNumber,
|
||||
// Token: 0x04001477 RID: 5239
|
||||
NoCategoryUnicodeNumber,
|
||||
// Token: 0x04001478 RID: 5240
|
||||
CategoryUnicodeNumberReverse,
|
||||
// Token: 0x04001479 RID: 5241
|
||||
NoCategoryUnicodeNumberReverse,
|
||||
// Token: 0x0400147A RID: 5242
|
||||
CategoryUnicodeSeparator,
|
||||
// Token: 0x0400147B RID: 5243
|
||||
NoCategoryUnicodeSeparator,
|
||||
// Token: 0x0400147C RID: 5244
|
||||
CategoryUnicodeSeparatorReverse,
|
||||
// Token: 0x0400147D RID: 5245
|
||||
NoCategoryUnicodeSeparatorReverse,
|
||||
// Token: 0x0400147E RID: 5246
|
||||
CategoryUnicodePunctuation,
|
||||
// Token: 0x0400147F RID: 5247
|
||||
NoCategoryUnicodePunctuation,
|
||||
// Token: 0x04001480 RID: 5248
|
||||
CategoryUnicodePunctuationReverse,
|
||||
// Token: 0x04001481 RID: 5249
|
||||
NoCategoryUnicodePunctuationReverse,
|
||||
// Token: 0x04001482 RID: 5250
|
||||
CategoryUnicodeSymbol,
|
||||
// Token: 0x04001483 RID: 5251
|
||||
NoCategoryUnicodeSymbol,
|
||||
// Token: 0x04001484 RID: 5252
|
||||
CategoryUnicodeSymbolReverse,
|
||||
// Token: 0x04001485 RID: 5253
|
||||
NoCategoryUnicodeSymbolReverse,
|
||||
// Token: 0x04001486 RID: 5254
|
||||
CategoryUnicodeSpecials,
|
||||
// Token: 0x04001487 RID: 5255
|
||||
NoCategoryUnicodeSpecials,
|
||||
// Token: 0x04001488 RID: 5256
|
||||
CategoryUnicodeSpecialsReverse,
|
||||
// Token: 0x04001489 RID: 5257
|
||||
NoCategoryUnicodeSpecialsReverse,
|
||||
// Token: 0x0400148A RID: 5258
|
||||
CategoryUnicodeOther,
|
||||
// Token: 0x0400148B RID: 5259
|
||||
NoCategoryUnicodeOther,
|
||||
// Token: 0x0400148C RID: 5260
|
||||
CategoryUnicodeOtherReverse,
|
||||
// Token: 0x0400148D RID: 5261
|
||||
NoCategoryUnicodeOtherReverse,
|
||||
// Token: 0x0400148E RID: 5262
|
||||
CategoryGeneral,
|
||||
// Token: 0x0400148F RID: 5263
|
||||
NoCategoryGeneral,
|
||||
// Token: 0x04001490 RID: 5264
|
||||
CategoryGeneralReverse,
|
||||
// Token: 0x04001491 RID: 5265
|
||||
NoCategoryGeneralReverse,
|
||||
// Token: 0x04001492 RID: 5266
|
||||
Reference,
|
||||
// Token: 0x04001493 RID: 5267
|
||||
ReferenceIgnoreCase,
|
||||
// Token: 0x04001494 RID: 5268
|
||||
ReferenceReverse,
|
||||
// Token: 0x04001495 RID: 5269
|
||||
ReferenceIgnoreCaseReverse,
|
||||
// Token: 0x04001496 RID: 5270
|
||||
OpenGroup,
|
||||
// Token: 0x04001497 RID: 5271
|
||||
CloseGroup,
|
||||
// Token: 0x04001498 RID: 5272
|
||||
BalanceStart,
|
||||
// Token: 0x04001499 RID: 5273
|
||||
Balance,
|
||||
// Token: 0x0400149A RID: 5274
|
||||
IfDefined,
|
||||
// Token: 0x0400149B RID: 5275
|
||||
Jump,
|
||||
// Token: 0x0400149C RID: 5276
|
||||
SubExpression,
|
||||
// Token: 0x0400149D RID: 5277
|
||||
Test,
|
||||
// Token: 0x0400149E RID: 5278
|
||||
Branch,
|
||||
// Token: 0x0400149F RID: 5279
|
||||
TestCharGroup,
|
||||
// Token: 0x040014A0 RID: 5280
|
||||
Anchor,
|
||||
// Token: 0x040014A1 RID: 5281
|
||||
AnchorReverse,
|
||||
// Token: 0x040014A2 RID: 5282
|
||||
Repeat,
|
||||
// Token: 0x040014A3 RID: 5283
|
||||
RepeatLazy,
|
||||
// Token: 0x040014A4 RID: 5284
|
||||
Until,
|
||||
// Token: 0x040014A5 RID: 5285
|
||||
FastRepeat,
|
||||
// Token: 0x040014A6 RID: 5286
|
||||
FastRepeatLazy,
|
||||
// Token: 0x040014A7 RID: 5287
|
||||
RepeatInfinite,
|
||||
// Token: 0x040014A8 RID: 5288
|
||||
RepeatInfiniteLazy
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E4 RID: 740
|
||||
internal class Alternation : CompositeExpression
|
||||
{
|
||||
// Token: 0x17000837 RID: 2103
|
||||
// (get) Token: 0x06001AE3 RID: 6883 RVA: 0x000630D8 File Offset: 0x000612D8
|
||||
public ExpressionCollection Alternatives
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AE4 RID: 6884 RVA: 0x000630E0 File Offset: 0x000612E0
|
||||
public void AddAlternative(Expression e)
|
||||
{
|
||||
this.Alternatives.Add(e);
|
||||
}
|
||||
|
||||
// Token: 0x06001AE5 RID: 6885 RVA: 0x000630F0 File Offset: 0x000612F0
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
foreach (object obj in this.Alternatives)
|
||||
{
|
||||
Expression expression = (Expression)obj;
|
||||
LinkRef linkRef2 = cmp.NewLink();
|
||||
cmp.EmitBranch(linkRef2);
|
||||
expression.Compile(cmp, reverse);
|
||||
cmp.EmitJump(linkRef);
|
||||
cmp.ResolveLink(linkRef2);
|
||||
cmp.EmitBranchEnd();
|
||||
}
|
||||
cmp.EmitFalse();
|
||||
cmp.ResolveLink(linkRef);
|
||||
cmp.EmitAlternationEnd();
|
||||
}
|
||||
|
||||
// Token: 0x06001AE6 RID: 6886 RVA: 0x000631A0 File Offset: 0x000613A0
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
base.GetWidth(out min, out max, this.Alternatives.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002EA RID: 746
|
||||
internal class AnchorInfo
|
||||
{
|
||||
// Token: 0x06001B11 RID: 6929 RVA: 0x000639C8 File Offset: 0x00061BC8
|
||||
public AnchorInfo(Expression expr, int width)
|
||||
{
|
||||
this.expr = expr;
|
||||
this.offset = 0;
|
||||
this.width = width;
|
||||
this.str = null;
|
||||
this.ignore = false;
|
||||
this.pos = Position.Any;
|
||||
}
|
||||
|
||||
// Token: 0x06001B12 RID: 6930 RVA: 0x00063A08 File Offset: 0x00061C08
|
||||
public AnchorInfo(Expression expr, int offset, int width, string str, bool ignore)
|
||||
{
|
||||
this.expr = expr;
|
||||
this.offset = offset;
|
||||
this.width = width;
|
||||
this.str = ((!ignore) ? str : str.ToLower());
|
||||
this.ignore = ignore;
|
||||
this.pos = Position.Any;
|
||||
}
|
||||
|
||||
// Token: 0x06001B13 RID: 6931 RVA: 0x00063A5C File Offset: 0x00061C5C
|
||||
public AnchorInfo(Expression expr, int offset, int width, Position pos)
|
||||
{
|
||||
this.expr = expr;
|
||||
this.offset = offset;
|
||||
this.width = width;
|
||||
this.pos = pos;
|
||||
this.str = null;
|
||||
this.ignore = false;
|
||||
}
|
||||
|
||||
// Token: 0x1700083F RID: 2111
|
||||
// (get) Token: 0x06001B14 RID: 6932 RVA: 0x00063A90 File Offset: 0x00061C90
|
||||
public Expression Expression
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.expr;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000840 RID: 2112
|
||||
// (get) Token: 0x06001B15 RID: 6933 RVA: 0x00063A98 File Offset: 0x00061C98
|
||||
public int Offset
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.offset;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000841 RID: 2113
|
||||
// (get) Token: 0x06001B16 RID: 6934 RVA: 0x00063AA0 File Offset: 0x00061CA0
|
||||
public int Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.width;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000842 RID: 2114
|
||||
// (get) Token: 0x06001B17 RID: 6935 RVA: 0x00063AA8 File Offset: 0x00061CA8
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (this.str == null) ? 0 : this.str.Length;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000843 RID: 2115
|
||||
// (get) Token: 0x06001B18 RID: 6936 RVA: 0x00063AC8 File Offset: 0x00061CC8
|
||||
public bool IsUnknownWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.width < 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000844 RID: 2116
|
||||
// (get) Token: 0x06001B19 RID: 6937 RVA: 0x00063AD4 File Offset: 0x00061CD4
|
||||
public bool IsComplete
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Length == this.Width;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000845 RID: 2117
|
||||
// (get) Token: 0x06001B1A RID: 6938 RVA: 0x00063AE4 File Offset: 0x00061CE4
|
||||
public string Substring
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.str;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000846 RID: 2118
|
||||
// (get) Token: 0x06001B1B RID: 6939 RVA: 0x00063AEC File Offset: 0x00061CEC
|
||||
public bool IgnoreCase
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ignore;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000847 RID: 2119
|
||||
// (get) Token: 0x06001B1C RID: 6940 RVA: 0x00063AF4 File Offset: 0x00061CF4
|
||||
public Position Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pos;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000848 RID: 2120
|
||||
// (get) Token: 0x06001B1D RID: 6941 RVA: 0x00063AFC File Offset: 0x00061CFC
|
||||
public bool IsSubstring
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.str != null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000849 RID: 2121
|
||||
// (get) Token: 0x06001B1E RID: 6942 RVA: 0x00063B0C File Offset: 0x00061D0C
|
||||
public bool IsPosition
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pos != Position.Any;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001B1F RID: 6943 RVA: 0x00063B1C File Offset: 0x00061D1C
|
||||
public Interval GetInterval()
|
||||
{
|
||||
return this.GetInterval(0);
|
||||
}
|
||||
|
||||
// Token: 0x06001B20 RID: 6944 RVA: 0x00063B28 File Offset: 0x00061D28
|
||||
public Interval GetInterval(int start)
|
||||
{
|
||||
if (!this.IsSubstring)
|
||||
{
|
||||
return Interval.Empty;
|
||||
}
|
||||
return new Interval(start + this.Offset, start + this.Offset + this.Length - 1);
|
||||
}
|
||||
|
||||
// Token: 0x040015CB RID: 5579
|
||||
private Expression expr;
|
||||
|
||||
// Token: 0x040015CC RID: 5580
|
||||
private Position pos;
|
||||
|
||||
// Token: 0x040015CD RID: 5581
|
||||
private int offset;
|
||||
|
||||
// Token: 0x040015CE RID: 5582
|
||||
private string str;
|
||||
|
||||
// Token: 0x040015CF RID: 5583
|
||||
private int width;
|
||||
|
||||
// Token: 0x040015D0 RID: 5584
|
||||
private bool ignore;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E1 RID: 737
|
||||
internal abstract class Assertion : CompositeExpression
|
||||
{
|
||||
// Token: 0x06001ACD RID: 6861 RVA: 0x00062D80 File Offset: 0x00060F80
|
||||
public Assertion()
|
||||
{
|
||||
base.Expressions.Add(null);
|
||||
base.Expressions.Add(null);
|
||||
}
|
||||
|
||||
// Token: 0x17000830 RID: 2096
|
||||
// (get) Token: 0x06001ACE RID: 6862 RVA: 0x00062DAC File Offset: 0x00060FAC
|
||||
// (set) Token: 0x06001ACF RID: 6863 RVA: 0x00062DBC File Offset: 0x00060FBC
|
||||
public Expression TrueExpression
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions[0];
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Expressions[0] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000831 RID: 2097
|
||||
// (get) Token: 0x06001AD0 RID: 6864 RVA: 0x00062DCC File Offset: 0x00060FCC
|
||||
// (set) Token: 0x06001AD1 RID: 6865 RVA: 0x00062DDC File Offset: 0x00060FDC
|
||||
public Expression FalseExpression
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions[1];
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Expressions[1] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AD2 RID: 6866 RVA: 0x00062DEC File Offset: 0x00060FEC
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
base.GetWidth(out min, out max, 2);
|
||||
if (this.TrueExpression == null || this.FalseExpression == null)
|
||||
{
|
||||
min = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E8 RID: 744
|
||||
internal class BackslashNumber : Reference
|
||||
{
|
||||
// Token: 0x06001B00 RID: 6912 RVA: 0x00063398 File Offset: 0x00061598
|
||||
public BackslashNumber(bool ignore, bool ecma)
|
||||
: base(ignore)
|
||||
{
|
||||
this.ecma = ecma;
|
||||
}
|
||||
|
||||
// Token: 0x06001B01 RID: 6913 RVA: 0x000633A8 File Offset: 0x000615A8
|
||||
public bool ResolveReference(string num_str, Hashtable groups)
|
||||
{
|
||||
if (this.ecma)
|
||||
{
|
||||
int num = 0;
|
||||
for (int i = 1; i < num_str.Length; i++)
|
||||
{
|
||||
if (groups[num_str.Substring(0, i)] != null)
|
||||
{
|
||||
num = i;
|
||||
}
|
||||
}
|
||||
if (num != 0)
|
||||
{
|
||||
base.CapturingGroup = (CapturingGroup)groups[num_str.Substring(0, num)];
|
||||
this.literal = num_str.Substring(num);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (num_str.Length == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int num2 = 0;
|
||||
int num3 = Parser.ParseOctal(num_str, ref num2);
|
||||
if (num3 == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (num3 > 255 && this.ecma)
|
||||
{
|
||||
num3 /= 8;
|
||||
num2--;
|
||||
}
|
||||
num3 &= 255;
|
||||
this.literal = (char)num3 + num_str.Substring(num2);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06001B02 RID: 6914 RVA: 0x00063484 File Offset: 0x00061684
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
if (base.CapturingGroup != null)
|
||||
{
|
||||
base.Compile(cmp, reverse);
|
||||
}
|
||||
if (this.literal != null)
|
||||
{
|
||||
Literal.CompileLiteral(this.literal, cmp, base.IgnoreCase, reverse);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040015C2 RID: 5570
|
||||
private string literal;
|
||||
|
||||
// Token: 0x040015C3 RID: 5571
|
||||
private bool ecma;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002DE RID: 734
|
||||
internal class BalancingGroup : CapturingGroup
|
||||
{
|
||||
// Token: 0x06001ABA RID: 6842 RVA: 0x00062A50 File Offset: 0x00060C50
|
||||
public BalancingGroup()
|
||||
{
|
||||
this.balance = null;
|
||||
}
|
||||
|
||||
// Token: 0x1700082B RID: 2091
|
||||
// (get) Token: 0x06001ABB RID: 6843 RVA: 0x00062A60 File Offset: 0x00060C60
|
||||
// (set) Token: 0x06001ABC RID: 6844 RVA: 0x00062A68 File Offset: 0x00060C68
|
||||
public CapturingGroup Balance
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.balance;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.balance = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001ABD RID: 6845 RVA: 0x00062A74 File Offset: 0x00060C74
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
cmp.EmitBalanceStart(base.Index, this.balance.Index, base.IsNamed, linkRef);
|
||||
int count = base.Expressions.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Expression expression;
|
||||
if (reverse)
|
||||
{
|
||||
expression = base.Expressions[count - i - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
expression = base.Expressions[i];
|
||||
}
|
||||
expression.Compile(cmp, reverse);
|
||||
}
|
||||
cmp.EmitBalance();
|
||||
cmp.ResolveLink(linkRef);
|
||||
}
|
||||
|
||||
// Token: 0x040015B4 RID: 5556
|
||||
private CapturingGroup balance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E2 RID: 738
|
||||
internal class CaptureAssertion : Assertion
|
||||
{
|
||||
// Token: 0x06001AD3 RID: 6867 RVA: 0x00062E1C File Offset: 0x0006101C
|
||||
public CaptureAssertion(Literal l)
|
||||
{
|
||||
this.literal = l;
|
||||
}
|
||||
|
||||
// Token: 0x17000832 RID: 2098
|
||||
// (get) Token: 0x06001AD4 RID: 6868 RVA: 0x00062E2C File Offset: 0x0006102C
|
||||
// (set) Token: 0x06001AD5 RID: 6869 RVA: 0x00062E34 File Offset: 0x00061034
|
||||
public CapturingGroup CapturingGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.group;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.group = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AD6 RID: 6870 RVA: 0x00062E40 File Offset: 0x00061040
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
if (this.group == null)
|
||||
{
|
||||
this.Alternate.Compile(cmp, reverse);
|
||||
return;
|
||||
}
|
||||
int index = this.group.Index;
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
if (base.FalseExpression == null)
|
||||
{
|
||||
cmp.EmitIfDefined(index, linkRef);
|
||||
base.TrueExpression.Compile(cmp, reverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkRef linkRef2 = cmp.NewLink();
|
||||
cmp.EmitIfDefined(index, linkRef2);
|
||||
base.TrueExpression.Compile(cmp, reverse);
|
||||
cmp.EmitJump(linkRef);
|
||||
cmp.ResolveLink(linkRef2);
|
||||
base.FalseExpression.Compile(cmp, reverse);
|
||||
}
|
||||
cmp.ResolveLink(linkRef);
|
||||
}
|
||||
|
||||
// Token: 0x06001AD7 RID: 6871 RVA: 0x00062EDC File Offset: 0x000610DC
|
||||
public override bool IsComplex()
|
||||
{
|
||||
if (this.group == null)
|
||||
{
|
||||
return this.Alternate.IsComplex();
|
||||
}
|
||||
return (base.TrueExpression != null && base.TrueExpression.IsComplex()) || (base.FalseExpression != null && base.FalseExpression.IsComplex()) || base.GetFixedWidth() <= 0;
|
||||
}
|
||||
|
||||
// Token: 0x17000833 RID: 2099
|
||||
// (get) Token: 0x06001AD8 RID: 6872 RVA: 0x00062F48 File Offset: 0x00061148
|
||||
private ExpressionAssertion Alternate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.alternate == null)
|
||||
{
|
||||
this.alternate = new ExpressionAssertion();
|
||||
this.alternate.TrueExpression = base.TrueExpression;
|
||||
this.alternate.FalseExpression = base.FalseExpression;
|
||||
this.alternate.TestExpression = this.literal;
|
||||
}
|
||||
return this.alternate;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040015B8 RID: 5560
|
||||
private ExpressionAssertion alternate;
|
||||
|
||||
// Token: 0x040015B9 RID: 5561
|
||||
private CapturingGroup group;
|
||||
|
||||
// Token: 0x040015BA RID: 5562
|
||||
private Literal literal;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002DD RID: 733
|
||||
internal class CapturingGroup : Group, IComparable
|
||||
{
|
||||
// Token: 0x06001AB1 RID: 6833 RVA: 0x000629B8 File Offset: 0x00060BB8
|
||||
public CapturingGroup()
|
||||
{
|
||||
this.gid = 0;
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
// Token: 0x17000828 RID: 2088
|
||||
// (get) Token: 0x06001AB2 RID: 6834 RVA: 0x000629D0 File Offset: 0x00060BD0
|
||||
// (set) Token: 0x06001AB3 RID: 6835 RVA: 0x000629D8 File Offset: 0x00060BD8
|
||||
public int Index
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.gid;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.gid = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000829 RID: 2089
|
||||
// (get) Token: 0x06001AB4 RID: 6836 RVA: 0x000629E4 File Offset: 0x00060BE4
|
||||
// (set) Token: 0x06001AB5 RID: 6837 RVA: 0x000629EC File Offset: 0x00060BEC
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.name = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700082A RID: 2090
|
||||
// (get) Token: 0x06001AB6 RID: 6838 RVA: 0x000629F8 File Offset: 0x00060BF8
|
||||
public bool IsNamed
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name != null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AB7 RID: 6839 RVA: 0x00062A08 File Offset: 0x00060C08
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
cmp.EmitOpen(this.gid);
|
||||
base.Compile(cmp, reverse);
|
||||
cmp.EmitClose(this.gid);
|
||||
}
|
||||
|
||||
// Token: 0x06001AB8 RID: 6840 RVA: 0x00062A38 File Offset: 0x00060C38
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06001AB9 RID: 6841 RVA: 0x00062A3C File Offset: 0x00060C3C
|
||||
public int CompareTo(object other)
|
||||
{
|
||||
return this.gid - ((CapturingGroup)other).gid;
|
||||
}
|
||||
|
||||
// Token: 0x040015B2 RID: 5554
|
||||
private int gid;
|
||||
|
||||
// Token: 0x040015B3 RID: 5555
|
||||
private string name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E9 RID: 745
|
||||
internal class CharacterClass : Expression
|
||||
{
|
||||
// Token: 0x06001B03 RID: 6915 RVA: 0x000634C4 File Offset: 0x000616C4
|
||||
public CharacterClass(bool negate, bool ignore)
|
||||
{
|
||||
this.negate = negate;
|
||||
this.ignore = ignore;
|
||||
this.intervals = new IntervalCollection();
|
||||
int num = 144;
|
||||
this.pos_cats = new BitArray(num);
|
||||
this.neg_cats = new BitArray(num);
|
||||
}
|
||||
|
||||
// Token: 0x06001B04 RID: 6916 RVA: 0x00063510 File Offset: 0x00061710
|
||||
public CharacterClass(Category cat, bool negate)
|
||||
: this(false, false)
|
||||
{
|
||||
this.AddCategory(cat, negate);
|
||||
}
|
||||
|
||||
// Token: 0x1700083D RID: 2109
|
||||
// (get) Token: 0x06001B06 RID: 6918 RVA: 0x00063534 File Offset: 0x00061734
|
||||
// (set) Token: 0x06001B07 RID: 6919 RVA: 0x0006353C File Offset: 0x0006173C
|
||||
public bool Negate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.negate;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.negate = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700083E RID: 2110
|
||||
// (get) Token: 0x06001B08 RID: 6920 RVA: 0x00063548 File Offset: 0x00061748
|
||||
// (set) Token: 0x06001B09 RID: 6921 RVA: 0x00063550 File Offset: 0x00061750
|
||||
public bool IgnoreCase
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ignore;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ignore = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001B0A RID: 6922 RVA: 0x0006355C File Offset: 0x0006175C
|
||||
public void AddCategory(Category cat, bool negate)
|
||||
{
|
||||
if (negate)
|
||||
{
|
||||
this.neg_cats[(int)cat] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.pos_cats[(int)cat] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001B0B RID: 6923 RVA: 0x00063590 File Offset: 0x00061790
|
||||
public void AddCharacter(char c)
|
||||
{
|
||||
this.AddRange(c, c);
|
||||
}
|
||||
|
||||
// Token: 0x06001B0C RID: 6924 RVA: 0x0006359C File Offset: 0x0006179C
|
||||
public void AddRange(char lo, char hi)
|
||||
{
|
||||
Interval interval = new Interval((int)lo, (int)hi);
|
||||
if (this.ignore)
|
||||
{
|
||||
if (CharacterClass.upper_case_characters.Intersects(interval))
|
||||
{
|
||||
Interval interval2;
|
||||
if (interval.low < CharacterClass.upper_case_characters.low)
|
||||
{
|
||||
interval2 = new Interval(CharacterClass.upper_case_characters.low + 32, interval.high + 32);
|
||||
interval.high = CharacterClass.upper_case_characters.low - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
interval2 = new Interval(interval.low + 32, CharacterClass.upper_case_characters.high + 32);
|
||||
interval.low = CharacterClass.upper_case_characters.high + 1;
|
||||
}
|
||||
this.intervals.Add(interval2);
|
||||
}
|
||||
else if (CharacterClass.upper_case_characters.Contains(interval))
|
||||
{
|
||||
interval.high += 32;
|
||||
interval.low += 32;
|
||||
}
|
||||
}
|
||||
this.intervals.Add(interval);
|
||||
}
|
||||
|
||||
// Token: 0x06001B0D RID: 6925 RVA: 0x00063698 File Offset: 0x00061898
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
IntervalCollection metaCollection = this.intervals.GetMetaCollection(new IntervalCollection.CostDelegate(CharacterClass.GetIntervalCost));
|
||||
int num = metaCollection.Count;
|
||||
for (int i = 0; i < this.pos_cats.Length; i++)
|
||||
{
|
||||
if (this.pos_cats[i] || this.neg_cats[i])
|
||||
{
|
||||
num++;
|
||||
}
|
||||
}
|
||||
if (num == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
if (num > 1)
|
||||
{
|
||||
cmp.EmitIn(linkRef);
|
||||
}
|
||||
foreach (object obj in metaCollection)
|
||||
{
|
||||
Interval interval = (Interval)obj;
|
||||
if (interval.IsDiscontiguous)
|
||||
{
|
||||
BitArray bitArray = new BitArray(interval.Size);
|
||||
foreach (object obj2 in this.intervals)
|
||||
{
|
||||
Interval interval2 = (Interval)obj2;
|
||||
if (interval.Contains(interval2))
|
||||
{
|
||||
for (int j = interval2.low; j <= interval2.high; j++)
|
||||
{
|
||||
bitArray[j - interval.low] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
cmp.EmitSet((char)interval.low, bitArray, this.negate, this.ignore, reverse);
|
||||
}
|
||||
else if (interval.IsSingleton)
|
||||
{
|
||||
cmp.EmitCharacter((char)interval.low, this.negate, this.ignore, reverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp.EmitRange((char)interval.low, (char)interval.high, this.negate, this.ignore, reverse);
|
||||
}
|
||||
}
|
||||
for (int k = 0; k < this.pos_cats.Length; k++)
|
||||
{
|
||||
if (this.pos_cats[k])
|
||||
{
|
||||
if (this.neg_cats[k])
|
||||
{
|
||||
cmp.EmitCategory(Category.AnySingleline, this.negate, reverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp.EmitCategory((Category)k, this.negate, reverse);
|
||||
}
|
||||
}
|
||||
else if (this.neg_cats[k])
|
||||
{
|
||||
cmp.EmitNotCategory((Category)k, this.negate, reverse);
|
||||
}
|
||||
}
|
||||
if (num > 1)
|
||||
{
|
||||
if (this.negate)
|
||||
{
|
||||
cmp.EmitTrue();
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp.EmitFalse();
|
||||
}
|
||||
cmp.ResolveLink(linkRef);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001B0E RID: 6926 RVA: 0x00063964 File Offset: 0x00061B64
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
min = (max = 1);
|
||||
}
|
||||
|
||||
// Token: 0x06001B0F RID: 6927 RVA: 0x0006397C File Offset: 0x00061B7C
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06001B10 RID: 6928 RVA: 0x00063980 File Offset: 0x00061B80
|
||||
private static double GetIntervalCost(Interval i)
|
||||
{
|
||||
if (i.IsDiscontiguous)
|
||||
{
|
||||
return (double)(3 + (i.Size + 15 >> 4));
|
||||
}
|
||||
if (i.IsSingleton)
|
||||
{
|
||||
return 2.0;
|
||||
}
|
||||
return 3.0;
|
||||
}
|
||||
|
||||
// Token: 0x040015C4 RID: 5572
|
||||
private const int distance_between_upper_and_lower_case = 32;
|
||||
|
||||
// Token: 0x040015C5 RID: 5573
|
||||
private static Interval upper_case_characters = new Interval(65, 90);
|
||||
|
||||
// Token: 0x040015C6 RID: 5574
|
||||
private bool negate;
|
||||
|
||||
// Token: 0x040015C7 RID: 5575
|
||||
private bool ignore;
|
||||
|
||||
// Token: 0x040015C8 RID: 5576
|
||||
private BitArray pos_cats;
|
||||
|
||||
// Token: 0x040015C9 RID: 5577
|
||||
private BitArray neg_cats;
|
||||
|
||||
// Token: 0x040015CA RID: 5578
|
||||
private IntervalCollection intervals;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002DA RID: 730
|
||||
internal abstract class CompositeExpression : Expression
|
||||
{
|
||||
// Token: 0x06001AA2 RID: 6818 RVA: 0x000623E8 File Offset: 0x000605E8
|
||||
public CompositeExpression()
|
||||
{
|
||||
this.expressions = new ExpressionCollection();
|
||||
}
|
||||
|
||||
// Token: 0x17000825 RID: 2085
|
||||
// (get) Token: 0x06001AA3 RID: 6819 RVA: 0x000623FC File Offset: 0x000605FC
|
||||
protected ExpressionCollection Expressions
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.expressions;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AA4 RID: 6820 RVA: 0x00062404 File Offset: 0x00060604
|
||||
protected void GetWidth(out int min, out int max, int count)
|
||||
{
|
||||
min = int.MaxValue;
|
||||
max = 0;
|
||||
bool flag = true;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Expression expression = this.Expressions[i];
|
||||
if (expression != null)
|
||||
{
|
||||
flag = false;
|
||||
int num;
|
||||
int num2;
|
||||
expression.GetWidth(out num, out num2);
|
||||
if (num < min)
|
||||
{
|
||||
min = num;
|
||||
}
|
||||
if (num2 > max)
|
||||
{
|
||||
max = num2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
min = (max = 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AA5 RID: 6821 RVA: 0x0006247C File Offset: 0x0006067C
|
||||
public override bool IsComplex()
|
||||
{
|
||||
foreach (object obj in this.Expressions)
|
||||
{
|
||||
Expression expression = (Expression)obj;
|
||||
if (expression.IsComplex())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return base.GetFixedWidth() <= 0;
|
||||
}
|
||||
|
||||
// Token: 0x040015B0 RID: 5552
|
||||
private ExpressionCollection expressions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002D9 RID: 729
|
||||
internal abstract class Expression
|
||||
{
|
||||
// Token: 0x06001A9D RID: 6813
|
||||
public abstract void Compile(ICompiler cmp, bool reverse);
|
||||
|
||||
// Token: 0x06001A9E RID: 6814
|
||||
public abstract void GetWidth(out int min, out int max);
|
||||
|
||||
// Token: 0x06001A9F RID: 6815 RVA: 0x000623B4 File Offset: 0x000605B4
|
||||
public int GetFixedWidth()
|
||||
{
|
||||
int num;
|
||||
int num2;
|
||||
this.GetWidth(out num, out num2);
|
||||
if (num == num2)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Token: 0x06001AA0 RID: 6816 RVA: 0x000623D8 File Offset: 0x000605D8
|
||||
public virtual AnchorInfo GetAnchorInfo(bool reverse)
|
||||
{
|
||||
return new AnchorInfo(this, this.GetFixedWidth());
|
||||
}
|
||||
|
||||
// Token: 0x06001AA1 RID: 6817
|
||||
public abstract bool IsComplex();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E3 RID: 739
|
||||
internal class ExpressionAssertion : Assertion
|
||||
{
|
||||
// Token: 0x06001AD9 RID: 6873 RVA: 0x00062FA4 File Offset: 0x000611A4
|
||||
public ExpressionAssertion()
|
||||
{
|
||||
base.Expressions.Add(null);
|
||||
}
|
||||
|
||||
// Token: 0x17000834 RID: 2100
|
||||
// (get) Token: 0x06001ADA RID: 6874 RVA: 0x00062FB8 File Offset: 0x000611B8
|
||||
// (set) Token: 0x06001ADB RID: 6875 RVA: 0x00062FC0 File Offset: 0x000611C0
|
||||
public bool Reverse
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.reverse;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.reverse = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000835 RID: 2101
|
||||
// (get) Token: 0x06001ADC RID: 6876 RVA: 0x00062FCC File Offset: 0x000611CC
|
||||
// (set) Token: 0x06001ADD RID: 6877 RVA: 0x00062FD4 File Offset: 0x000611D4
|
||||
public bool Negate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.negate;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.negate = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000836 RID: 2102
|
||||
// (get) Token: 0x06001ADE RID: 6878 RVA: 0x00062FE0 File Offset: 0x000611E0
|
||||
// (set) Token: 0x06001ADF RID: 6879 RVA: 0x00062FF0 File Offset: 0x000611F0
|
||||
public Expression TestExpression
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions[2];
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Expressions[2] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AE0 RID: 6880 RVA: 0x00063000 File Offset: 0x00061200
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
LinkRef linkRef2 = cmp.NewLink();
|
||||
if (!this.negate)
|
||||
{
|
||||
cmp.EmitTest(linkRef, linkRef2);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp.EmitTest(linkRef2, linkRef);
|
||||
}
|
||||
this.TestExpression.Compile(cmp, this.reverse);
|
||||
cmp.EmitTrue();
|
||||
if (base.TrueExpression == null)
|
||||
{
|
||||
cmp.ResolveLink(linkRef2);
|
||||
cmp.EmitFalse();
|
||||
cmp.ResolveLink(linkRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp.ResolveLink(linkRef);
|
||||
base.TrueExpression.Compile(cmp, reverse);
|
||||
if (base.FalseExpression == null)
|
||||
{
|
||||
cmp.ResolveLink(linkRef2);
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkRef linkRef3 = cmp.NewLink();
|
||||
cmp.EmitJump(linkRef3);
|
||||
cmp.ResolveLink(linkRef2);
|
||||
base.FalseExpression.Compile(cmp, reverse);
|
||||
cmp.ResolveLink(linkRef3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AE1 RID: 6881 RVA: 0x000630CC File Offset: 0x000612CC
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x040015BB RID: 5563
|
||||
private bool reverse;
|
||||
|
||||
// Token: 0x040015BC RID: 5564
|
||||
private bool negate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002D8 RID: 728
|
||||
internal class ExpressionCollection : CollectionBase
|
||||
{
|
||||
// Token: 0x06001A98 RID: 6808 RVA: 0x00062374 File Offset: 0x00060574
|
||||
public void Add(Expression e)
|
||||
{
|
||||
base.List.Add(e);
|
||||
}
|
||||
|
||||
// Token: 0x17000824 RID: 2084
|
||||
public Expression this[int i]
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Expression)base.List[i];
|
||||
}
|
||||
set
|
||||
{
|
||||
base.List[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A9B RID: 6811 RVA: 0x000623A8 File Offset: 0x000605A8
|
||||
protected override void OnValidate(object o)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002DB RID: 731
|
||||
internal class Group : CompositeExpression
|
||||
{
|
||||
// Token: 0x17000826 RID: 2086
|
||||
// (get) Token: 0x06001AA7 RID: 6823 RVA: 0x0006250C File Offset: 0x0006070C
|
||||
// (set) Token: 0x06001AA8 RID: 6824 RVA: 0x0006251C File Offset: 0x0006071C
|
||||
public Expression Expression
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions[0];
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Expressions[0] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AA9 RID: 6825 RVA: 0x0006252C File Offset: 0x0006072C
|
||||
public void AppendExpression(Expression e)
|
||||
{
|
||||
base.Expressions.Add(e);
|
||||
}
|
||||
|
||||
// Token: 0x06001AAA RID: 6826 RVA: 0x0006253C File Offset: 0x0006073C
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
int count = base.Expressions.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Expression expression;
|
||||
if (reverse)
|
||||
{
|
||||
expression = base.Expressions[count - i - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
expression = base.Expressions[i];
|
||||
}
|
||||
expression.Compile(cmp, reverse);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AAB RID: 6827 RVA: 0x00062598 File Offset: 0x00060798
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
min = 0;
|
||||
max = 0;
|
||||
foreach (object obj in base.Expressions)
|
||||
{
|
||||
Expression expression = (Expression)obj;
|
||||
int num;
|
||||
int num2;
|
||||
expression.GetWidth(out num, out num2);
|
||||
min += num;
|
||||
if (max == 2147483647 || num2 == 2147483647)
|
||||
{
|
||||
max = int.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
max += num2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AAC RID: 6828 RVA: 0x00062644 File Offset: 0x00060844
|
||||
public override AnchorInfo GetAnchorInfo(bool reverse)
|
||||
{
|
||||
int fixedWidth = base.GetFixedWidth();
|
||||
ArrayList arrayList = new ArrayList();
|
||||
IntervalCollection intervalCollection = new IntervalCollection();
|
||||
int num = 0;
|
||||
int count = base.Expressions.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Expression expression;
|
||||
if (reverse)
|
||||
{
|
||||
expression = base.Expressions[count - i - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
expression = base.Expressions[i];
|
||||
}
|
||||
AnchorInfo anchorInfo = expression.GetAnchorInfo(reverse);
|
||||
arrayList.Add(anchorInfo);
|
||||
if (anchorInfo.IsPosition)
|
||||
{
|
||||
return new AnchorInfo(this, num + anchorInfo.Offset, fixedWidth, anchorInfo.Position);
|
||||
}
|
||||
if (anchorInfo.IsSubstring)
|
||||
{
|
||||
intervalCollection.Add(anchorInfo.GetInterval(num));
|
||||
}
|
||||
if (anchorInfo.IsUnknownWidth)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num += anchorInfo.Width;
|
||||
}
|
||||
intervalCollection.Normalize();
|
||||
Interval interval = Interval.Empty;
|
||||
foreach (object obj in intervalCollection)
|
||||
{
|
||||
Interval interval2 = (Interval)obj;
|
||||
if (interval2.Size > interval.Size)
|
||||
{
|
||||
interval = interval2;
|
||||
}
|
||||
}
|
||||
if (interval.IsEmpty)
|
||||
{
|
||||
return new AnchorInfo(this, fixedWidth);
|
||||
}
|
||||
bool flag = false;
|
||||
int num2 = 0;
|
||||
num = 0;
|
||||
for (int j = 0; j < arrayList.Count; j++)
|
||||
{
|
||||
AnchorInfo anchorInfo2 = (AnchorInfo)arrayList[j];
|
||||
if (anchorInfo2.IsSubstring && interval.Contains(anchorInfo2.GetInterval(num)))
|
||||
{
|
||||
flag |= anchorInfo2.IgnoreCase;
|
||||
arrayList[num2++] = anchorInfo2;
|
||||
}
|
||||
if (anchorInfo2.IsUnknownWidth)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num += anchorInfo2.Width;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int k = 0; k < num2; k++)
|
||||
{
|
||||
AnchorInfo anchorInfo3;
|
||||
if (reverse)
|
||||
{
|
||||
anchorInfo3 = (AnchorInfo)arrayList[num2 - k - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
anchorInfo3 = (AnchorInfo)arrayList[k];
|
||||
}
|
||||
stringBuilder.Append(anchorInfo3.Substring);
|
||||
}
|
||||
if (stringBuilder.Length == interval.Size)
|
||||
{
|
||||
return new AnchorInfo(this, interval.low, fixedWidth, stringBuilder.ToString(), flag);
|
||||
}
|
||||
if (stringBuilder.Length > interval.Size)
|
||||
{
|
||||
Console.Error.WriteLine("overlapping?");
|
||||
return new AnchorInfo(this, fixedWidth);
|
||||
}
|
||||
throw new SystemException("Shouldn't happen");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E5 RID: 741
|
||||
internal class Literal : Expression
|
||||
{
|
||||
// Token: 0x06001AE7 RID: 6887 RVA: 0x000631C0 File Offset: 0x000613C0
|
||||
public Literal(string str, bool ignore)
|
||||
{
|
||||
this.str = str;
|
||||
this.ignore = ignore;
|
||||
}
|
||||
|
||||
// Token: 0x17000838 RID: 2104
|
||||
// (get) Token: 0x06001AE8 RID: 6888 RVA: 0x000631D8 File Offset: 0x000613D8
|
||||
// (set) Token: 0x06001AE9 RID: 6889 RVA: 0x000631E0 File Offset: 0x000613E0
|
||||
public string String
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.str;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.str = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000839 RID: 2105
|
||||
// (get) Token: 0x06001AEA RID: 6890 RVA: 0x000631EC File Offset: 0x000613EC
|
||||
// (set) Token: 0x06001AEB RID: 6891 RVA: 0x000631F4 File Offset: 0x000613F4
|
||||
public bool IgnoreCase
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ignore;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ignore = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AEC RID: 6892 RVA: 0x00063200 File Offset: 0x00061400
|
||||
public static void CompileLiteral(string str, ICompiler cmp, bool ignore, bool reverse)
|
||||
{
|
||||
if (str.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (str.Length == 1)
|
||||
{
|
||||
cmp.EmitCharacter(str[0], false, ignore, reverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp.EmitString(str, ignore, reverse);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AED RID: 6893 RVA: 0x00063244 File Offset: 0x00061444
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
Literal.CompileLiteral(this.str, cmp, this.ignore, reverse);
|
||||
}
|
||||
|
||||
// Token: 0x06001AEE RID: 6894 RVA: 0x0006325C File Offset: 0x0006145C
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
min = (max = this.str.Length);
|
||||
}
|
||||
|
||||
// Token: 0x06001AEF RID: 6895 RVA: 0x0006327C File Offset: 0x0006147C
|
||||
public override AnchorInfo GetAnchorInfo(bool reverse)
|
||||
{
|
||||
return new AnchorInfo(this, 0, this.str.Length, this.str, this.ignore);
|
||||
}
|
||||
|
||||
// Token: 0x06001AF0 RID: 6896 RVA: 0x0006329C File Offset: 0x0006149C
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x040015BD RID: 5565
|
||||
private string str;
|
||||
|
||||
// Token: 0x040015BE RID: 5566
|
||||
private bool ignore;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002DF RID: 735
|
||||
internal class NonBacktrackingGroup : Group
|
||||
{
|
||||
// Token: 0x06001ABF RID: 6847 RVA: 0x00062B0C File Offset: 0x00060D0C
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
cmp.EmitSub(linkRef);
|
||||
base.Compile(cmp, reverse);
|
||||
cmp.EmitTrue();
|
||||
cmp.ResolveLink(linkRef);
|
||||
}
|
||||
|
||||
// Token: 0x06001AC0 RID: 6848 RVA: 0x00062B3C File Offset: 0x00060D3C
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,1519 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002D5 RID: 725
|
||||
internal class Parser
|
||||
{
|
||||
// Token: 0x06001A61 RID: 6753 RVA: 0x0005F7D0 File Offset: 0x0005D9D0
|
||||
public Parser()
|
||||
{
|
||||
this.caps = new ArrayList();
|
||||
this.refs = new Hashtable();
|
||||
}
|
||||
|
||||
// Token: 0x06001A62 RID: 6754 RVA: 0x0005F7F0 File Offset: 0x0005D9F0
|
||||
public static int ParseDecimal(string str, ref int ptr)
|
||||
{
|
||||
return Parser.ParseNumber(str, ref ptr, 10, 1, int.MaxValue);
|
||||
}
|
||||
|
||||
// Token: 0x06001A63 RID: 6755 RVA: 0x0005F804 File Offset: 0x0005DA04
|
||||
public static int ParseOctal(string str, ref int ptr)
|
||||
{
|
||||
return Parser.ParseNumber(str, ref ptr, 8, 1, 3);
|
||||
}
|
||||
|
||||
// Token: 0x06001A64 RID: 6756 RVA: 0x0005F810 File Offset: 0x0005DA10
|
||||
public static int ParseHex(string str, ref int ptr, int digits)
|
||||
{
|
||||
return Parser.ParseNumber(str, ref ptr, 16, digits, digits);
|
||||
}
|
||||
|
||||
// Token: 0x06001A65 RID: 6757 RVA: 0x0005F820 File Offset: 0x0005DA20
|
||||
public static int ParseNumber(string str, ref int ptr, int b, int min, int max)
|
||||
{
|
||||
int num = ptr;
|
||||
int num2 = 0;
|
||||
int num3 = 0;
|
||||
if (max < min)
|
||||
{
|
||||
max = int.MaxValue;
|
||||
}
|
||||
while (num3 < max && num < str.Length)
|
||||
{
|
||||
int num4 = Parser.ParseDigit(str[num++], b, num3);
|
||||
if (num4 < 0)
|
||||
{
|
||||
num--;
|
||||
break;
|
||||
}
|
||||
num2 = num2 * b + num4;
|
||||
num3++;
|
||||
}
|
||||
if (num3 < min)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
ptr = num;
|
||||
return num2;
|
||||
}
|
||||
|
||||
// Token: 0x06001A66 RID: 6758 RVA: 0x0005F898 File Offset: 0x0005DA98
|
||||
public static string ParseName(string str, ref int ptr)
|
||||
{
|
||||
if (char.IsDigit(str[ptr]))
|
||||
{
|
||||
int num = Parser.ParseNumber(str, ref ptr, 10, 1, 0);
|
||||
if (num > 0)
|
||||
{
|
||||
return num.ToString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num2 = ptr;
|
||||
while (Parser.IsNameChar(str[ptr]))
|
||||
{
|
||||
ptr++;
|
||||
}
|
||||
if (ptr - num2 > 0)
|
||||
{
|
||||
return str.Substring(num2, ptr - num2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A67 RID: 6759 RVA: 0x0005F918 File Offset: 0x0005DB18
|
||||
public static string Escape(string str)
|
||||
{
|
||||
string text = string.Empty;
|
||||
int i = 0;
|
||||
while (i < str.Length)
|
||||
{
|
||||
char c = str[i];
|
||||
char c2 = c;
|
||||
switch (c2)
|
||||
{
|
||||
case ' ':
|
||||
case '#':
|
||||
case '$':
|
||||
case '(':
|
||||
case ')':
|
||||
case '*':
|
||||
case '+':
|
||||
case '.':
|
||||
goto IL_AF;
|
||||
default:
|
||||
switch (c2)
|
||||
{
|
||||
case '\t':
|
||||
text += "\\t";
|
||||
break;
|
||||
case '\n':
|
||||
text += "\\n";
|
||||
break;
|
||||
default:
|
||||
switch (c2)
|
||||
{
|
||||
case '[':
|
||||
case '\\':
|
||||
case '^':
|
||||
goto IL_AF;
|
||||
default:
|
||||
if (c2 == '{' || c2 == '|' || c2 == '?')
|
||||
{
|
||||
goto IL_AF;
|
||||
}
|
||||
text += c;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\f':
|
||||
text += "\\f";
|
||||
break;
|
||||
case '\r':
|
||||
text += "\\r";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
IL_11C:
|
||||
i++;
|
||||
continue;
|
||||
IL_AF:
|
||||
text = text + "\\" + c;
|
||||
goto IL_11C;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
// Token: 0x06001A68 RID: 6760 RVA: 0x0005FA54 File Offset: 0x0005DC54
|
||||
public static string Unescape(string str)
|
||||
{
|
||||
if (str.IndexOf('\\') == -1)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
return new Parser().ParseString(str);
|
||||
}
|
||||
|
||||
// Token: 0x06001A69 RID: 6761 RVA: 0x0005FA74 File Offset: 0x0005DC74
|
||||
public RegularExpression ParseRegularExpression(string pattern, RegexOptions options)
|
||||
{
|
||||
this.pattern = pattern;
|
||||
this.ptr = 0;
|
||||
this.caps.Clear();
|
||||
this.refs.Clear();
|
||||
this.num_groups = 0;
|
||||
RegularExpression regularExpression2;
|
||||
try
|
||||
{
|
||||
RegularExpression regularExpression = new RegularExpression();
|
||||
this.ParseGroup(regularExpression, options, null);
|
||||
this.ResolveReferences();
|
||||
regularExpression.GroupCount = this.num_groups;
|
||||
regularExpression2 = regularExpression;
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
throw this.NewParseException("Unexpected end of pattern.");
|
||||
}
|
||||
return regularExpression2;
|
||||
}
|
||||
|
||||
// Token: 0x06001A6A RID: 6762 RVA: 0x0005FB08 File Offset: 0x0005DD08
|
||||
public int GetMapping(Hashtable mapping)
|
||||
{
|
||||
int count = this.caps.Count;
|
||||
mapping.Add("0", 0);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
CapturingGroup capturingGroup = (CapturingGroup)this.caps[i];
|
||||
string text = ((capturingGroup.Name == null) ? capturingGroup.Index.ToString() : capturingGroup.Name);
|
||||
if (mapping.Contains(text))
|
||||
{
|
||||
if ((int)mapping[text] != capturingGroup.Index)
|
||||
{
|
||||
throw new SystemException("invalid state");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mapping.Add(text, capturingGroup.Index);
|
||||
}
|
||||
}
|
||||
return this.gap;
|
||||
}
|
||||
|
||||
// Token: 0x06001A6B RID: 6763 RVA: 0x0005FBC8 File Offset: 0x0005DDC8
|
||||
private void ParseGroup(Group group, RegexOptions options, Assertion assertion)
|
||||
{
|
||||
bool flag = group is RegularExpression;
|
||||
Alternation alternation = null;
|
||||
string text = null;
|
||||
Group group2 = new Group();
|
||||
Expression expression = null;
|
||||
bool flag2 = false;
|
||||
do
|
||||
{
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
if (this.ptr >= this.pattern.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
char c = this.pattern[this.ptr++];
|
||||
char c2 = c;
|
||||
switch (c2)
|
||||
{
|
||||
case '$':
|
||||
{
|
||||
Position position = ((!Parser.IsMultiline(options)) ? Position.End : Position.EndOfLine);
|
||||
expression = new PositionAssertion(position);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
switch (c2)
|
||||
{
|
||||
case '[':
|
||||
expression = this.ParseCharacterClass(options);
|
||||
break;
|
||||
case '\\':
|
||||
{
|
||||
int num = this.ParseEscape();
|
||||
if (num >= 0)
|
||||
{
|
||||
c = (char)num;
|
||||
}
|
||||
else
|
||||
{
|
||||
expression = this.ParseSpecial(options);
|
||||
if (expression == null)
|
||||
{
|
||||
c = this.pattern[this.ptr++];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (c2 == '?')
|
||||
{
|
||||
goto IL_25F;
|
||||
}
|
||||
if (c2 == '|')
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
group2.AppendExpression(new Literal(text, Parser.IsIgnoreCase(options)));
|
||||
text = null;
|
||||
}
|
||||
if (assertion != null)
|
||||
{
|
||||
if (assertion.TrueExpression == null)
|
||||
{
|
||||
assertion.TrueExpression = group2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (assertion.FalseExpression != null)
|
||||
{
|
||||
goto IL_230;
|
||||
}
|
||||
assertion.FalseExpression = group2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (alternation == null)
|
||||
{
|
||||
alternation = new Alternation();
|
||||
}
|
||||
alternation.AddAlternative(group2);
|
||||
}
|
||||
group2 = new Group();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '^':
|
||||
{
|
||||
Position position2 = ((!Parser.IsMultiline(options)) ? Position.Start : Position.StartOfLine);
|
||||
expression = new PositionAssertion(position2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '(':
|
||||
{
|
||||
bool flag3 = Parser.IsIgnoreCase(options);
|
||||
expression = this.ParseGroupingConstruct(ref options);
|
||||
if (expression == null)
|
||||
{
|
||||
if (text != null && Parser.IsIgnoreCase(options) != flag3)
|
||||
{
|
||||
group2.AppendExpression(new Literal(text, Parser.IsIgnoreCase(options)));
|
||||
text = null;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ')':
|
||||
goto IL_1DA;
|
||||
case '*':
|
||||
case '+':
|
||||
goto IL_25F;
|
||||
case '.':
|
||||
{
|
||||
Category category = ((!Parser.IsSingleline(options)) ? Category.Any : Category.AnySingleline);
|
||||
expression = new CharacterClass(category, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
if (this.ptr < this.pattern.Length)
|
||||
{
|
||||
char c3 = this.pattern[this.ptr];
|
||||
int num2 = 0;
|
||||
int num3 = 0;
|
||||
bool flag4 = false;
|
||||
bool flag5 = false;
|
||||
if (c3 == '?' || c3 == '*' || c3 == '+')
|
||||
{
|
||||
this.ptr++;
|
||||
flag5 = true;
|
||||
c2 = c3;
|
||||
if (c2 != '*')
|
||||
{
|
||||
if (c2 != '+')
|
||||
{
|
||||
if (c2 == '?')
|
||||
{
|
||||
num2 = 0;
|
||||
num3 = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num2 = 1;
|
||||
num3 = int.MaxValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
num2 = 0;
|
||||
num3 = int.MaxValue;
|
||||
}
|
||||
}
|
||||
else if (c3 == '{' && this.ptr + 1 < this.pattern.Length)
|
||||
{
|
||||
int num4 = this.ptr;
|
||||
this.ptr++;
|
||||
flag5 = this.ParseRepetitionBounds(out num2, out num3, options);
|
||||
if (!flag5)
|
||||
{
|
||||
this.ptr = num4;
|
||||
}
|
||||
}
|
||||
if (flag5)
|
||||
{
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
if (this.ptr < this.pattern.Length && this.pattern[this.ptr] == '?')
|
||||
{
|
||||
this.ptr++;
|
||||
flag4 = true;
|
||||
}
|
||||
Repetition repetition = new Repetition(num2, num3, flag4);
|
||||
if (expression == null)
|
||||
{
|
||||
repetition.Expression = new Literal(c.ToString(), Parser.IsIgnoreCase(options));
|
||||
}
|
||||
else
|
||||
{
|
||||
repetition.Expression = expression;
|
||||
}
|
||||
expression = repetition;
|
||||
}
|
||||
}
|
||||
if (expression == null)
|
||||
{
|
||||
if (text == null)
|
||||
{
|
||||
text = string.Empty;
|
||||
}
|
||||
text += c;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
group2.AppendExpression(new Literal(text, Parser.IsIgnoreCase(options)));
|
||||
text = null;
|
||||
}
|
||||
group2.AppendExpression(expression);
|
||||
expression = null;
|
||||
}
|
||||
}
|
||||
while (!flag || this.ptr < this.pattern.Length);
|
||||
goto IL_484;
|
||||
IL_1DA:
|
||||
flag2 = true;
|
||||
goto IL_484;
|
||||
IL_230:
|
||||
throw this.NewParseException("Too many | in (?()|).");
|
||||
IL_25F:
|
||||
throw this.NewParseException("Bad quantifier.");
|
||||
IL_484:
|
||||
if (flag && flag2)
|
||||
{
|
||||
throw this.NewParseException("Too many )'s.");
|
||||
}
|
||||
if (!flag && !flag2)
|
||||
{
|
||||
throw this.NewParseException("Not enough )'s.");
|
||||
}
|
||||
if (text != null)
|
||||
{
|
||||
group2.AppendExpression(new Literal(text, Parser.IsIgnoreCase(options)));
|
||||
}
|
||||
if (assertion != null)
|
||||
{
|
||||
if (assertion.TrueExpression == null)
|
||||
{
|
||||
assertion.TrueExpression = group2;
|
||||
}
|
||||
else
|
||||
{
|
||||
assertion.FalseExpression = group2;
|
||||
}
|
||||
group.AppendExpression(assertion);
|
||||
}
|
||||
else if (alternation != null)
|
||||
{
|
||||
alternation.AddAlternative(group2);
|
||||
group.AppendExpression(alternation);
|
||||
}
|
||||
else
|
||||
{
|
||||
group.AppendExpression(group2);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A6C RID: 6764 RVA: 0x000600F4 File Offset: 0x0005E2F4
|
||||
private Expression ParseGroupingConstruct(ref RegexOptions options)
|
||||
{
|
||||
if (this.pattern[this.ptr] != '?')
|
||||
{
|
||||
Group group;
|
||||
if (Parser.IsExplicitCapture(options))
|
||||
{
|
||||
group = new Group();
|
||||
}
|
||||
else
|
||||
{
|
||||
group = new CapturingGroup();
|
||||
this.caps.Add(group);
|
||||
}
|
||||
this.ParseGroup(group, options, null);
|
||||
return group;
|
||||
}
|
||||
this.ptr++;
|
||||
char c = this.pattern[this.ptr];
|
||||
switch (c)
|
||||
{
|
||||
case '!':
|
||||
break;
|
||||
default:
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'i':
|
||||
case 'm':
|
||||
case 'n':
|
||||
break;
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case ':':
|
||||
{
|
||||
this.ptr++;
|
||||
Group group2 = new Group();
|
||||
this.ParseGroup(group2, options, null);
|
||||
return group2;
|
||||
}
|
||||
default:
|
||||
if (c != '-' && c != 's' && c != 'x')
|
||||
{
|
||||
throw this.NewParseException("Bad grouping construct.");
|
||||
}
|
||||
break;
|
||||
case '<':
|
||||
case '=':
|
||||
goto IL_1E5;
|
||||
case '>':
|
||||
{
|
||||
this.ptr++;
|
||||
Group group3 = new NonBacktrackingGroup();
|
||||
this.ParseGroup(group3, options, null);
|
||||
return group3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
RegexOptions regexOptions = options;
|
||||
this.ParseOptions(ref regexOptions, false);
|
||||
if (this.pattern[this.ptr] == '-')
|
||||
{
|
||||
this.ptr++;
|
||||
this.ParseOptions(ref regexOptions, true);
|
||||
}
|
||||
if (this.pattern[this.ptr] == ':')
|
||||
{
|
||||
this.ptr++;
|
||||
Group group4 = new Group();
|
||||
this.ParseGroup(group4, regexOptions, null);
|
||||
return group4;
|
||||
}
|
||||
if (this.pattern[this.ptr] == ')')
|
||||
{
|
||||
this.ptr++;
|
||||
options = regexOptions;
|
||||
return null;
|
||||
}
|
||||
throw this.NewParseException("Bad options");
|
||||
}
|
||||
case '#':
|
||||
this.ptr++;
|
||||
while (this.pattern[this.ptr++] != ')')
|
||||
{
|
||||
if (this.ptr >= this.pattern.Length)
|
||||
{
|
||||
throw this.NewParseException("Unterminated (?#...) comment.");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
case '\'':
|
||||
goto IL_21C;
|
||||
case '(':
|
||||
{
|
||||
this.ptr++;
|
||||
int num = this.ptr;
|
||||
string text = this.ParseName();
|
||||
Assertion assertion;
|
||||
if (text == null || this.pattern[this.ptr] != ')')
|
||||
{
|
||||
this.ptr = num;
|
||||
ExpressionAssertion expressionAssertion = new ExpressionAssertion();
|
||||
if (this.pattern[this.ptr] == '?')
|
||||
{
|
||||
this.ptr++;
|
||||
if (!this.ParseAssertionType(expressionAssertion))
|
||||
{
|
||||
throw this.NewParseException("Bad conditional.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
expressionAssertion.Negate = false;
|
||||
expressionAssertion.Reverse = false;
|
||||
}
|
||||
Group group5 = new Group();
|
||||
this.ParseGroup(group5, options, null);
|
||||
expressionAssertion.TestExpression = group5;
|
||||
assertion = expressionAssertion;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ptr++;
|
||||
assertion = new CaptureAssertion(new Literal(text, Parser.IsIgnoreCase(options)));
|
||||
this.refs.Add(assertion, text);
|
||||
}
|
||||
Group group6 = new Group();
|
||||
this.ParseGroup(group6, options, assertion);
|
||||
return group6;
|
||||
}
|
||||
}
|
||||
IL_1E5:
|
||||
ExpressionAssertion expressionAssertion2 = new ExpressionAssertion();
|
||||
if (this.ParseAssertionType(expressionAssertion2))
|
||||
{
|
||||
Group group7 = new Group();
|
||||
this.ParseGroup(group7, options, null);
|
||||
expressionAssertion2.TestExpression = group7;
|
||||
return expressionAssertion2;
|
||||
}
|
||||
IL_21C:
|
||||
char c2;
|
||||
if (this.pattern[this.ptr] == '<')
|
||||
{
|
||||
c2 = '>';
|
||||
}
|
||||
else
|
||||
{
|
||||
c2 = '\'';
|
||||
}
|
||||
this.ptr++;
|
||||
string text2 = this.ParseName();
|
||||
if (this.pattern[this.ptr] == c2)
|
||||
{
|
||||
if (text2 == null)
|
||||
{
|
||||
throw this.NewParseException("Bad group name.");
|
||||
}
|
||||
this.ptr++;
|
||||
CapturingGroup capturingGroup = new CapturingGroup();
|
||||
capturingGroup.Name = text2;
|
||||
this.caps.Add(capturingGroup);
|
||||
this.ParseGroup(capturingGroup, options, null);
|
||||
return capturingGroup;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.pattern[this.ptr] != '-')
|
||||
{
|
||||
throw this.NewParseException("Bad group name.");
|
||||
}
|
||||
this.ptr++;
|
||||
string text3 = this.ParseName();
|
||||
if (text3 == null || this.pattern[this.ptr] != c2)
|
||||
{
|
||||
throw this.NewParseException("Bad balancing group name.");
|
||||
}
|
||||
this.ptr++;
|
||||
BalancingGroup balancingGroup = new BalancingGroup();
|
||||
balancingGroup.Name = text2;
|
||||
if (balancingGroup.IsNamed)
|
||||
{
|
||||
this.caps.Add(balancingGroup);
|
||||
}
|
||||
this.refs.Add(balancingGroup, text3);
|
||||
this.ParseGroup(balancingGroup, options, null);
|
||||
return balancingGroup;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A6D RID: 6765 RVA: 0x000605EC File Offset: 0x0005E7EC
|
||||
private bool ParseAssertionType(ExpressionAssertion assertion)
|
||||
{
|
||||
if (this.pattern[this.ptr] == '<')
|
||||
{
|
||||
char c = this.pattern[this.ptr + 1];
|
||||
if (c != '!')
|
||||
{
|
||||
if (c != '=')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
assertion.Negate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
assertion.Negate = true;
|
||||
}
|
||||
assertion.Reverse = true;
|
||||
this.ptr += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
char c = this.pattern[this.ptr];
|
||||
if (c != '!')
|
||||
{
|
||||
if (c != '=')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
assertion.Negate = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
assertion.Negate = true;
|
||||
}
|
||||
assertion.Reverse = false;
|
||||
this.ptr++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06001A6E RID: 6766 RVA: 0x000606C8 File Offset: 0x0005E8C8
|
||||
private void ParseOptions(ref RegexOptions options, bool negate)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
char c = this.pattern[this.ptr];
|
||||
switch (c)
|
||||
{
|
||||
case 'i':
|
||||
if (negate)
|
||||
{
|
||||
options &= ~RegexOptions.IgnoreCase;
|
||||
}
|
||||
else
|
||||
{
|
||||
options |= RegexOptions.IgnoreCase;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (c != 's')
|
||||
{
|
||||
if (c != 'x')
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (negate)
|
||||
{
|
||||
options &= ~RegexOptions.IgnorePatternWhitespace;
|
||||
}
|
||||
else
|
||||
{
|
||||
options |= RegexOptions.IgnorePatternWhitespace;
|
||||
}
|
||||
}
|
||||
else if (negate)
|
||||
{
|
||||
options &= ~RegexOptions.Singleline;
|
||||
}
|
||||
else
|
||||
{
|
||||
options |= RegexOptions.Singleline;
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
if (negate)
|
||||
{
|
||||
options &= ~RegexOptions.Multiline;
|
||||
}
|
||||
else
|
||||
{
|
||||
options |= RegexOptions.Multiline;
|
||||
}
|
||||
break;
|
||||
case 'n':
|
||||
if (negate)
|
||||
{
|
||||
options &= ~RegexOptions.ExplicitCapture;
|
||||
}
|
||||
else
|
||||
{
|
||||
options |= RegexOptions.ExplicitCapture;
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A6F RID: 6767 RVA: 0x000607C8 File Offset: 0x0005E9C8
|
||||
private Expression ParseCharacterClass(RegexOptions options)
|
||||
{
|
||||
bool flag = false;
|
||||
if (this.pattern[this.ptr] == '^')
|
||||
{
|
||||
flag = true;
|
||||
this.ptr++;
|
||||
}
|
||||
bool flag2 = Parser.IsECMAScript(options);
|
||||
CharacterClass characterClass = new CharacterClass(flag, Parser.IsIgnoreCase(options));
|
||||
if (this.pattern[this.ptr] == ']')
|
||||
{
|
||||
characterClass.AddCharacter(']');
|
||||
this.ptr++;
|
||||
}
|
||||
int num = -1;
|
||||
bool flag3 = false;
|
||||
bool flag4 = false;
|
||||
while (this.ptr < this.pattern.Length)
|
||||
{
|
||||
int num2 = (int)this.pattern[this.ptr++];
|
||||
if (num2 == 93)
|
||||
{
|
||||
flag4 = true;
|
||||
break;
|
||||
}
|
||||
if (num2 == 45 && num >= 0 && !flag3)
|
||||
{
|
||||
flag3 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (num2 == 92)
|
||||
{
|
||||
num2 = this.ParseEscape();
|
||||
if (num2 < 0)
|
||||
{
|
||||
num2 = (int)this.pattern[this.ptr++];
|
||||
int num3 = num2;
|
||||
switch (num3)
|
||||
{
|
||||
case 80:
|
||||
goto IL_1D1;
|
||||
default:
|
||||
switch (num3)
|
||||
{
|
||||
case 112:
|
||||
goto IL_1D1;
|
||||
default:
|
||||
switch (num3)
|
||||
{
|
||||
case 98:
|
||||
num2 = 8;
|
||||
goto IL_212;
|
||||
default:
|
||||
if (num3 != 68)
|
||||
{
|
||||
if (num3 != 87 && num3 != 119)
|
||||
{
|
||||
goto IL_212;
|
||||
}
|
||||
characterClass.AddCategory((!flag2) ? Category.Word : Category.EcmaWord, num2 == 87);
|
||||
goto IL_1EC;
|
||||
}
|
||||
break;
|
||||
case 100:
|
||||
break;
|
||||
}
|
||||
characterClass.AddCategory((!flag2) ? Category.Digit : Category.EcmaDigit, num2 == 68);
|
||||
break;
|
||||
case 115:
|
||||
goto IL_1B3;
|
||||
}
|
||||
break;
|
||||
case 83:
|
||||
goto IL_1B3;
|
||||
}
|
||||
IL_1EC:
|
||||
if (flag3)
|
||||
{
|
||||
throw this.NewParseException("character range cannot have category \\" + num2);
|
||||
}
|
||||
num = -1;
|
||||
continue;
|
||||
IL_1B3:
|
||||
characterClass.AddCategory((!flag2) ? Category.WhiteSpace : Category.EcmaWhiteSpace, num2 == 83);
|
||||
goto IL_1EC;
|
||||
IL_1D1:
|
||||
characterClass.AddCategory(this.ParseUnicodeCategory(), num2 == 80);
|
||||
goto IL_1EC;
|
||||
}
|
||||
}
|
||||
IL_212:
|
||||
if (flag3)
|
||||
{
|
||||
if (num2 < num)
|
||||
{
|
||||
throw this.NewParseException(string.Concat(new object[] { "[", num, "-", num2, "] range in reverse order." }));
|
||||
}
|
||||
characterClass.AddRange((char)num, (char)num2);
|
||||
num = -1;
|
||||
flag3 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
characterClass.AddCharacter((char)num2);
|
||||
num = num2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag4)
|
||||
{
|
||||
throw this.NewParseException("Unterminated [] set.");
|
||||
}
|
||||
if (flag3)
|
||||
{
|
||||
characterClass.AddCharacter('-');
|
||||
}
|
||||
return characterClass;
|
||||
}
|
||||
|
||||
// Token: 0x06001A70 RID: 6768 RVA: 0x00060A90 File Offset: 0x0005EC90
|
||||
private bool ParseRepetitionBounds(out int min, out int max, RegexOptions options)
|
||||
{
|
||||
min = (max = 0);
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
int num;
|
||||
if (this.pattern[this.ptr] == ',')
|
||||
{
|
||||
num = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = this.ParseNumber(10, 1, 0);
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
}
|
||||
char c = this.pattern[this.ptr++];
|
||||
int num2;
|
||||
if (c != ',')
|
||||
{
|
||||
if (c != '}')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
num2 = num;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
num2 = this.ParseNumber(10, 1, 0);
|
||||
this.ConsumeWhitespace(Parser.IsIgnorePatternWhitespace(options));
|
||||
if (this.pattern[this.ptr++] != '}')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (num > 2147483647 || num2 > 2147483647)
|
||||
{
|
||||
throw this.NewParseException("Illegal {x, y} - maximum of 2147483647.");
|
||||
}
|
||||
if (num2 >= 0 && num2 < num)
|
||||
{
|
||||
throw this.NewParseException("Illegal {x, y} with x > y.");
|
||||
}
|
||||
min = num;
|
||||
if (num2 > 0)
|
||||
{
|
||||
max = num2;
|
||||
}
|
||||
else
|
||||
{
|
||||
max = int.MaxValue;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x06001A71 RID: 6769 RVA: 0x00060BC8 File Offset: 0x0005EDC8
|
||||
private Category ParseUnicodeCategory()
|
||||
{
|
||||
if (this.pattern[this.ptr++] != '{')
|
||||
{
|
||||
throw this.NewParseException("Incomplete \\p{X} character escape.");
|
||||
}
|
||||
string text = Parser.ParseName(this.pattern, ref this.ptr);
|
||||
if (text == null)
|
||||
{
|
||||
throw this.NewParseException("Incomplete \\p{X} character escape.");
|
||||
}
|
||||
Category category = CategoryUtils.CategoryFromName(text);
|
||||
if (category == Category.None)
|
||||
{
|
||||
throw this.NewParseException("Unknown property '" + text + "'.");
|
||||
}
|
||||
if (this.pattern[this.ptr++] != '}')
|
||||
{
|
||||
throw this.NewParseException("Incomplete \\p{X} character escape.");
|
||||
}
|
||||
return category;
|
||||
}
|
||||
|
||||
// Token: 0x06001A72 RID: 6770 RVA: 0x00060C7C File Offset: 0x0005EE7C
|
||||
private Expression ParseSpecial(RegexOptions options)
|
||||
{
|
||||
int num = this.ptr;
|
||||
bool flag = Parser.IsECMAScript(options);
|
||||
char c = this.pattern[this.ptr++];
|
||||
Expression expression;
|
||||
switch (c)
|
||||
{
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
{
|
||||
this.ptr--;
|
||||
int num2 = this.ParseNumber(10, 1, 0);
|
||||
if (num2 < 0)
|
||||
{
|
||||
this.ptr = num;
|
||||
return null;
|
||||
}
|
||||
Reference reference = new BackslashNumber(Parser.IsIgnoreCase(options), flag);
|
||||
this.refs.Add(reference, num2.ToString());
|
||||
expression = reference;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case 'P':
|
||||
expression = new CharacterClass(this.ParseUnicodeCategory(), true);
|
||||
break;
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case 'W':
|
||||
expression = new CharacterClass((!flag) ? Category.Word : Category.EcmaWord, true);
|
||||
break;
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case 'p':
|
||||
expression = new CharacterClass(this.ParseUnicodeCategory(), false);
|
||||
break;
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case 'w':
|
||||
expression = new CharacterClass((!flag) ? Category.Word : Category.EcmaWord, false);
|
||||
break;
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case 'b':
|
||||
expression = new PositionAssertion(Position.Boundary);
|
||||
break;
|
||||
default:
|
||||
if (c != 'k')
|
||||
{
|
||||
expression = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
char c2 = this.pattern[this.ptr++];
|
||||
if (c2 == '<')
|
||||
{
|
||||
c2 = '>';
|
||||
}
|
||||
else if (c2 != '\'')
|
||||
{
|
||||
throw this.NewParseException("Malformed \\k<...> named backreference.");
|
||||
}
|
||||
string text = this.ParseName();
|
||||
if (text == null || this.pattern[this.ptr] != c2)
|
||||
{
|
||||
throw this.NewParseException("Malformed \\k<...> named backreference.");
|
||||
}
|
||||
this.ptr++;
|
||||
Reference reference2 = new Reference(Parser.IsIgnoreCase(options));
|
||||
this.refs.Add(reference2, text);
|
||||
expression = reference2;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
expression = new CharacterClass((!flag) ? Category.Digit : Category.EcmaDigit, false);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'z':
|
||||
expression = new PositionAssertion(Position.EndOfString);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
expression = new CharacterClass((!flag) ? Category.WhiteSpace : Category.EcmaWhiteSpace, false);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'Z':
|
||||
expression = new PositionAssertion(Position.End);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
expression = new CharacterClass((!flag) ? Category.WhiteSpace : Category.EcmaWhiteSpace, true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
expression = new PositionAssertion(Position.StartOfString);
|
||||
break;
|
||||
case 'B':
|
||||
expression = new PositionAssertion(Position.NonBoundary);
|
||||
break;
|
||||
case 'D':
|
||||
expression = new CharacterClass((!flag) ? Category.Digit : Category.EcmaDigit, true);
|
||||
break;
|
||||
case 'G':
|
||||
expression = new PositionAssertion(Position.StartOfScan);
|
||||
break;
|
||||
}
|
||||
if (expression == null)
|
||||
{
|
||||
this.ptr = num;
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
|
||||
// Token: 0x06001A73 RID: 6771 RVA: 0x00060FC8 File Offset: 0x0005F1C8
|
||||
private int ParseEscape()
|
||||
{
|
||||
int num = this.ptr;
|
||||
if (num >= this.pattern.Length)
|
||||
{
|
||||
throw new ArgumentException(string.Format("Parsing \"{0}\" - Illegal \\ at end of pattern.", this.pattern), this.pattern);
|
||||
}
|
||||
char c = this.pattern[this.ptr++];
|
||||
switch (c)
|
||||
{
|
||||
case 'n':
|
||||
return 10;
|
||||
default:
|
||||
switch (c)
|
||||
{
|
||||
case 'a':
|
||||
return 7;
|
||||
default:
|
||||
if (c != '0')
|
||||
{
|
||||
if (c != '\\')
|
||||
{
|
||||
this.ptr = num;
|
||||
return -1;
|
||||
}
|
||||
return 92;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ptr--;
|
||||
int num2 = this.ptr;
|
||||
int num3 = Parser.ParseOctal(this.pattern, ref this.ptr);
|
||||
if (num3 == -1 && num2 == this.ptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return num3;
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
{
|
||||
int num4 = (int)this.pattern[this.ptr++];
|
||||
if (num4 >= 64 && num4 <= 95)
|
||||
{
|
||||
return num4 - 64;
|
||||
}
|
||||
throw this.NewParseException("Unrecognized control character.");
|
||||
}
|
||||
case 'e':
|
||||
return 27;
|
||||
case 'f':
|
||||
return 12;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
return 13;
|
||||
case 't':
|
||||
return 9;
|
||||
case 'u':
|
||||
{
|
||||
int num4 = Parser.ParseHex(this.pattern, ref this.ptr, 4);
|
||||
if (num4 < 0)
|
||||
{
|
||||
throw this.NewParseException("Insufficient hex digits");
|
||||
}
|
||||
return num4;
|
||||
}
|
||||
case 'v':
|
||||
return 11;
|
||||
case 'x':
|
||||
{
|
||||
int num4 = Parser.ParseHex(this.pattern, ref this.ptr, 2);
|
||||
if (num4 < 0)
|
||||
{
|
||||
throw this.NewParseException("Insufficient hex digits");
|
||||
}
|
||||
return num4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A74 RID: 6772 RVA: 0x00061188 File Offset: 0x0005F388
|
||||
private string ParseName()
|
||||
{
|
||||
return Parser.ParseName(this.pattern, ref this.ptr);
|
||||
}
|
||||
|
||||
// Token: 0x06001A75 RID: 6773 RVA: 0x0006119C File Offset: 0x0005F39C
|
||||
private static bool IsNameChar(char c)
|
||||
{
|
||||
UnicodeCategory unicodeCategory = char.GetUnicodeCategory(c);
|
||||
return unicodeCategory != UnicodeCategory.ModifierLetter && (unicodeCategory == UnicodeCategory.ConnectorPunctuation || char.IsLetterOrDigit(c));
|
||||
}
|
||||
|
||||
// Token: 0x06001A76 RID: 6774 RVA: 0x000611CC File Offset: 0x0005F3CC
|
||||
private int ParseNumber(int b, int min, int max)
|
||||
{
|
||||
return Parser.ParseNumber(this.pattern, ref this.ptr, b, min, max);
|
||||
}
|
||||
|
||||
// Token: 0x06001A77 RID: 6775 RVA: 0x000611E4 File Offset: 0x0005F3E4
|
||||
private static int ParseDigit(char c, int b, int n)
|
||||
{
|
||||
switch (b)
|
||||
{
|
||||
case 8:
|
||||
if (c >= '0' && c <= '7')
|
||||
{
|
||||
return (int)(c - '0');
|
||||
}
|
||||
return -1;
|
||||
default:
|
||||
if (b != 16)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (c >= '0' && c <= '9')
|
||||
{
|
||||
return (int)(c - '0');
|
||||
}
|
||||
if (c >= 'a' && c <= 'f')
|
||||
{
|
||||
return (int)('\n' + c - 'a');
|
||||
}
|
||||
if (c >= 'A' && c <= 'F')
|
||||
{
|
||||
return (int)('\n' + c - 'A');
|
||||
}
|
||||
return -1;
|
||||
case 10:
|
||||
if (c >= '0' && c <= '9')
|
||||
{
|
||||
return (int)(c - '0');
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A78 RID: 6776 RVA: 0x0006128C File Offset: 0x0005F48C
|
||||
private void ConsumeWhitespace(bool ignore)
|
||||
{
|
||||
while (this.ptr < this.pattern.Length)
|
||||
{
|
||||
if (this.pattern[this.ptr] == '(')
|
||||
{
|
||||
if (this.ptr + 3 >= this.pattern.Length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.pattern[this.ptr + 1] != '?' || this.pattern[this.ptr + 2] != '#')
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.ptr += 3;
|
||||
while (this.ptr < this.pattern.Length && this.pattern[this.ptr++] != ')')
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (ignore && this.pattern[this.ptr] == '#')
|
||||
{
|
||||
while (this.ptr < this.pattern.Length && this.pattern[this.ptr++] != '\n')
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ignore || !char.IsWhiteSpace(this.pattern[this.ptr]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
while (this.ptr < this.pattern.Length && char.IsWhiteSpace(this.pattern[this.ptr]))
|
||||
{
|
||||
this.ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A79 RID: 6777 RVA: 0x00061438 File Offset: 0x0005F638
|
||||
private string ParseString(string pattern)
|
||||
{
|
||||
this.pattern = pattern;
|
||||
this.ptr = 0;
|
||||
StringBuilder stringBuilder = new StringBuilder(pattern.Length);
|
||||
while (this.ptr < pattern.Length)
|
||||
{
|
||||
int num = (int)pattern[this.ptr++];
|
||||
if (num == 92)
|
||||
{
|
||||
num = this.ParseEscape();
|
||||
if (num < 0)
|
||||
{
|
||||
num = (int)pattern[this.ptr++];
|
||||
if (num == 98)
|
||||
{
|
||||
num = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
stringBuilder.Append((char)num);
|
||||
}
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
|
||||
// Token: 0x06001A7A RID: 6778 RVA: 0x000614D4 File Offset: 0x0005F6D4
|
||||
private void ResolveReferences()
|
||||
{
|
||||
int num = 1;
|
||||
Hashtable hashtable = new Hashtable();
|
||||
ArrayList arrayList = null;
|
||||
foreach (object obj in this.caps)
|
||||
{
|
||||
CapturingGroup capturingGroup = (CapturingGroup)obj;
|
||||
if (capturingGroup.Name == null)
|
||||
{
|
||||
hashtable.Add(num.ToString(), capturingGroup);
|
||||
capturingGroup.Index = num++;
|
||||
this.num_groups++;
|
||||
}
|
||||
}
|
||||
foreach (object obj2 in this.caps)
|
||||
{
|
||||
CapturingGroup capturingGroup2 = (CapturingGroup)obj2;
|
||||
if (capturingGroup2.Name != null)
|
||||
{
|
||||
if (hashtable.Contains(capturingGroup2.Name))
|
||||
{
|
||||
CapturingGroup capturingGroup3 = (CapturingGroup)hashtable[capturingGroup2.Name];
|
||||
capturingGroup2.Index = capturingGroup3.Index;
|
||||
if (capturingGroup2.Index == num)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
else if (capturingGroup2.Index > num)
|
||||
{
|
||||
arrayList.Add(capturingGroup2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (char.IsDigit(capturingGroup2.Name[0]))
|
||||
{
|
||||
int num2 = 0;
|
||||
int num3 = Parser.ParseDecimal(capturingGroup2.Name, ref num2);
|
||||
if (num2 == capturingGroup2.Name.Length)
|
||||
{
|
||||
capturingGroup2.Index = num3;
|
||||
hashtable.Add(capturingGroup2.Name, capturingGroup2);
|
||||
this.num_groups++;
|
||||
if (num3 == num)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (arrayList == null)
|
||||
{
|
||||
arrayList = new ArrayList(4);
|
||||
}
|
||||
arrayList.Add(capturingGroup2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
string text = num.ToString();
|
||||
while (hashtable.Contains(text))
|
||||
{
|
||||
int num4;
|
||||
num = (num4 = num + 1);
|
||||
text = num4.ToString();
|
||||
}
|
||||
hashtable.Add(text, capturingGroup2);
|
||||
hashtable.Add(capturingGroup2.Name, capturingGroup2);
|
||||
capturingGroup2.Index = num++;
|
||||
this.num_groups++;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.gap = num;
|
||||
if (arrayList != null)
|
||||
{
|
||||
this.HandleExplicitNumericGroups(arrayList);
|
||||
}
|
||||
foreach (object obj3 in this.refs.Keys)
|
||||
{
|
||||
Expression expression = (Expression)obj3;
|
||||
string text2 = (string)this.refs[expression];
|
||||
if (!hashtable.Contains(text2))
|
||||
{
|
||||
if (!(expression is CaptureAssertion) || char.IsDigit(text2[0]))
|
||||
{
|
||||
BackslashNumber backslashNumber = expression as BackslashNumber;
|
||||
if (backslashNumber == null || !backslashNumber.ResolveReference(text2, hashtable))
|
||||
{
|
||||
throw this.NewParseException("Reference to undefined group " + ((!char.IsDigit(text2[0])) ? "name " : "number ") + text2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CapturingGroup capturingGroup4 = (CapturingGroup)hashtable[text2];
|
||||
if (expression is Reference)
|
||||
{
|
||||
((Reference)expression).CapturingGroup = capturingGroup4;
|
||||
}
|
||||
else if (expression is CaptureAssertion)
|
||||
{
|
||||
((CaptureAssertion)expression).CapturingGroup = capturingGroup4;
|
||||
}
|
||||
else if (expression is BalancingGroup)
|
||||
{
|
||||
((BalancingGroup)expression).Balance = capturingGroup4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A7B RID: 6779 RVA: 0x000618C4 File Offset: 0x0005FAC4
|
||||
private void HandleExplicitNumericGroups(ArrayList explicit_numeric_groups)
|
||||
{
|
||||
int num = this.gap;
|
||||
int i = 0;
|
||||
int count = explicit_numeric_groups.Count;
|
||||
explicit_numeric_groups.Sort();
|
||||
while (i < count)
|
||||
{
|
||||
CapturingGroup capturingGroup = (CapturingGroup)explicit_numeric_groups[i];
|
||||
if (capturingGroup.Index > num)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (capturingGroup.Index == num)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.gap = num;
|
||||
int num2 = num;
|
||||
while (i < count)
|
||||
{
|
||||
CapturingGroup capturingGroup2 = (CapturingGroup)explicit_numeric_groups[i];
|
||||
if (capturingGroup2.Index == num2)
|
||||
{
|
||||
capturingGroup2.Index = num - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
num2 = capturingGroup2.Index;
|
||||
capturingGroup2.Index = num++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001A7C RID: 6780 RVA: 0x00061980 File Offset: 0x0005FB80
|
||||
private static bool IsIgnoreCase(RegexOptions options)
|
||||
{
|
||||
return (options & RegexOptions.IgnoreCase) != RegexOptions.None;
|
||||
}
|
||||
|
||||
// Token: 0x06001A7D RID: 6781 RVA: 0x0006198C File Offset: 0x0005FB8C
|
||||
private static bool IsMultiline(RegexOptions options)
|
||||
{
|
||||
return (options & RegexOptions.Multiline) != RegexOptions.None;
|
||||
}
|
||||
|
||||
// Token: 0x06001A7E RID: 6782 RVA: 0x00061998 File Offset: 0x0005FB98
|
||||
private static bool IsExplicitCapture(RegexOptions options)
|
||||
{
|
||||
return (options & RegexOptions.ExplicitCapture) != RegexOptions.None;
|
||||
}
|
||||
|
||||
// Token: 0x06001A7F RID: 6783 RVA: 0x000619A4 File Offset: 0x0005FBA4
|
||||
private static bool IsSingleline(RegexOptions options)
|
||||
{
|
||||
return (options & RegexOptions.Singleline) != RegexOptions.None;
|
||||
}
|
||||
|
||||
// Token: 0x06001A80 RID: 6784 RVA: 0x000619B0 File Offset: 0x0005FBB0
|
||||
private static bool IsIgnorePatternWhitespace(RegexOptions options)
|
||||
{
|
||||
return (options & RegexOptions.IgnorePatternWhitespace) != RegexOptions.None;
|
||||
}
|
||||
|
||||
// Token: 0x06001A81 RID: 6785 RVA: 0x000619BC File Offset: 0x0005FBBC
|
||||
private static bool IsECMAScript(RegexOptions options)
|
||||
{
|
||||
return (options & RegexOptions.ECMAScript) != RegexOptions.None;
|
||||
}
|
||||
|
||||
// Token: 0x06001A82 RID: 6786 RVA: 0x000619CC File Offset: 0x0005FBCC
|
||||
private ArgumentException NewParseException(string msg)
|
||||
{
|
||||
msg = "parsing \"" + this.pattern + "\" - " + msg;
|
||||
return new ArgumentException(msg, this.pattern);
|
||||
}
|
||||
|
||||
// Token: 0x0400159F RID: 5535
|
||||
private string pattern;
|
||||
|
||||
// Token: 0x040015A0 RID: 5536
|
||||
private int ptr;
|
||||
|
||||
// Token: 0x040015A1 RID: 5537
|
||||
private ArrayList caps;
|
||||
|
||||
// Token: 0x040015A2 RID: 5538
|
||||
private Hashtable refs;
|
||||
|
||||
// Token: 0x040015A3 RID: 5539
|
||||
private int num_groups;
|
||||
|
||||
// Token: 0x040015A4 RID: 5540
|
||||
private int gap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E6 RID: 742
|
||||
internal class PositionAssertion : Expression
|
||||
{
|
||||
// Token: 0x06001AF1 RID: 6897 RVA: 0x000632A0 File Offset: 0x000614A0
|
||||
public PositionAssertion(Position pos)
|
||||
{
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
// Token: 0x1700083A RID: 2106
|
||||
// (get) Token: 0x06001AF2 RID: 6898 RVA: 0x000632B0 File Offset: 0x000614B0
|
||||
// (set) Token: 0x06001AF3 RID: 6899 RVA: 0x000632B8 File Offset: 0x000614B8
|
||||
public Position Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pos;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.pos = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AF4 RID: 6900 RVA: 0x000632C4 File Offset: 0x000614C4
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
cmp.EmitPosition(this.pos);
|
||||
}
|
||||
|
||||
// Token: 0x06001AF5 RID: 6901 RVA: 0x000632D4 File Offset: 0x000614D4
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
min = (max = 0);
|
||||
}
|
||||
|
||||
// Token: 0x06001AF6 RID: 6902 RVA: 0x000632EC File Offset: 0x000614EC
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x06001AF7 RID: 6903 RVA: 0x000632F0 File Offset: 0x000614F0
|
||||
public override AnchorInfo GetAnchorInfo(bool revers)
|
||||
{
|
||||
switch (this.pos)
|
||||
{
|
||||
case Position.StartOfString:
|
||||
case Position.StartOfLine:
|
||||
case Position.StartOfScan:
|
||||
return new AnchorInfo(this, 0, 0, this.pos);
|
||||
default:
|
||||
return new AnchorInfo(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040015BF RID: 5567
|
||||
private Position pos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E7 RID: 743
|
||||
internal class Reference : Expression
|
||||
{
|
||||
// Token: 0x06001AF8 RID: 6904 RVA: 0x00063334 File Offset: 0x00061534
|
||||
public Reference(bool ignore)
|
||||
{
|
||||
this.ignore = ignore;
|
||||
}
|
||||
|
||||
// Token: 0x1700083B RID: 2107
|
||||
// (get) Token: 0x06001AF9 RID: 6905 RVA: 0x00063344 File Offset: 0x00061544
|
||||
// (set) Token: 0x06001AFA RID: 6906 RVA: 0x0006334C File Offset: 0x0006154C
|
||||
public CapturingGroup CapturingGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.group;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.group = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700083C RID: 2108
|
||||
// (get) Token: 0x06001AFB RID: 6907 RVA: 0x00063358 File Offset: 0x00061558
|
||||
// (set) Token: 0x06001AFC RID: 6908 RVA: 0x00063360 File Offset: 0x00061560
|
||||
public bool IgnoreCase
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ignore;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ignore = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AFD RID: 6909 RVA: 0x0006336C File Offset: 0x0006156C
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
cmp.EmitReference(this.group.Index, this.ignore, reverse);
|
||||
}
|
||||
|
||||
// Token: 0x06001AFE RID: 6910 RVA: 0x00063388 File Offset: 0x00061588
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
min = 0;
|
||||
max = int.MaxValue;
|
||||
}
|
||||
|
||||
// Token: 0x06001AFF RID: 6911 RVA: 0x00063394 File Offset: 0x00061594
|
||||
public override bool IsComplex()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x040015C0 RID: 5568
|
||||
private CapturingGroup group;
|
||||
|
||||
// Token: 0x040015C1 RID: 5569
|
||||
private bool ignore;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002DC RID: 732
|
||||
internal class RegularExpression : Group
|
||||
{
|
||||
// Token: 0x06001AAD RID: 6829 RVA: 0x000628FC File Offset: 0x00060AFC
|
||||
public RegularExpression()
|
||||
{
|
||||
this.group_count = 0;
|
||||
}
|
||||
|
||||
// Token: 0x17000827 RID: 2087
|
||||
// (get) Token: 0x06001AAE RID: 6830 RVA: 0x0006290C File Offset: 0x00060B0C
|
||||
// (set) Token: 0x06001AAF RID: 6831 RVA: 0x00062914 File Offset: 0x00060B14
|
||||
public int GroupCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.group_count;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.group_count = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001AB0 RID: 6832 RVA: 0x00062920 File Offset: 0x00060B20
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
int num;
|
||||
int num2;
|
||||
this.GetWidth(out num, out num2);
|
||||
cmp.EmitInfo(this.group_count, num, num2);
|
||||
AnchorInfo anchorInfo = this.GetAnchorInfo(reverse);
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
cmp.EmitAnchor(reverse, anchorInfo.Offset, linkRef);
|
||||
if (anchorInfo.IsPosition)
|
||||
{
|
||||
cmp.EmitPosition(anchorInfo.Position);
|
||||
}
|
||||
else if (anchorInfo.IsSubstring)
|
||||
{
|
||||
cmp.EmitString(anchorInfo.Substring, anchorInfo.IgnoreCase, reverse);
|
||||
}
|
||||
cmp.EmitTrue();
|
||||
cmp.ResolveLink(linkRef);
|
||||
base.Compile(cmp, reverse);
|
||||
cmp.EmitTrue();
|
||||
}
|
||||
|
||||
// Token: 0x040015B1 RID: 5553
|
||||
private int group_count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
|
||||
namespace System.Text.RegularExpressions.Syntax
|
||||
{
|
||||
// Token: 0x020002E0 RID: 736
|
||||
internal class Repetition : CompositeExpression
|
||||
{
|
||||
// Token: 0x06001AC1 RID: 6849 RVA: 0x00062B40 File Offset: 0x00060D40
|
||||
public Repetition(int min, int max, bool lazy)
|
||||
{
|
||||
base.Expressions.Add(null);
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.lazy = lazy;
|
||||
}
|
||||
|
||||
// Token: 0x1700082C RID: 2092
|
||||
// (get) Token: 0x06001AC2 RID: 6850 RVA: 0x00062B6C File Offset: 0x00060D6C
|
||||
// (set) Token: 0x06001AC3 RID: 6851 RVA: 0x00062B7C File Offset: 0x00060D7C
|
||||
public Expression Expression
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Expressions[0];
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Expressions[0] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700082D RID: 2093
|
||||
// (get) Token: 0x06001AC4 RID: 6852 RVA: 0x00062B8C File Offset: 0x00060D8C
|
||||
// (set) Token: 0x06001AC5 RID: 6853 RVA: 0x00062B94 File Offset: 0x00060D94
|
||||
public int Minimum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.min;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.min = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700082E RID: 2094
|
||||
// (get) Token: 0x06001AC6 RID: 6854 RVA: 0x00062BA0 File Offset: 0x00060DA0
|
||||
// (set) Token: 0x06001AC7 RID: 6855 RVA: 0x00062BA8 File Offset: 0x00060DA8
|
||||
public int Maximum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.max;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.max = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700082F RID: 2095
|
||||
// (get) Token: 0x06001AC8 RID: 6856 RVA: 0x00062BB4 File Offset: 0x00060DB4
|
||||
// (set) Token: 0x06001AC9 RID: 6857 RVA: 0x00062BBC File Offset: 0x00060DBC
|
||||
public bool Lazy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.lazy;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.lazy = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001ACA RID: 6858 RVA: 0x00062BC8 File Offset: 0x00060DC8
|
||||
public override void Compile(ICompiler cmp, bool reverse)
|
||||
{
|
||||
if (this.Expression.IsComplex())
|
||||
{
|
||||
LinkRef linkRef = cmp.NewLink();
|
||||
cmp.EmitRepeat(this.min, this.max, this.lazy, linkRef);
|
||||
this.Expression.Compile(cmp, reverse);
|
||||
cmp.EmitUntil(linkRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkRef linkRef2 = cmp.NewLink();
|
||||
cmp.EmitFastRepeat(this.min, this.max, this.lazy, linkRef2);
|
||||
this.Expression.Compile(cmp, reverse);
|
||||
cmp.EmitTrue();
|
||||
cmp.ResolveLink(linkRef2);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001ACB RID: 6859 RVA: 0x00062C58 File Offset: 0x00060E58
|
||||
public override void GetWidth(out int min, out int max)
|
||||
{
|
||||
this.Expression.GetWidth(out min, out max);
|
||||
min *= this.min;
|
||||
if (max == 2147483647 || this.max == 65535)
|
||||
{
|
||||
max = int.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
max *= this.max;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06001ACC RID: 6860 RVA: 0x00062CB0 File Offset: 0x00060EB0
|
||||
public override AnchorInfo GetAnchorInfo(bool reverse)
|
||||
{
|
||||
int fixedWidth = base.GetFixedWidth();
|
||||
if (this.Minimum == 0)
|
||||
{
|
||||
return new AnchorInfo(this, fixedWidth);
|
||||
}
|
||||
AnchorInfo anchorInfo = this.Expression.GetAnchorInfo(reverse);
|
||||
if (anchorInfo.IsPosition)
|
||||
{
|
||||
return new AnchorInfo(this, anchorInfo.Offset, fixedWidth, anchorInfo.Position);
|
||||
}
|
||||
if (!anchorInfo.IsSubstring)
|
||||
{
|
||||
return new AnchorInfo(this, fixedWidth);
|
||||
}
|
||||
if (anchorInfo.IsComplete)
|
||||
{
|
||||
string substring = anchorInfo.Substring;
|
||||
StringBuilder stringBuilder = new StringBuilder(substring);
|
||||
for (int i = 1; i < this.Minimum; i++)
|
||||
{
|
||||
stringBuilder.Append(substring);
|
||||
}
|
||||
return new AnchorInfo(this, 0, fixedWidth, stringBuilder.ToString(), anchorInfo.IgnoreCase);
|
||||
}
|
||||
return new AnchorInfo(this, anchorInfo.Offset, fixedWidth, anchorInfo.Substring, anchorInfo.IgnoreCase);
|
||||
}
|
||||
|
||||
// Token: 0x040015B5 RID: 5557
|
||||
private int min;
|
||||
|
||||
// Token: 0x040015B6 RID: 5558
|
||||
private int max;
|
||||
|
||||
// Token: 0x040015B7 RID: 5559
|
||||
private bool lazy;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user