public static TypeNameParseInfo Parse(string name) { TypeNameParseInfo info = new TypeNameParseInfo(); char[] data = name.ToCharArray(); Unity.IL2CPP.Common.TypeNameParser parser = new Unity.IL2CPP.Common.TypeNameParser(data, 0, data.Length, info, false); return(parser.Parse(true) ? info : null); }
private TypeNameParser(char[] data, int begin, int end, TypeNameParseInfo info, bool isNested) { this._data = data; this._p = begin; this._end = end; this._info = info; this._isNested = isNested; this._acceptAssemblyName = true; }
private static bool ParseVersion(string version, ref TypeNameParseInfo info) { ushort num; ushort num2; ushort num3; ushort num4; if (!ParseVersion(version, out num, out num2, out num3, out num4)) { return(false); } info.Assembly.Major = num; info.Assembly.Minor = num2; info.Assembly.Build = num3; info.Assembly.Revision = num4; return(true); }
private bool ParseTypeArgumentsOptional(ref int arity) { bool flag2; this.SkipWhites(); if (this.IsEOL) { return(true); } if (!this.CurrentIs('[')) { return(true); } if ((this.NextWillBe(']', true) || this.NextWillBe(',', true)) || this.NextWillBe('*', true)) { return(true); } if (!this.Next(true)) { return(false); } this._info.TypeArguments.Capacity = arity; Label_0083: flag2 = false; if (this.CurrentIs('[')) { flag2 = true; if (!this.Next(true)) { return(false); } } TypeNameParseInfo info = new TypeNameParseInfo(); Unity.IL2CPP.Common.TypeNameParser parser = new Unity.IL2CPP.Common.TypeNameParser(this._data, this._p, this._end, info, true); if (!parser.Parse(flag2)) { return(false); } this._p = parser._p; this._info.TypeArguments.Add(info); this.SkipWhites(); if (this.IsEOL) { return(false); } if (flag2) { if (!this.CurrentIs(']')) { return(false); } if (!this.Next(true)) { return(false); } } if (!this.CurrentIs(']')) { if (!this.CurrentIs(',')) { return(false); } if (!this.Next(true)) { return(false); } goto Label_0083; } if (this._info.TypeArguments.Count != arity) { return(false); } this.Next(true); return(true); }
private static bool ParseVersion(string version, ref TypeNameParseInfo info) { ushort num; ushort num2; ushort num3; ushort num4; if (!ParseVersion(version, out num, out num2, out num3, out num4)) { return false; } info.Assembly.Major = num; info.Assembly.Minor = num2; info.Assembly.Build = num3; info.Assembly.Revision = num4; return true; }
private bool ParseTypeArgumentsOptional(ref int arity) { bool flag2; this.SkipWhites(); if (this.IsEOL) { return true; } if (!this.CurrentIs('[')) { return true; } if ((this.NextWillBe(']', true) || this.NextWillBe(',', true)) || this.NextWillBe('*', true)) { return true; } if (!this.Next(true)) { return false; } this._info.TypeArguments.Capacity = arity; Label_0083: flag2 = false; if (this.CurrentIs('[')) { flag2 = true; if (!this.Next(true)) { return false; } } TypeNameParseInfo info = new TypeNameParseInfo(); TypeNameParser parser = new TypeNameParser(this._data, this._p, this._end, info, true); if (!parser.Parse(flag2)) { return false; } this._p = parser._p; this._info.TypeArguments.Add(info); this.SkipWhites(); if (this.IsEOL) { return false; } if (flag2) { if (!this.CurrentIs(']')) { return false; } if (!this.Next(true)) { return false; } } if (!this.CurrentIs(']')) { if (!this.CurrentIs(',')) { return false; } if (!this.Next(true)) { return false; } goto Label_0083; } if (this._info.TypeArguments.Count != arity) { return false; } this.Next(true); return true; }
public static TypeNameParseInfo Parse(string name) { TypeNameParseInfo info = new TypeNameParseInfo(); char[] data = name.ToCharArray(); TypeNameParser parser = new TypeNameParser(data, 0, data.Length, info, false); return (parser.Parse(true) ? info : null); }
public TypeResolutionException(TypeNameParseInfo typeNameInfo) { this._typeNameInfo = typeNameInfo; }