flow-parser 0.328.0 → 0.329.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/FlowParser.js +44 -10
- package/dist/FlowParser.js.flow +67 -12
- package/dist/FlowParserDeserializer.js +125 -11
- package/dist/FlowParserDeserializer.js.flow +147 -30
- package/dist/FlowParserNodeDeserializers.js +605 -0
- package/dist/FlowParserWASM.js +1 -1
- package/dist/FlowParserWASM.js.flow +10 -0
- package/dist/babel/BabelAST.js.flow +29 -0
- package/dist/index.js +1 -11
- package/dist/index.js.flow +2 -22
- package/package.json +2 -2
- package/dist/babel/TransformESTreeToBabel.js +0 -915
- package/dist/babel/TransformESTreeToBabel.js.flow +0 -1357
|
@@ -1771,4 +1771,609 @@ module.exports = [function () {
|
|
|
1771
1771
|
loc: this.addEmptyLoc(),
|
|
1772
1772
|
expression: this.deserializeNode()
|
|
1773
1773
|
};
|
|
1774
|
+
}, function () {
|
|
1775
|
+
return {
|
|
1776
|
+
type: 'ExpressionStatement',
|
|
1777
|
+
loc: this.addEmptyLoc(),
|
|
1778
|
+
expression: this.deserializeNode()
|
|
1779
|
+
};
|
|
1780
|
+
}, function () {
|
|
1781
|
+
return {
|
|
1782
|
+
type: 'BlockStatement',
|
|
1783
|
+
loc: this.addEmptyLoc(),
|
|
1784
|
+
body: this.deserializeNodeList(),
|
|
1785
|
+
directives: this.deserializeNodeList()
|
|
1786
|
+
};
|
|
1787
|
+
}, function () {
|
|
1788
|
+
return {
|
|
1789
|
+
type: 'Directive',
|
|
1790
|
+
loc: this.addEmptyLoc(),
|
|
1791
|
+
value: this.deserializeNode()
|
|
1792
|
+
};
|
|
1793
|
+
}, function () {
|
|
1794
|
+
const loc = this.addEmptyLoc();
|
|
1795
|
+
const value = this.deserializeString();
|
|
1796
|
+
const rawValue = this.deserializeString();
|
|
1797
|
+
const raw = this.deserializeString();
|
|
1798
|
+
return {
|
|
1799
|
+
type: 'DirectiveLiteral',
|
|
1800
|
+
loc,
|
|
1801
|
+
value,
|
|
1802
|
+
extra: {
|
|
1803
|
+
rawValue,
|
|
1804
|
+
raw
|
|
1805
|
+
}
|
|
1806
|
+
};
|
|
1807
|
+
}, function () {
|
|
1808
|
+
return {
|
|
1809
|
+
type: 'ObjectProperty',
|
|
1810
|
+
loc: this.addEmptyLoc(),
|
|
1811
|
+
computed: this.deserializeBoolean(),
|
|
1812
|
+
key: this.deserializeNode(),
|
|
1813
|
+
value: this.deserializeNode(),
|
|
1814
|
+
method: this.deserializeBoolean(),
|
|
1815
|
+
shorthand: this.deserializeBoolean()
|
|
1816
|
+
};
|
|
1817
|
+
}, function () {
|
|
1818
|
+
const node = {
|
|
1819
|
+
type: 'ObjectMethod',
|
|
1820
|
+
loc: this.addEmptyLoc()
|
|
1821
|
+
};
|
|
1822
|
+
node.kind = this.deserializeString();
|
|
1823
|
+
node.method = this.deserializeBoolean();
|
|
1824
|
+
node.computed = this.deserializeBoolean();
|
|
1825
|
+
node.key = this.deserializeNode();
|
|
1826
|
+
node.id = this.deserializeNode();
|
|
1827
|
+
node.params = this.deserializeNodeList();
|
|
1828
|
+
node.body = this.deserializeNode();
|
|
1829
|
+
node.async = this.deserializeBoolean();
|
|
1830
|
+
node.generator = this.deserializeBoolean();
|
|
1831
|
+
{
|
|
1832
|
+
const value = this.deserializeNode();
|
|
1833
|
+
if (value != null) node['returnType'] = value;
|
|
1834
|
+
}
|
|
1835
|
+
{
|
|
1836
|
+
const value = this.deserializeNode();
|
|
1837
|
+
if (value != null) node['typeParameters'] = value;
|
|
1838
|
+
}
|
|
1839
|
+
if (this.deserializeBoolean()) {
|
|
1840
|
+
node['variance'] = this.deserializeNode();
|
|
1841
|
+
}
|
|
1842
|
+
return node;
|
|
1843
|
+
}, function () {
|
|
1844
|
+
const node = {
|
|
1845
|
+
type: 'ClassMethod',
|
|
1846
|
+
loc: this.addEmptyLoc()
|
|
1847
|
+
};
|
|
1848
|
+
node.kind = this.deserializeString();
|
|
1849
|
+
node.computed = this.deserializeBoolean();
|
|
1850
|
+
node.static = this.deserializeBoolean();
|
|
1851
|
+
node.key = this.deserializeNode();
|
|
1852
|
+
node.id = this.deserializeNode();
|
|
1853
|
+
node.params = this.deserializeNodeList();
|
|
1854
|
+
node.body = this.deserializeNode();
|
|
1855
|
+
node.async = this.deserializeBoolean();
|
|
1856
|
+
node.generator = this.deserializeBoolean();
|
|
1857
|
+
{
|
|
1858
|
+
const value = this.deserializeNode();
|
|
1859
|
+
if (value != null) node['returnType'] = value;
|
|
1860
|
+
}
|
|
1861
|
+
{
|
|
1862
|
+
const value = this.deserializeNode();
|
|
1863
|
+
if (value != null) node['typeParameters'] = value;
|
|
1864
|
+
}
|
|
1865
|
+
{
|
|
1866
|
+
const value = this.deserializeNode();
|
|
1867
|
+
if (value != null) node['predicate'] = value;
|
|
1868
|
+
}
|
|
1869
|
+
return node;
|
|
1870
|
+
}, function () {
|
|
1871
|
+
const node = {
|
|
1872
|
+
type: 'ClassPrivateMethod',
|
|
1873
|
+
loc: this.addEmptyLoc()
|
|
1874
|
+
};
|
|
1875
|
+
node.kind = this.deserializeString();
|
|
1876
|
+
node.static = this.deserializeBoolean();
|
|
1877
|
+
node.key = this.deserializeNode();
|
|
1878
|
+
node.id = this.deserializeNode();
|
|
1879
|
+
node.params = this.deserializeNodeList();
|
|
1880
|
+
node.body = this.deserializeNode();
|
|
1881
|
+
node.async = this.deserializeBoolean();
|
|
1882
|
+
node.generator = this.deserializeBoolean();
|
|
1883
|
+
{
|
|
1884
|
+
const value = this.deserializeNode();
|
|
1885
|
+
if (value != null) node['returnType'] = value;
|
|
1886
|
+
}
|
|
1887
|
+
{
|
|
1888
|
+
const value = this.deserializeNode();
|
|
1889
|
+
if (value != null) node['typeParameters'] = value;
|
|
1890
|
+
}
|
|
1891
|
+
{
|
|
1892
|
+
const value = this.deserializeNode();
|
|
1893
|
+
if (value != null) node['predicate'] = value;
|
|
1894
|
+
}
|
|
1895
|
+
return node;
|
|
1896
|
+
}, function () {
|
|
1897
|
+
const node = {
|
|
1898
|
+
type: 'ClassProperty',
|
|
1899
|
+
loc: this.addEmptyLoc()
|
|
1900
|
+
};
|
|
1901
|
+
node.key = this.deserializeNode();
|
|
1902
|
+
node.value = this.deserializeNode();
|
|
1903
|
+
{
|
|
1904
|
+
const value = this.deserializeNode();
|
|
1905
|
+
if (value != null) node['typeAnnotation'] = value;
|
|
1906
|
+
}
|
|
1907
|
+
node.static = this.deserializeBoolean();
|
|
1908
|
+
node.variance = this.deserializeNode();
|
|
1909
|
+
if (this.deserializeBoolean()) node['declare'] = true;
|
|
1910
|
+
if (this.deserializeBoolean()) node['optional'] = true;
|
|
1911
|
+
node.computed = this.deserializeBoolean();
|
|
1912
|
+
return node;
|
|
1913
|
+
}, function () {
|
|
1914
|
+
const node = {
|
|
1915
|
+
type: 'ClassPrivateProperty',
|
|
1916
|
+
loc: this.addEmptyLoc()
|
|
1917
|
+
};
|
|
1918
|
+
node.key = this.deserializeNode();
|
|
1919
|
+
node.value = this.deserializeNode();
|
|
1920
|
+
{
|
|
1921
|
+
const value = this.deserializeNode();
|
|
1922
|
+
if (value != null) node['typeAnnotation'] = value;
|
|
1923
|
+
}
|
|
1924
|
+
node.static = this.deserializeBoolean();
|
|
1925
|
+
node.variance = this.deserializeNode();
|
|
1926
|
+
return node;
|
|
1927
|
+
}, function () {
|
|
1928
|
+
return {
|
|
1929
|
+
type: 'PrivateName',
|
|
1930
|
+
loc: this.addEmptyLoc(),
|
|
1931
|
+
id: this.deserializeNode()
|
|
1932
|
+
};
|
|
1933
|
+
}, function () {
|
|
1934
|
+
const loc = this.addEmptyLoc();
|
|
1935
|
+
const value = this.deserializeString();
|
|
1936
|
+
const rawValue = value;
|
|
1937
|
+
const raw = this.deserializeString();
|
|
1938
|
+
return {
|
|
1939
|
+
type: 'StringLiteral',
|
|
1940
|
+
loc,
|
|
1941
|
+
value,
|
|
1942
|
+
extra: {
|
|
1943
|
+
rawValue,
|
|
1944
|
+
raw
|
|
1945
|
+
}
|
|
1946
|
+
};
|
|
1947
|
+
}, function () {
|
|
1948
|
+
const loc = this.addEmptyLoc();
|
|
1949
|
+
const value = this.deserializeNumber();
|
|
1950
|
+
const raw = this.deserializeString();
|
|
1951
|
+
return {
|
|
1952
|
+
type: 'NumericLiteral',
|
|
1953
|
+
loc,
|
|
1954
|
+
value,
|
|
1955
|
+
extra: {
|
|
1956
|
+
rawValue: value,
|
|
1957
|
+
raw
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
}, function () {
|
|
1961
|
+
const loc = this.addEmptyLoc();
|
|
1962
|
+
const value = this.deserializeString();
|
|
1963
|
+
const rawValue = value;
|
|
1964
|
+
const raw = this.deserializeString();
|
|
1965
|
+
return {
|
|
1966
|
+
type: 'BigIntLiteral',
|
|
1967
|
+
loc,
|
|
1968
|
+
value,
|
|
1969
|
+
extra: {
|
|
1970
|
+
rawValue,
|
|
1971
|
+
raw
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
}, function () {
|
|
1975
|
+
return {
|
|
1976
|
+
type: 'BooleanLiteral',
|
|
1977
|
+
loc: this.addEmptyLoc(),
|
|
1978
|
+
value: this.deserializeBoolean()
|
|
1979
|
+
};
|
|
1980
|
+
}, function () {
|
|
1981
|
+
return {
|
|
1982
|
+
type: 'NullLiteral',
|
|
1983
|
+
loc: this.addEmptyLoc()
|
|
1984
|
+
};
|
|
1985
|
+
}, function () {
|
|
1986
|
+
const loc = this.addEmptyLoc();
|
|
1987
|
+
const raw = this.deserializeString();
|
|
1988
|
+
const pattern = this.deserializeString();
|
|
1989
|
+
const flags = this.deserializeString();
|
|
1990
|
+
return {
|
|
1991
|
+
type: 'RegExpLiteral',
|
|
1992
|
+
loc,
|
|
1993
|
+
extra: {
|
|
1994
|
+
raw
|
|
1995
|
+
},
|
|
1996
|
+
pattern,
|
|
1997
|
+
flags
|
|
1998
|
+
};
|
|
1999
|
+
}, function () {
|
|
2000
|
+
return {
|
|
2001
|
+
type: 'Import',
|
|
2002
|
+
loc: this.addEmptyLoc()
|
|
2003
|
+
};
|
|
2004
|
+
}, function () {
|
|
2005
|
+
return {
|
|
2006
|
+
type: 'TupleTypeAnnotation',
|
|
2007
|
+
loc: this.addEmptyLoc(),
|
|
2008
|
+
types: this.deserializeNodeList()
|
|
2009
|
+
};
|
|
2010
|
+
}, function () {
|
|
2011
|
+
const loc = this.addEmptyLoc();
|
|
2012
|
+
const value = this.deserializeString();
|
|
2013
|
+
const rawValue = value;
|
|
2014
|
+
const raw = this.deserializeString();
|
|
2015
|
+
return {
|
|
2016
|
+
type: 'StringLiteralTypeAnnotation',
|
|
2017
|
+
loc,
|
|
2018
|
+
value,
|
|
2019
|
+
extra: {
|
|
2020
|
+
rawValue,
|
|
2021
|
+
raw
|
|
2022
|
+
}
|
|
2023
|
+
};
|
|
2024
|
+
}, function () {
|
|
2025
|
+
const loc = this.addEmptyLoc();
|
|
2026
|
+
const value = this.deserializeNumber();
|
|
2027
|
+
const raw = this.deserializeString();
|
|
2028
|
+
return {
|
|
2029
|
+
type: 'NumberLiteralTypeAnnotation',
|
|
2030
|
+
loc,
|
|
2031
|
+
value,
|
|
2032
|
+
extra: {
|
|
2033
|
+
rawValue: value,
|
|
2034
|
+
raw
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
}, function () {
|
|
2038
|
+
const loc = this.addEmptyLoc();
|
|
2039
|
+
const bigint = this.deserializeString();
|
|
2040
|
+
const raw = this.deserializeString();
|
|
2041
|
+
let value = null;
|
|
2042
|
+
if (bigint != null && typeof BigInt === 'function') {
|
|
2043
|
+
try {
|
|
2044
|
+
value = BigInt(bigint);
|
|
2045
|
+
} catch (error) {
|
|
2046
|
+
value = null;
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
return {
|
|
2050
|
+
type: 'BigIntLiteralTypeAnnotation',
|
|
2051
|
+
loc,
|
|
2052
|
+
value,
|
|
2053
|
+
extra: {
|
|
2054
|
+
rawValue: bigint,
|
|
2055
|
+
raw
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2058
|
+
}, function () {
|
|
2059
|
+
return {
|
|
2060
|
+
type: 'BooleanLiteralTypeAnnotation',
|
|
2061
|
+
loc: this.addEmptyLoc(),
|
|
2062
|
+
value: this.deserializeBoolean()
|
|
2063
|
+
};
|
|
2064
|
+
}, function () {
|
|
2065
|
+
const loc = this.addEmptyLoc();
|
|
2066
|
+
const value = this.deserializeString();
|
|
2067
|
+
const rawValue = value;
|
|
2068
|
+
const raw = this.deserializeString();
|
|
2069
|
+
return {
|
|
2070
|
+
type: 'JSXText',
|
|
2071
|
+
loc,
|
|
2072
|
+
value,
|
|
2073
|
+
extra: {
|
|
2074
|
+
rawValue,
|
|
2075
|
+
raw
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
}, function () {
|
|
2079
|
+
const node = {
|
|
2080
|
+
type: 'ClassDeclaration',
|
|
2081
|
+
loc: this.addEmptyLoc()
|
|
2082
|
+
};
|
|
2083
|
+
node.id = this.deserializeNode();
|
|
2084
|
+
{
|
|
2085
|
+
const value = this.deserializeNode();
|
|
2086
|
+
if (value != null) node['typeParameters'] = value;
|
|
2087
|
+
}
|
|
2088
|
+
node.superClass = this.deserializeNode();
|
|
2089
|
+
{
|
|
2090
|
+
const value = this.deserializeNodeList();
|
|
2091
|
+
if (value.length > 0) node['implements'] = value;
|
|
2092
|
+
}
|
|
2093
|
+
node.body = this.deserializeNode();
|
|
2094
|
+
{
|
|
2095
|
+
const value = this.deserializeNode();
|
|
2096
|
+
if (value != null) node['superTypeParameters'] = value;
|
|
2097
|
+
}
|
|
2098
|
+
{
|
|
2099
|
+
const value = this.deserializeNodeList();
|
|
2100
|
+
if (value.length > 0) node['decorators'] = value;
|
|
2101
|
+
}
|
|
2102
|
+
return node;
|
|
2103
|
+
}, function () {
|
|
2104
|
+
const node = {
|
|
2105
|
+
type: 'ClassExpression',
|
|
2106
|
+
loc: this.addEmptyLoc()
|
|
2107
|
+
};
|
|
2108
|
+
node.id = this.deserializeNode();
|
|
2109
|
+
{
|
|
2110
|
+
const value = this.deserializeNode();
|
|
2111
|
+
if (value != null) node['typeParameters'] = value;
|
|
2112
|
+
}
|
|
2113
|
+
node.superClass = this.deserializeNode();
|
|
2114
|
+
{
|
|
2115
|
+
const value = this.deserializeNodeList();
|
|
2116
|
+
if (value.length > 0) node['implements'] = value;
|
|
2117
|
+
}
|
|
2118
|
+
node.body = this.deserializeNode();
|
|
2119
|
+
{
|
|
2120
|
+
const value = this.deserializeNode();
|
|
2121
|
+
if (value != null) node['superTypeParameters'] = value;
|
|
2122
|
+
}
|
|
2123
|
+
{
|
|
2124
|
+
const value = this.deserializeNodeList();
|
|
2125
|
+
if (value.length > 0) node['decorators'] = value;
|
|
2126
|
+
}
|
|
2127
|
+
return node;
|
|
2128
|
+
}, function () {
|
|
2129
|
+
const node = {
|
|
2130
|
+
type: 'FunctionDeclaration',
|
|
2131
|
+
loc: this.addEmptyLoc()
|
|
2132
|
+
};
|
|
2133
|
+
node.id = this.deserializeNode();
|
|
2134
|
+
node.params = this.deserializeNodeList();
|
|
2135
|
+
node.body = this.deserializeNode();
|
|
2136
|
+
{
|
|
2137
|
+
const value = this.deserializeNode();
|
|
2138
|
+
if (value != null) node['typeParameters'] = value;
|
|
2139
|
+
}
|
|
2140
|
+
{
|
|
2141
|
+
const value = this.deserializeNode();
|
|
2142
|
+
if (value != null) node['returnType'] = value;
|
|
2143
|
+
}
|
|
2144
|
+
node.generator = this.deserializeBoolean();
|
|
2145
|
+
node.async = this.deserializeBoolean();
|
|
2146
|
+
{
|
|
2147
|
+
const value = this.deserializeNode();
|
|
2148
|
+
if (value != null) node['predicate'] = value;
|
|
2149
|
+
}
|
|
2150
|
+
if (this.deserializeBoolean()) node['__componentDeclaration'] = true;
|
|
2151
|
+
if (this.deserializeBoolean()) node['__hookDeclaration'] = true;
|
|
2152
|
+
return node;
|
|
2153
|
+
}, function () {
|
|
2154
|
+
const node = {
|
|
2155
|
+
type: 'FunctionExpression',
|
|
2156
|
+
loc: this.addEmptyLoc()
|
|
2157
|
+
};
|
|
2158
|
+
node.id = this.deserializeNode();
|
|
2159
|
+
node.params = this.deserializeNodeList();
|
|
2160
|
+
node.body = this.deserializeNode();
|
|
2161
|
+
{
|
|
2162
|
+
const value = this.deserializeNode();
|
|
2163
|
+
if (value != null) node['typeParameters'] = value;
|
|
2164
|
+
}
|
|
2165
|
+
{
|
|
2166
|
+
const value = this.deserializeNode();
|
|
2167
|
+
if (value != null) node['returnType'] = value;
|
|
2168
|
+
}
|
|
2169
|
+
node.generator = this.deserializeBoolean();
|
|
2170
|
+
node.async = this.deserializeBoolean();
|
|
2171
|
+
{
|
|
2172
|
+
const value = this.deserializeNode();
|
|
2173
|
+
if (value != null) node['predicate'] = value;
|
|
2174
|
+
}
|
|
2175
|
+
return node;
|
|
2176
|
+
}, function () {
|
|
2177
|
+
const node = {
|
|
2178
|
+
type: 'ArrowFunctionExpression',
|
|
2179
|
+
loc: this.addEmptyLoc()
|
|
2180
|
+
};
|
|
2181
|
+
node.params = this.deserializeNodeList();
|
|
2182
|
+
node.body = this.deserializeNode();
|
|
2183
|
+
{
|
|
2184
|
+
const value = this.deserializeNode();
|
|
2185
|
+
if (value != null) node['typeParameters'] = value;
|
|
2186
|
+
}
|
|
2187
|
+
{
|
|
2188
|
+
const value = this.deserializeNode();
|
|
2189
|
+
if (value != null) node['returnType'] = value;
|
|
2190
|
+
}
|
|
2191
|
+
node.async = this.deserializeBoolean();
|
|
2192
|
+
node.id = this.deserializeNode();
|
|
2193
|
+
{
|
|
2194
|
+
const value = this.deserializeNode();
|
|
2195
|
+
if (value != null) node['predicate'] = value;
|
|
2196
|
+
}
|
|
2197
|
+
return node;
|
|
2198
|
+
}, function () {
|
|
2199
|
+
return {
|
|
2200
|
+
type: 'MemberExpression',
|
|
2201
|
+
loc: this.addEmptyLoc(),
|
|
2202
|
+
object: this.deserializeNode(),
|
|
2203
|
+
property: this.deserializeNode(),
|
|
2204
|
+
computed: this.deserializeBoolean()
|
|
2205
|
+
};
|
|
2206
|
+
}, function () {
|
|
2207
|
+
return {
|
|
2208
|
+
type: 'ArrayExpression',
|
|
2209
|
+
loc: this.addEmptyLoc(),
|
|
2210
|
+
elements: this.deserializeNodeList()
|
|
2211
|
+
};
|
|
2212
|
+
}, function () {
|
|
2213
|
+
const node = {
|
|
2214
|
+
type: 'RestElement',
|
|
2215
|
+
loc: this.addEmptyLoc()
|
|
2216
|
+
};
|
|
2217
|
+
node.argument = this.deserializeNode();
|
|
2218
|
+
if (this.deserializeBoolean()) {
|
|
2219
|
+
node['typeAnnotation'] = this.deserializeNode();
|
|
2220
|
+
}
|
|
2221
|
+
return node;
|
|
2222
|
+
}, function () {
|
|
2223
|
+
return {
|
|
2224
|
+
type: 'OpaqueType',
|
|
2225
|
+
loc: this.addEmptyLoc(),
|
|
2226
|
+
id: this.deserializeNode(),
|
|
2227
|
+
typeParameters: this.deserializeNode(),
|
|
2228
|
+
impltype: this.deserializeNode(),
|
|
2229
|
+
supertype: this.deserializeNode()
|
|
2230
|
+
};
|
|
2231
|
+
}, function () {
|
|
2232
|
+
return {
|
|
2233
|
+
type: 'DeclareOpaqueType',
|
|
2234
|
+
loc: this.addEmptyLoc(),
|
|
2235
|
+
id: this.deserializeNode(),
|
|
2236
|
+
typeParameters: this.deserializeNode(),
|
|
2237
|
+
impltype: this.deserializeNode(),
|
|
2238
|
+
supertype: this.deserializeNode(),
|
|
2239
|
+
implicitDeclare: this.deserializeBoolean()
|
|
2240
|
+
};
|
|
2241
|
+
}, function () {
|
|
2242
|
+
return {
|
|
2243
|
+
type: 'ExportAllDeclaration',
|
|
2244
|
+
loc: this.addEmptyLoc(),
|
|
2245
|
+
source: this.deserializeNode(),
|
|
2246
|
+
exportKind: this.deserializeString()
|
|
2247
|
+
};
|
|
2248
|
+
}, function () {
|
|
2249
|
+
return {
|
|
2250
|
+
type: 'DeclareVariable',
|
|
2251
|
+
loc: this.addEmptyLoc(),
|
|
2252
|
+
id: this.deserializeNode()
|
|
2253
|
+
};
|
|
2254
|
+
}, function () {
|
|
2255
|
+
const node = {
|
|
2256
|
+
type: 'Identifier',
|
|
2257
|
+
loc: this.addEmptyLoc()
|
|
2258
|
+
};
|
|
2259
|
+
node.name = this.deserializeString();
|
|
2260
|
+
{
|
|
2261
|
+
const value = this.deserializeNode();
|
|
2262
|
+
if (value != null) node['typeAnnotation'] = value;
|
|
2263
|
+
}
|
|
2264
|
+
if (this.deserializeBoolean()) node['optional'] = true;
|
|
2265
|
+
return node;
|
|
2266
|
+
}, function () {
|
|
2267
|
+
const node = {
|
|
2268
|
+
type: 'ObjectPattern',
|
|
2269
|
+
loc: this.addEmptyLoc()
|
|
2270
|
+
};
|
|
2271
|
+
node.properties = this.deserializeNodeList();
|
|
2272
|
+
{
|
|
2273
|
+
const value = this.deserializeNode();
|
|
2274
|
+
if (value != null) node['typeAnnotation'] = value;
|
|
2275
|
+
}
|
|
2276
|
+
if (this.deserializeBoolean()) {
|
|
2277
|
+
node['optional'] = this.deserializeBoolean();
|
|
2278
|
+
}
|
|
2279
|
+
return node;
|
|
2280
|
+
}, function () {
|
|
2281
|
+
const node = {
|
|
2282
|
+
type: 'ArrayPattern',
|
|
2283
|
+
loc: this.addEmptyLoc()
|
|
2284
|
+
};
|
|
2285
|
+
node.elements = this.deserializeNodeList();
|
|
2286
|
+
{
|
|
2287
|
+
const value = this.deserializeNode();
|
|
2288
|
+
if (value != null) node['typeAnnotation'] = value;
|
|
2289
|
+
}
|
|
2290
|
+
if (this.deserializeBoolean()) {
|
|
2291
|
+
node['optional'] = this.deserializeBoolean();
|
|
2292
|
+
}
|
|
2293
|
+
return node;
|
|
2294
|
+
}, function () {
|
|
2295
|
+
const node = {
|
|
2296
|
+
type: 'CallExpression',
|
|
2297
|
+
loc: this.addEmptyLoc()
|
|
2298
|
+
};
|
|
2299
|
+
node.callee = this.deserializeNode();
|
|
2300
|
+
{
|
|
2301
|
+
const value = this.deserializeNode();
|
|
2302
|
+
if (value != null) node['typeArguments'] = value;
|
|
2303
|
+
}
|
|
2304
|
+
node.arguments = this.deserializeNodeList();
|
|
2305
|
+
if (this.deserializeBoolean()) node['optional'] = true;
|
|
2306
|
+
return node;
|
|
2307
|
+
}, function () {
|
|
2308
|
+
const node = {
|
|
2309
|
+
type: 'OptionalCallExpression',
|
|
2310
|
+
loc: this.addEmptyLoc()
|
|
2311
|
+
};
|
|
2312
|
+
node.callee = this.deserializeNode();
|
|
2313
|
+
{
|
|
2314
|
+
const value = this.deserializeNode();
|
|
2315
|
+
if (value != null) node['typeArguments'] = value;
|
|
2316
|
+
}
|
|
2317
|
+
node.arguments = this.deserializeNodeList();
|
|
2318
|
+
node.optional = this.deserializeBoolean();
|
|
2319
|
+
return node;
|
|
2320
|
+
}, function () {
|
|
2321
|
+
const node = {
|
|
2322
|
+
type: 'ImportDeclaration',
|
|
2323
|
+
loc: this.addEmptyLoc()
|
|
2324
|
+
};
|
|
2325
|
+
node.specifiers = this.deserializeNodeList();
|
|
2326
|
+
node.source = this.deserializeNode();
|
|
2327
|
+
node.importKind = this.deserializeString();
|
|
2328
|
+
{
|
|
2329
|
+
const value = this.deserializeNodeList();
|
|
2330
|
+
if (value.length > 0) node['attributes'] = value;
|
|
2331
|
+
}
|
|
2332
|
+
return node;
|
|
2333
|
+
}, function () {
|
|
2334
|
+
const node = {
|
|
2335
|
+
type: 'ExportNamedDeclaration',
|
|
2336
|
+
loc: this.addEmptyLoc()
|
|
2337
|
+
};
|
|
2338
|
+
{
|
|
2339
|
+
const value = this.deserializeNode();
|
|
2340
|
+
if (value != null) node['declaration'] = value;
|
|
2341
|
+
}
|
|
2342
|
+
node.specifiers = this.deserializeNodeList();
|
|
2343
|
+
node.source = this.deserializeNode();
|
|
2344
|
+
node.exportKind = this.deserializeString();
|
|
2345
|
+
return node;
|
|
2346
|
+
}, function () {
|
|
2347
|
+
return {
|
|
2348
|
+
type: 'JSXOpeningElement',
|
|
2349
|
+
loc: this.addEmptyLoc(),
|
|
2350
|
+
name: this.deserializeNode(),
|
|
2351
|
+
attributes: this.deserializeNodeList(),
|
|
2352
|
+
selfClosing: this.deserializeBoolean()
|
|
2353
|
+
};
|
|
2354
|
+
}, function () {
|
|
2355
|
+
return {
|
|
2356
|
+
type: 'TypeofTypeAnnotation',
|
|
2357
|
+
loc: this.addEmptyLoc(),
|
|
2358
|
+
argument: this.deserializeNode()
|
|
2359
|
+
};
|
|
2360
|
+
}, function () {
|
|
2361
|
+
this.addEmptyLoc();
|
|
2362
|
+
return this.deserializeEnumRuntime();
|
|
2363
|
+
}, function () {
|
|
2364
|
+
return {
|
|
2365
|
+
type: 'Program',
|
|
2366
|
+
loc: this.addEmptyLoc(),
|
|
2367
|
+
body: this.deserializeNodeList(),
|
|
2368
|
+
directives: this.deserializeNodeList(),
|
|
2369
|
+
sourceType: this.deserializeString(),
|
|
2370
|
+
interpreter: this.deserializeNode()
|
|
2371
|
+
};
|
|
2372
|
+
}, function () {
|
|
2373
|
+
return {
|
|
2374
|
+
type: 'File',
|
|
2375
|
+
loc: this.addEmptyLoc(),
|
|
2376
|
+
program: this.deserializeNode(),
|
|
2377
|
+
comments: this.deserializeComments()
|
|
2378
|
+
};
|
|
1774
2379
|
}];
|