76 lines
1.6 KiB
C#
76 lines
1.6 KiB
C#
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;
|
|
}
|
|
}
|