Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
◆
InferSimpleType()
static int System.Xml.Schema.XmlSchemaInference.InferSimpleType
(
string
s
,
ref
bool
bNeedsRangeCheck
)
inline
static
package
Definition at line
1506
of file
XmlSchemaInference.cs
.
1507
{
1508
bool
flag =
false
;
1509
bool
flag2
=
false
;
1510
bool
bDate
=
false
;
1511
bool
bTime
=
false
;
1512
bool
flag3
=
false
;
1513
if
(
s
.Length == 0)
1514
{
1515
return
262144;
1516
}
1517
int
num = 0;
1518
char
c8
;
1519
switch
(
s
[num])
1520
{
1521
case
'f'
:
1522
case
't'
:
1523
if
(
s
==
"true"
)
1524
{
1525
return
262145;
1526
}
1527
if
(
s
==
"false"
)
1528
{
1529
return
262145;
1530
}
1531
return
262144;
1532
case
'N'
:
1533
if
(
s
==
"NaN"
)
1534
{
1535
return
268288;
1536
}
1537
return
262144;
1538
case
'I'
:
1539
if
(
s
.AsSpan(num).SequenceEqual(
"INF"
))
1540
{
1541
return
268288;
1542
}
1543
return
262144;
1544
case
'.'
:
1545
{
1546
bNeedsRangeCheck
=
true
;
1547
num++;
1548
if
(num ==
s
.Length)
1549
{
1550
if
(num == 1 || (num == 2 && (
flag2
|| flag)))
1551
{
1552
return
262144;
1553
}
1554
return
269312;
1555
}
1556
char
c21
=
s
[num];
1557
if
(
c21
!=
'E'
&&
c21
!=
'e'
)
1558
{
1559
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1560
{
1561
return
262144;
1562
}
1563
while
(
true
)
1564
{
1565
num++;
1566
if
(num ==
s
.Length)
1567
{
1568
return
269312;
1569
}
1570
char
c22
=
s
[num];
1571
if
(
c22
==
'E'
||
c22
==
'e'
)
1572
{
1573
break
;
1574
}
1575
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1576
{
1577
return
262144;
1578
}
1579
}
1580
}
1581
num++;
1582
if
(num ==
s
.Length)
1583
{
1584
return
262144;
1585
}
1586
char
c23
=
s
[num];
1587
if
(
c23
!=
'+'
&&
c23
!=
'-'
)
1588
{
1589
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1590
{
1591
return
262144;
1592
}
1593
}
1594
else
1595
{
1596
num++;
1597
if
(num ==
s
.Length)
1598
{
1599
return
262144;
1600
}
1601
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1602
{
1603
return
262144;
1604
}
1605
}
1606
do
1607
{
1608
num++;
1609
if
(num ==
s
.Length)
1610
{
1611
return
268288;
1612
}
1613
}
1614
while
(
s
[num] >=
'0'
&&
s
[num] <=
'9'
);
1615
return
262144;
1616
}
1617
case
'-'
:
1618
{
1619
flag =
true
;
1620
num++;
1621
if
(num ==
s
.Length)
1622
{
1623
return
262144;
1624
}
1625
char
c7
=
s
[num];
1626
if
(
c7
==
'.'
)
1627
{
1628
goto
case
'.'
;
1629
}
1630
if
(
c7
==
'I'
)
1631
{
1632
goto
case
'I'
;
1633
}
1634
if
(
c7
==
'P'
)
1635
{
1636
goto
case
'P'
;
1637
}
1638
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1639
{
1640
return
262144;
1641
}
1642
goto
case
'0'
;
1643
}
1644
case
'+'
:
1645
{
1646
flag2
=
true
;
1647
num++;
1648
if
(num ==
s
.Length)
1649
{
1650
return
262144;
1651
}
1652
char
c =
s
[num];
1653
if
(c ==
'.'
)
1654
{
1655
goto
case
'.'
;
1656
}
1657
if
(c ==
'P'
)
1658
{
1659
goto
case
'P'
;
1660
}
1661
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1662
{
1663
return
262144;
1664
}
1665
goto
case
'0'
;
1666
}
1667
case
'P'
:
1668
{
1669
num++;
1670
if
(num ==
s
.Length)
1671
{
1672
return
262144;
1673
}
1674
char
c10
=
s
[num];
1675
if
(
c10
!=
'T'
)
1676
{
1677
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1678
{
1679
return
262144;
1680
}
1681
while
(
true
)
1682
{
1683
num++;
1684
if
(num ==
s
.Length)
1685
{
1686
return
262144;
1687
}
1688
char
c11
=
s
[num];
1689
if
(
c11
!=
'D'
)
1690
{
1691
if
(
c11
==
'M'
)
1692
{
1693
goto
IL_0444
;
1694
}
1695
if
(
c11
!=
'Y'
)
1696
{
1697
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1698
{
1699
return
262144;
1700
}
1701
continue
;
1702
}
1703
num++;
1704
if
(num ==
s
.Length)
1705
{
1706
bNeedsRangeCheck
=
true
;
1707
return
270336;
1708
}
1709
char
c12
=
s
[num];
1710
if
(
c12
==
'T'
)
1711
{
1712
break
;
1713
}
1714
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1715
{
1716
return
262144;
1717
}
1718
while
(
true
)
1719
{
1720
num++;
1721
if
(num ==
s
.Length)
1722
{
1723
return
262144;
1724
}
1725
char
c13
=
s
[num];
1726
if
(
c13
==
'D'
)
1727
{
1728
break
;
1729
}
1730
if
(
c13
!=
'M'
)
1731
{
1732
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1733
{
1734
return
262144;
1735
}
1736
continue
;
1737
}
1738
goto
IL_0444
;
1739
}
1740
}
1741
goto
IL_04d2
;
1742
IL_04d2
:
1743
num++;
1744
if
(num ==
s
.Length)
1745
{
1746
bNeedsRangeCheck
=
true
;
1747
return
270336;
1748
}
1749
char
c14
=
s
[num];
1750
if
(
c14
==
'T'
)
1751
{
1752
break
;
1753
}
1754
return
262144;
1755
IL_0444
:
1756
num++;
1757
if
(num ==
s
.Length)
1758
{
1759
bNeedsRangeCheck
=
true
;
1760
return
270336;
1761
}
1762
char
c15
=
s
[num];
1763
if
(
c15
==
'T'
)
1764
{
1765
break
;
1766
}
1767
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1768
{
1769
return
262144;
1770
}
1771
while
(
true
)
1772
{
1773
num++;
1774
if
(num ==
s
.Length)
1775
{
1776
return
262144;
1777
}
1778
char
c16
=
s
[num];
1779
if
(
c16
==
'D'
)
1780
{
1781
break
;
1782
}
1783
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1784
{
1785
return
262144;
1786
}
1787
}
1788
goto
IL_04d2
;
1789
}
1790
}
1791
num++;
1792
if
(num ==
s
.Length)
1793
{
1794
return
262144;
1795
}
1796
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1797
{
1798
return
262144;
1799
}
1800
while
(
true
)
1801
{
1802
num++;
1803
if
(num ==
s
.Length)
1804
{
1805
return
262144;
1806
}
1807
char
c17
=
s
[num];
1808
if
((uint)
c17
<= 72
u
)
1809
{
1810
if
(
c17
!=
'.'
)
1811
{
1812
if
(
c17
!=
'H'
)
1813
{
1814
goto
IL_057e
;
1815
}
1816
num++;
1817
if
(num ==
s
.Length)
1818
{
1819
bNeedsRangeCheck
=
true
;
1820
return
270336;
1821
}
1822
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1823
{
1824
return
262144;
1825
}
1826
while
(
true
)
1827
{
1828
num++;
1829
if
(num ==
s
.Length)
1830
{
1831
return
262144;
1832
}
1833
char
c18
=
s
[num];
1834
if
(
c18
==
'.'
)
1835
{
1836
break
;
1837
}
1838
if
(
c18
!=
'M'
)
1839
{
1840
if
(
c18
==
'S'
)
1841
{
1842
goto
end_IL_0535
;
1843
}
1844
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1845
{
1846
return
262144;
1847
}
1848
continue
;
1849
}
1850
goto
IL_0629
;
1851
}
1852
}
1853
goto
IL_06ad
;
1854
}
1855
if
(
c17
!=
'M'
)
1856
{
1857
if
(
c17
==
'S'
)
1858
{
1859
break
;
1860
}
1861
goto
IL_057e
;
1862
}
1863
goto
IL_0629
;
1864
IL_057e
:
1865
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1866
{
1867
return
262144;
1868
}
1869
continue
;
1870
IL_06ad
:
1871
num++;
1872
if
(num ==
s
.Length)
1873
{
1874
bNeedsRangeCheck
=
true
;
1875
return
270336;
1876
}
1877
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1878
{
1879
return
262144;
1880
}
1881
while
(
true
)
1882
{
1883
num++;
1884
if
(num ==
s
.Length)
1885
{
1886
return
262144;
1887
}
1888
char
c19
=
s
[num];
1889
if
(
c19
==
'S'
)
1890
{
1891
break
;
1892
}
1893
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1894
{
1895
return
262144;
1896
}
1897
}
1898
break
;
1899
IL_0629
:
1900
num++;
1901
if
(num ==
s
.Length)
1902
{
1903
bNeedsRangeCheck
=
true
;
1904
return
270336;
1905
}
1906
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1907
{
1908
return
262144;
1909
}
1910
while
(
true
)
1911
{
1912
num++;
1913
if
(num ==
s
.Length)
1914
{
1915
return
262144;
1916
}
1917
char
c20
=
s
[num];
1918
if
(
c20
==
'.'
)
1919
{
1920
break
;
1921
}
1922
if
(
c20
==
'S'
)
1923
{
1924
goto
end_IL_0535
;
1925
}
1926
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1927
{
1928
return
262144;
1929
}
1930
}
1931
goto
IL_06ad
;
1932
continue
;
1933
end_IL_0535
:
1934
break
;
1935
}
1936
num++;
1937
if
(num ==
s
.Length)
1938
{
1939
bNeedsRangeCheck
=
true
;
1940
return
270336;
1941
}
1942
return
262144;
1943
}
1944
case
'0'
:
1945
case
'1'
:
1946
case
'2'
:
1947
case
'3'
:
1948
case
'4'
:
1949
case
'5'
:
1950
case
'6'
:
1951
case
'7'
:
1952
case
'8'
:
1953
case
'9'
:
1954
{
1955
num++;
1956
if
(num ==
s
.Length)
1957
{
1958
bNeedsRangeCheck
=
true
;
1959
if
(flag ||
flag2
)
1960
{
1961
return
269994;
1962
}
1963
if
(
s
==
"0"
||
s
==
"1"
)
1964
{
1965
return
270335;
1966
}
1967
return
270334;
1968
}
1969
char
c2
=
s
[num];
1970
if
(
c2
!=
'.'
)
1971
{
1972
if
(
c2
==
'E'
||
c2
==
'e'
)
1973
{
1974
bNeedsRangeCheck
=
true
;
1975
return
268288;
1976
}
1977
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
1978
{
1979
return
262144;
1980
}
1981
num++;
1982
if
(num ==
s
.Length)
1983
{
1984
bNeedsRangeCheck
=
true
;
1985
if
(flag ||
flag2
)
1986
{
1987
return
269994;
1988
}
1989
return
270334;
1990
}
1991
char
c3
=
s
[num];
1992
if
((uint)
c3
<= 58
u
)
1993
{
1994
if
(
c3
==
'.'
)
1995
{
1996
goto
case
'.'
;
1997
}
1998
if
(
c3
==
':'
)
1999
{
2000
bTime
=
true
;
2001
goto
IL_0ca9
;
2002
}
2003
}
2004
else
if
(
c3
==
'E'
||
c3
==
'e'
)
2005
{
2006
bNeedsRangeCheck
=
true
;
2007
return
268288;
2008
}
2009
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2010
{
2011
return
262144;
2012
}
2013
num++;
2014
if
(num ==
s
.Length)
2015
{
2016
bNeedsRangeCheck
=
true
;
2017
if
(flag ||
flag2
)
2018
{
2019
return
269994;
2020
}
2021
return
270334;
2022
}
2023
char
c4
=
s
[num];
2024
if
(
c4
!=
'.'
)
2025
{
2026
if
(
c4
==
'E'
||
c4
==
'e'
)
2027
{
2028
bNeedsRangeCheck
=
true
;
2029
return
268288;
2030
}
2031
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2032
{
2033
return
262144;
2034
}
2035
while
(
true
)
2036
{
2037
num++;
2038
if
(num ==
s
.Length)
2039
{
2040
break
;
2041
}
2042
char
c5
=
s
[num];
2043
if
((uint)
c5
<= 46
u
)
2044
{
2045
if
(
c5
==
'-'
)
2046
{
2047
goto
IL_090f
;
2048
}
2049
if
(
c5
==
'.'
)
2050
{
2051
goto
case
'.'
;
2052
}
2053
}
2054
else
if
(
c5
==
'E'
||
c5
==
'e'
)
2055
{
2056
bNeedsRangeCheck
=
true
;
2057
return
268288;
2058
}
2059
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2060
{
2061
return
262144;
2062
}
2063
}
2064
bNeedsRangeCheck
=
true
;
2065
if
(flag ||
flag2
)
2066
{
2067
return
269994;
2068
}
2069
return
270334;
2070
}
2071
}
2072
goto
case
'.'
;
2073
}
2074
default
:
2075
{
2076
return
262144;
2077
}
2078
IL_0ac9
:
2079
num++;
2080
if
(num ==
s
.Length)
2081
{
2082
if
(
flag3
)
2083
{
2084
bNeedsRangeCheck
=
true
;
2085
return
393216;
2086
}
2087
return
DateTime
(
s
,
bDate
,
bTime
);
2088
}
2089
return
262144;
2090
IL_0ca9
:
2091
num++;
2092
if
(num ==
s
.Length)
2093
{
2094
return
262144;
2095
}
2096
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2097
{
2098
return
262144;
2099
}
2100
num++;
2101
if
(num ==
s
.Length)
2102
{
2103
return
262144;
2104
}
2105
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2106
{
2107
return
262144;
2108
}
2109
num++;
2110
if
(num ==
s
.Length)
2111
{
2112
return
262144;
2113
}
2114
if
(
s
[num] !=
':'
)
2115
{
2116
return
262144;
2117
}
2118
num++;
2119
if
(num ==
s
.Length)
2120
{
2121
return
262144;
2122
}
2123
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2124
{
2125
return
262144;
2126
}
2127
num++;
2128
if
(num ==
s
.Length)
2129
{
2130
return
262144;
2131
}
2132
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2133
{
2134
return
262144;
2135
}
2136
num++;
2137
if
(num ==
s
.Length)
2138
{
2139
return
DateTime
(
s
,
bDate
,
bTime
);
2140
}
2141
switch
(
s
[num])
2142
{
2143
case
'Z'
:
2144
case
'z'
:
2145
break
;
2146
case
'+'
:
2147
case
'-'
:
2148
goto
IL_0af5
;
2149
default
:
2150
return
262144;
2151
case
'.'
:
2152
goto
IL_0df6
;
2153
}
2154
goto
IL_0ac9
;
2155
IL_0df6
:
2156
num++;
2157
if
(num ==
s
.Length)
2158
{
2159
return
262144;
2160
}
2161
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2162
{
2163
return
262144;
2164
}
2165
while
(
true
)
2166
{
2167
num++;
2168
if
(num ==
s
.Length)
2169
{
2170
return
DateTime
(
s
,
bDate
,
bTime
);
2171
}
2172
char
c6
=
s
[num];
2173
if
((uint)
c6
<= 45
u
)
2174
{
2175
if
(
c6
==
'+'
||
c6
==
'-'
)
2176
{
2177
break
;
2178
}
2179
}
2180
else
if
(
c6
==
'Z'
||
c6
==
'z'
)
2181
{
2182
goto
IL_0ac9
;
2183
}
2184
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2185
{
2186
return
262144;
2187
}
2188
}
2189
goto
IL_0af5
;
2190
IL_0af5
:
2191
num++;
2192
if
(num ==
s
.Length)
2193
{
2194
return
262144;
2195
}
2196
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2197
{
2198
return
262144;
2199
}
2200
num++;
2201
if
(num ==
s
.Length)
2202
{
2203
return
262144;
2204
}
2205
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2206
{
2207
return
262144;
2208
}
2209
num++;
2210
if
(num ==
s
.Length)
2211
{
2212
return
262144;
2213
}
2214
if
(
s
[num] !=
':'
)
2215
{
2216
return
262144;
2217
}
2218
goto
IL_0b85
;
2219
IL_090f
:
2220
bDate
=
true
;
2221
num++;
2222
if
(num ==
s
.Length)
2223
{
2224
return
262144;
2225
}
2226
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2227
{
2228
return
262144;
2229
}
2230
num++;
2231
if
(num ==
s
.Length)
2232
{
2233
return
262144;
2234
}
2235
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2236
{
2237
return
262144;
2238
}
2239
num++;
2240
if
(num ==
s
.Length)
2241
{
2242
bNeedsRangeCheck
=
true
;
2243
return
393216;
2244
}
2245
c8
=
s
[num];
2246
if
((uint)
c8
<= 45
u
)
2247
{
2248
if
(
c8
==
'+'
)
2249
{
2250
flag3
=
true
;
2251
goto
IL_0af5
;
2252
}
2253
if
(
c8
==
'-'
)
2254
{
2255
num++;
2256
if
(num ==
s
.Length)
2257
{
2258
return
262144;
2259
}
2260
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2261
{
2262
return
262144;
2263
}
2264
num++;
2265
if
(num ==
s
.Length)
2266
{
2267
return
262144;
2268
}
2269
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2270
{
2271
return
262144;
2272
}
2273
num++;
2274
if
(num ==
s
.Length)
2275
{
2276
return
DateTime
(
s
,
bDate
,
bTime
);
2277
}
2278
char
c9
=
s
[num];
2279
if
((uint)
c9
<= 58
u
)
2280
{
2281
if
(
c9
==
'+'
||
c9
==
'-'
)
2282
{
2283
goto
IL_0af5
;
2284
}
2285
if
(
c9
==
':'
)
2286
{
2287
flag3
=
true
;
2288
goto
IL_0b85
;
2289
}
2290
}
2291
else
2292
{
2293
if
(
c9
==
'T'
)
2294
{
2295
bTime
=
true
;
2296
num++;
2297
if
(num ==
s
.Length)
2298
{
2299
return
262144;
2300
}
2301
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2302
{
2303
return
262144;
2304
}
2305
num++;
2306
if
(num ==
s
.Length)
2307
{
2308
return
262144;
2309
}
2310
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2311
{
2312
return
262144;
2313
}
2314
num++;
2315
if
(num ==
s
.Length)
2316
{
2317
return
262144;
2318
}
2319
if
(
s
[num] !=
':'
)
2320
{
2321
return
262144;
2322
}
2323
goto
IL_0ca9
;
2324
}
2325
if
(
c9
==
'Z'
||
c9
==
'z'
)
2326
{
2327
goto
IL_0ac9
;
2328
}
2329
}
2330
return
262144;
2331
}
2332
}
2333
else
if
(
c8
==
'Z'
||
c8
==
'z'
)
2334
{
2335
flag3
=
true
;
2336
goto
IL_0ac9
;
2337
}
2338
return
262144;
2339
IL_0b85
:
2340
num++;
2341
if
(num ==
s
.Length)
2342
{
2343
return
262144;
2344
}
2345
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2346
{
2347
return
262144;
2348
}
2349
num++;
2350
if
(num ==
s
.Length)
2351
{
2352
return
262144;
2353
}
2354
if
(
s
[num] <
'0'
||
s
[num] >
'9'
)
2355
{
2356
return
262144;
2357
}
2358
num++;
2359
if
(num ==
s
.Length)
2360
{
2361
if
(
flag3
)
2362
{
2363
bNeedsRangeCheck
=
true
;
2364
return
393216;
2365
}
2366
return
DateTime
(
s
,
bDate
,
bTime
);
2367
}
2368
return
262144;
2369
}
2370
}
System.Xml.Schema.XmlTypeCode.DateTime
@ DateTime
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.s
@ s
References
System.s
.
System
Xml
Schema
XmlSchemaInference
Generated by
1.10.0