oxc-parser 0.68.0 → 0.69.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/generated/deserialize/js.js +48 -393
- package/generated/deserialize/ts.js +62 -407
- package/package.json +18 -12
- package/wrap.cjs +28 -17
- package/wrap.mjs +30 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
2
|
-
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs
|
|
2
|
+
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`.
|
|
3
3
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -148,7 +148,7 @@ function deserializeTaggedTemplateExpression(pos) {
|
|
|
148
148
|
start: deserializeU32(pos),
|
|
149
149
|
end: deserializeU32(pos + 4),
|
|
150
150
|
tag: deserializeExpression(pos + 8),
|
|
151
|
-
quasi: deserializeTemplateLiteral(pos +
|
|
151
|
+
quasi: deserializeTemplateLiteral(pos + 32),
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -224,7 +224,7 @@ function deserializeNewExpression(pos) {
|
|
|
224
224
|
start: deserializeU32(pos),
|
|
225
225
|
end: deserializeU32(pos + 4),
|
|
226
226
|
callee: deserializeExpression(pos + 8),
|
|
227
|
-
arguments: deserializeVecArgument(pos +
|
|
227
|
+
arguments: deserializeVecArgument(pos + 32),
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -866,10 +866,10 @@ function deserializePropertyDefinition(pos) {
|
|
|
866
866
|
type: deserializePropertyDefinitionType(pos + 8),
|
|
867
867
|
start: deserializeU32(pos),
|
|
868
868
|
end: deserializeU32(pos + 4),
|
|
869
|
-
static: deserializeBool(pos +
|
|
870
|
-
computed: deserializeBool(pos +
|
|
869
|
+
static: deserializeBool(pos + 89),
|
|
870
|
+
computed: deserializeBool(pos + 88),
|
|
871
871
|
key: deserializePropertyKey(pos + 48),
|
|
872
|
-
value: deserializeOptionExpression(pos +
|
|
872
|
+
value: deserializeOptionExpression(pos + 72),
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
875
|
|
|
@@ -897,9 +897,9 @@ function deserializeAccessorProperty(pos) {
|
|
|
897
897
|
start: deserializeU32(pos),
|
|
898
898
|
end: deserializeU32(pos + 4),
|
|
899
899
|
key: deserializePropertyKey(pos + 48),
|
|
900
|
-
value: deserializeOptionExpression(pos +
|
|
901
|
-
computed: deserializeBool(pos +
|
|
902
|
-
static: deserializeBool(pos +
|
|
900
|
+
value: deserializeOptionExpression(pos + 72),
|
|
901
|
+
computed: deserializeBool(pos + 88),
|
|
902
|
+
static: deserializeBool(pos + 89),
|
|
903
903
|
};
|
|
904
904
|
}
|
|
905
905
|
|
|
@@ -1109,11 +1109,17 @@ function deserializeRegExpLiteral(pos) {
|
|
|
1109
1109
|
|
|
1110
1110
|
function deserializeRegExp(pos) {
|
|
1111
1111
|
return {
|
|
1112
|
-
pattern:
|
|
1112
|
+
pattern: deserializeStr(pos),
|
|
1113
1113
|
flags: deserializeRegExpFlags(pos + 24),
|
|
1114
1114
|
};
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
|
+
function deserializeRegExpPattern(pos) {
|
|
1118
|
+
return {
|
|
1119
|
+
pattern: deserializeStr(pos),
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1117
1123
|
function deserializeRegExpFlags(pos) {
|
|
1118
1124
|
const flagBits = deserializeU8(pos);
|
|
1119
1125
|
let flags = '';
|
|
@@ -1130,7 +1136,7 @@ function deserializeRegExpFlags(pos) {
|
|
|
1130
1136
|
}
|
|
1131
1137
|
|
|
1132
1138
|
function deserializeJSXElement(pos) {
|
|
1133
|
-
const closingElement = deserializeOptionBoxJSXClosingElement(pos +
|
|
1139
|
+
const closingElement = deserializeOptionBoxJSXClosingElement(pos + 48);
|
|
1134
1140
|
const openingElement = deserializeBoxJSXOpeningElement(pos + 8);
|
|
1135
1141
|
if (closingElement === null) openingElement.selfClosing = true;
|
|
1136
1142
|
return {
|
|
@@ -1139,7 +1145,7 @@ function deserializeJSXElement(pos) {
|
|
|
1139
1145
|
end: deserializeU32(pos + 4),
|
|
1140
1146
|
openingElement,
|
|
1141
1147
|
closingElement,
|
|
1142
|
-
children: deserializeVecJSXChild(pos +
|
|
1148
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1143
1149
|
};
|
|
1144
1150
|
}
|
|
1145
1151
|
|
|
@@ -1148,7 +1154,7 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
1148
1154
|
type: 'JSXOpeningElement',
|
|
1149
1155
|
start: deserializeU32(pos),
|
|
1150
1156
|
end: deserializeU32(pos + 4),
|
|
1151
|
-
attributes: deserializeVecJSXAttributeItem(pos +
|
|
1157
|
+
attributes: deserializeVecJSXAttributeItem(pos + 32),
|
|
1152
1158
|
name: deserializeJSXElementName(pos + 8),
|
|
1153
1159
|
selfClosing: false,
|
|
1154
1160
|
};
|
|
@@ -1169,8 +1175,8 @@ function deserializeJSXFragment(pos) {
|
|
|
1169
1175
|
start: deserializeU32(pos),
|
|
1170
1176
|
end: deserializeU32(pos + 4),
|
|
1171
1177
|
openingFragment: deserializeJSXOpeningFragment(pos + 8),
|
|
1172
|
-
closingFragment: deserializeJSXClosingFragment(pos +
|
|
1173
|
-
children: deserializeVecJSXChild(pos +
|
|
1178
|
+
closingFragment: deserializeJSXClosingFragment(pos + 48),
|
|
1179
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1174
1180
|
};
|
|
1175
1181
|
}
|
|
1176
1182
|
|
|
@@ -1283,9 +1289,9 @@ function deserializeTSThisParameter(pos) {
|
|
|
1283
1289
|
start: deserializeU32(pos),
|
|
1284
1290
|
end: deserializeU32(pos + 4),
|
|
1285
1291
|
name: 'this',
|
|
1286
|
-
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1287
1292
|
decorators: [],
|
|
1288
1293
|
optional: false,
|
|
1294
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1289
1295
|
};
|
|
1290
1296
|
}
|
|
1291
1297
|
|
|
@@ -1421,8 +1427,8 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
1421
1427
|
type: 'TSNamedTupleMember',
|
|
1422
1428
|
start: deserializeU32(pos),
|
|
1423
1429
|
end: deserializeU32(pos + 4),
|
|
1424
|
-
|
|
1425
|
-
|
|
1430
|
+
label: deserializeIdentifierName(pos + 8),
|
|
1431
|
+
elementType: deserializeTSTupleElement(pos + 32),
|
|
1426
1432
|
optional: deserializeBool(pos + 48),
|
|
1427
1433
|
};
|
|
1428
1434
|
}
|
|
@@ -1758,9 +1764,9 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
1758
1764
|
start: deserializeU32(pos),
|
|
1759
1765
|
end: deserializeU32(pos + 4),
|
|
1760
1766
|
name: deserializeStr(pos + 8),
|
|
1761
|
-
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1762
1767
|
decorators: [],
|
|
1763
1768
|
optional: false,
|
|
1769
|
+
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1764
1770
|
};
|
|
1765
1771
|
}
|
|
1766
1772
|
|
|
@@ -1853,22 +1859,12 @@ function deserializeTSTypeQuery(pos) {
|
|
|
1853
1859
|
}
|
|
1854
1860
|
|
|
1855
1861
|
function deserializeTSImportType(pos) {
|
|
1856
|
-
let options = deserializeOptionBoxObjectExpression(pos + 24);
|
|
1857
|
-
if (options !== null && options.properties.length === 1) {
|
|
1858
|
-
const prop = options.properties[0];
|
|
1859
|
-
if (
|
|
1860
|
-
!prop.method && !prop.shorthand && !prop.computed &&
|
|
1861
|
-
prop.key.type === 'Identifier' && prop.key.name === 'assert'
|
|
1862
|
-
) {
|
|
1863
|
-
prop.key.name = 'with';
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
1862
|
return {
|
|
1867
1863
|
type: 'TSImportType',
|
|
1868
1864
|
start: deserializeU32(pos),
|
|
1869
1865
|
end: deserializeU32(pos + 4),
|
|
1870
1866
|
argument: deserializeTSType(pos + 8),
|
|
1871
|
-
options,
|
|
1867
|
+
options: deserializeOptionBoxObjectExpression(pos + 24),
|
|
1872
1868
|
qualifier: deserializeOptionTSTypeName(pos + 32),
|
|
1873
1869
|
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 48),
|
|
1874
1870
|
};
|
|
@@ -1901,6 +1897,8 @@ function deserializeTSConstructorType(pos) {
|
|
|
1901
1897
|
}
|
|
1902
1898
|
|
|
1903
1899
|
function deserializeTSMappedType(pos) {
|
|
1900
|
+
let optional = deserializeOptionTSMappedTypeModifierOperator(pos + 48) || false;
|
|
1901
|
+
if (optional === null) optional = false;
|
|
1904
1902
|
const typeParameter = deserializeBoxTSTypeParameter(pos + 8);
|
|
1905
1903
|
return {
|
|
1906
1904
|
type: 'TSMappedType',
|
|
@@ -1908,7 +1906,7 @@ function deserializeTSMappedType(pos) {
|
|
|
1908
1906
|
end: deserializeU32(pos + 4),
|
|
1909
1907
|
nameType: deserializeOptionTSType(pos + 16),
|
|
1910
1908
|
typeAnnotation: deserializeOptionTSType(pos + 32),
|
|
1911
|
-
optional
|
|
1909
|
+
optional,
|
|
1912
1910
|
readonly: deserializeOptionTSMappedTypeModifierOperator(pos + 49),
|
|
1913
1911
|
key: typeParameter.name,
|
|
1914
1912
|
constraint: typeParameter.constraint,
|
|
@@ -1950,8 +1948,8 @@ function deserializeTSTypeAssertion(pos) {
|
|
|
1950
1948
|
type: 'TSTypeAssertion',
|
|
1951
1949
|
start: deserializeU32(pos),
|
|
1952
1950
|
end: deserializeU32(pos + 4),
|
|
1953
|
-
|
|
1954
|
-
|
|
1951
|
+
typeAnnotation: deserializeTSType(pos + 8),
|
|
1952
|
+
expression: deserializeExpression(pos + 24),
|
|
1955
1953
|
};
|
|
1956
1954
|
}
|
|
1957
1955
|
|
|
@@ -2111,202 +2109,6 @@ function deserializeSourceType(pos) {
|
|
|
2111
2109
|
};
|
|
2112
2110
|
}
|
|
2113
2111
|
|
|
2114
|
-
function deserializePattern(pos) {
|
|
2115
|
-
return {
|
|
2116
|
-
type: 'Pattern',
|
|
2117
|
-
start: deserializeU32(pos),
|
|
2118
|
-
end: deserializeU32(pos + 4),
|
|
2119
|
-
body: deserializeDisjunction(pos + 8),
|
|
2120
|
-
};
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
function deserializeDisjunction(pos) {
|
|
2124
|
-
return {
|
|
2125
|
-
type: 'Disjunction',
|
|
2126
|
-
start: deserializeU32(pos),
|
|
2127
|
-
end: deserializeU32(pos + 4),
|
|
2128
|
-
body: deserializeVecAlternative(pos + 8),
|
|
2129
|
-
};
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
function deserializeAlternative(pos) {
|
|
2133
|
-
return {
|
|
2134
|
-
type: 'Alternative',
|
|
2135
|
-
start: deserializeU32(pos),
|
|
2136
|
-
end: deserializeU32(pos + 4),
|
|
2137
|
-
body: deserializeVecTerm(pos + 8),
|
|
2138
|
-
};
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
function deserializeBoundaryAssertion(pos) {
|
|
2142
|
-
return {
|
|
2143
|
-
type: 'BoundaryAssertion',
|
|
2144
|
-
start: deserializeU32(pos),
|
|
2145
|
-
end: deserializeU32(pos + 4),
|
|
2146
|
-
kind: deserializeBoundaryAssertionKind(pos + 8),
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
function deserializeLookAroundAssertion(pos) {
|
|
2151
|
-
return {
|
|
2152
|
-
type: 'LookAroundAssertion',
|
|
2153
|
-
start: deserializeU32(pos),
|
|
2154
|
-
end: deserializeU32(pos + 4),
|
|
2155
|
-
kind: deserializeLookAroundAssertionKind(pos + 8),
|
|
2156
|
-
body: deserializeDisjunction(pos + 16),
|
|
2157
|
-
};
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
function deserializeQuantifier(pos) {
|
|
2161
|
-
return {
|
|
2162
|
-
type: 'Quantifier',
|
|
2163
|
-
start: deserializeU32(pos),
|
|
2164
|
-
end: deserializeU32(pos + 4),
|
|
2165
|
-
min: deserializeU64(pos + 8),
|
|
2166
|
-
max: deserializeOptionU64(pos + 16),
|
|
2167
|
-
greedy: deserializeBool(pos + 32),
|
|
2168
|
-
body: deserializeTerm(pos + 40),
|
|
2169
|
-
};
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
function deserializeCharacter(pos) {
|
|
2173
|
-
return {
|
|
2174
|
-
type: 'Character',
|
|
2175
|
-
start: deserializeU32(pos),
|
|
2176
|
-
end: deserializeU32(pos + 4),
|
|
2177
|
-
kind: deserializeCharacterKind(pos + 8),
|
|
2178
|
-
value: deserializeU32(pos + 12),
|
|
2179
|
-
};
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
function deserializeCharacterClassEscape(pos) {
|
|
2183
|
-
return {
|
|
2184
|
-
type: 'CharacterClassEscape',
|
|
2185
|
-
start: deserializeU32(pos),
|
|
2186
|
-
end: deserializeU32(pos + 4),
|
|
2187
|
-
kind: deserializeCharacterClassEscapeKind(pos + 8),
|
|
2188
|
-
};
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
function deserializeUnicodePropertyEscape(pos) {
|
|
2192
|
-
return {
|
|
2193
|
-
type: 'UnicodePropertyEscape',
|
|
2194
|
-
start: deserializeU32(pos),
|
|
2195
|
-
end: deserializeU32(pos + 4),
|
|
2196
|
-
negative: deserializeBool(pos + 8),
|
|
2197
|
-
strings: deserializeBool(pos + 9),
|
|
2198
|
-
name: deserializeStr(pos + 16),
|
|
2199
|
-
value: deserializeOptionStr(pos + 32),
|
|
2200
|
-
};
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
function deserializeDot(pos) {
|
|
2204
|
-
return {
|
|
2205
|
-
type: 'Dot',
|
|
2206
|
-
start: deserializeU32(pos),
|
|
2207
|
-
end: deserializeU32(pos + 4),
|
|
2208
|
-
};
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
function deserializeCharacterClass(pos) {
|
|
2212
|
-
return {
|
|
2213
|
-
type: 'CharacterClass',
|
|
2214
|
-
start: deserializeU32(pos),
|
|
2215
|
-
end: deserializeU32(pos + 4),
|
|
2216
|
-
negative: deserializeBool(pos + 8),
|
|
2217
|
-
strings: deserializeBool(pos + 9),
|
|
2218
|
-
kind: deserializeCharacterClassContentsKind(pos + 10),
|
|
2219
|
-
body: deserializeVecCharacterClassContents(pos + 16),
|
|
2220
|
-
};
|
|
2221
|
-
}
|
|
2222
|
-
|
|
2223
|
-
function deserializeCharacterClassRange(pos) {
|
|
2224
|
-
return {
|
|
2225
|
-
type: 'CharacterClassRange',
|
|
2226
|
-
start: deserializeU32(pos),
|
|
2227
|
-
end: deserializeU32(pos + 4),
|
|
2228
|
-
min: deserializeCharacter(pos + 8),
|
|
2229
|
-
max: deserializeCharacter(pos + 24),
|
|
2230
|
-
};
|
|
2231
|
-
}
|
|
2232
|
-
|
|
2233
|
-
function deserializeClassStringDisjunction(pos) {
|
|
2234
|
-
return {
|
|
2235
|
-
type: 'ClassStringDisjunction',
|
|
2236
|
-
start: deserializeU32(pos),
|
|
2237
|
-
end: deserializeU32(pos + 4),
|
|
2238
|
-
strings: deserializeBool(pos + 8),
|
|
2239
|
-
body: deserializeVecClassString(pos + 16),
|
|
2240
|
-
};
|
|
2241
|
-
}
|
|
2242
|
-
|
|
2243
|
-
function deserializeClassString(pos) {
|
|
2244
|
-
return {
|
|
2245
|
-
type: 'ClassString',
|
|
2246
|
-
start: deserializeU32(pos),
|
|
2247
|
-
end: deserializeU32(pos + 4),
|
|
2248
|
-
strings: deserializeBool(pos + 8),
|
|
2249
|
-
body: deserializeVecCharacter(pos + 16),
|
|
2250
|
-
};
|
|
2251
|
-
}
|
|
2252
|
-
|
|
2253
|
-
function deserializeCapturingGroup(pos) {
|
|
2254
|
-
return {
|
|
2255
|
-
type: 'CapturingGroup',
|
|
2256
|
-
start: deserializeU32(pos),
|
|
2257
|
-
end: deserializeU32(pos + 4),
|
|
2258
|
-
name: deserializeOptionStr(pos + 8),
|
|
2259
|
-
body: deserializeDisjunction(pos + 24),
|
|
2260
|
-
};
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
function deserializeIgnoreGroup(pos) {
|
|
2264
|
-
return {
|
|
2265
|
-
type: 'IgnoreGroup',
|
|
2266
|
-
start: deserializeU32(pos),
|
|
2267
|
-
end: deserializeU32(pos + 4),
|
|
2268
|
-
modifiers: deserializeOptionModifiers(pos + 8),
|
|
2269
|
-
body: deserializeDisjunction(pos + 24),
|
|
2270
|
-
};
|
|
2271
|
-
}
|
|
2272
|
-
|
|
2273
|
-
function deserializeModifiers(pos) {
|
|
2274
|
-
return {
|
|
2275
|
-
type: 'Modifiers',
|
|
2276
|
-
start: deserializeU32(pos),
|
|
2277
|
-
end: deserializeU32(pos + 4),
|
|
2278
|
-
enabling: deserializeOptionModifier(pos + 8),
|
|
2279
|
-
disabling: deserializeOptionModifier(pos + 11),
|
|
2280
|
-
};
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
function deserializeModifier(pos) {
|
|
2284
|
-
return {
|
|
2285
|
-
type: 'Modifier',
|
|
2286
|
-
ignoreCase: deserializeBool(pos),
|
|
2287
|
-
multiline: deserializeBool(pos + 1),
|
|
2288
|
-
sticky: deserializeBool(pos + 2),
|
|
2289
|
-
};
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
function deserializeIndexedReference(pos) {
|
|
2293
|
-
return {
|
|
2294
|
-
type: 'IndexedReference',
|
|
2295
|
-
start: deserializeU32(pos),
|
|
2296
|
-
end: deserializeU32(pos + 4),
|
|
2297
|
-
index: deserializeU32(pos + 8),
|
|
2298
|
-
};
|
|
2299
|
-
}
|
|
2300
|
-
|
|
2301
|
-
function deserializeNamedReference(pos) {
|
|
2302
|
-
return {
|
|
2303
|
-
type: 'NamedReference',
|
|
2304
|
-
start: deserializeU32(pos),
|
|
2305
|
-
end: deserializeU32(pos + 4),
|
|
2306
|
-
name: deserializeStr(pos + 8),
|
|
2307
|
-
};
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
2112
|
function deserializeRawTransferData(pos) {
|
|
2311
2113
|
return {
|
|
2312
2114
|
program: deserializeProgram(pos),
|
|
@@ -3419,19 +3221,6 @@ function deserializeModuleExportName(pos) {
|
|
|
3419
3221
|
}
|
|
3420
3222
|
}
|
|
3421
3223
|
|
|
3422
|
-
function deserializeRegExpPattern(pos) {
|
|
3423
|
-
switch (uint8[pos]) {
|
|
3424
|
-
case 0:
|
|
3425
|
-
return deserializeStr(pos + 8);
|
|
3426
|
-
case 1:
|
|
3427
|
-
return deserializeStr(pos + 8);
|
|
3428
|
-
case 2:
|
|
3429
|
-
return deserializeBoxPattern(pos + 8);
|
|
3430
|
-
default:
|
|
3431
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for RegExpPattern`);
|
|
3432
|
-
}
|
|
3433
|
-
}
|
|
3434
|
-
|
|
3435
3224
|
function deserializeJSXElementName(pos) {
|
|
3436
3225
|
switch (uint8[pos]) {
|
|
3437
3226
|
case 0:
|
|
@@ -3831,7 +3620,7 @@ function deserializeTSTupleElement(pos) {
|
|
|
3831
3620
|
function deserializeTSTypeName(pos) {
|
|
3832
3621
|
switch (uint8[pos]) {
|
|
3833
3622
|
case 0:
|
|
3834
|
-
let id =
|
|
3623
|
+
let id = deserializeBoxIdentifierReference(pos + 8);
|
|
3835
3624
|
if (id.name === 'this') id = { type: 'ThisExpression', start: id.start, end: id.end };
|
|
3836
3625
|
return id;
|
|
3837
3626
|
case 1:
|
|
@@ -3933,7 +3722,7 @@ function deserializeTSModuleDeclarationBody(pos) {
|
|
|
3933
3722
|
function deserializeTSTypeQueryExprName(pos) {
|
|
3934
3723
|
switch (uint8[pos]) {
|
|
3935
3724
|
case 0:
|
|
3936
|
-
let id =
|
|
3725
|
+
let id = deserializeBoxIdentifierReference(pos + 8);
|
|
3937
3726
|
if (id.name === 'this') id = { type: 'ThisExpression', start: id.start, end: id.end };
|
|
3938
3727
|
return id;
|
|
3939
3728
|
case 1:
|
|
@@ -3961,7 +3750,7 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
3961
3750
|
function deserializeTSModuleReference(pos) {
|
|
3962
3751
|
switch (uint8[pos]) {
|
|
3963
3752
|
case 0:
|
|
3964
|
-
let id =
|
|
3753
|
+
let id = deserializeBoxIdentifierReference(pos + 8);
|
|
3965
3754
|
if (id.name === 'this') id = { type: 'ThisExpression', start: id.start, end: id.end };
|
|
3966
3755
|
return id;
|
|
3967
3756
|
case 1:
|
|
@@ -4202,145 +3991,6 @@ function deserializeModuleKind(pos) {
|
|
|
4202
3991
|
}
|
|
4203
3992
|
}
|
|
4204
3993
|
|
|
4205
|
-
function deserializeTerm(pos) {
|
|
4206
|
-
switch (uint8[pos]) {
|
|
4207
|
-
case 0:
|
|
4208
|
-
return deserializeBoxBoundaryAssertion(pos + 8);
|
|
4209
|
-
case 1:
|
|
4210
|
-
return deserializeBoxLookAroundAssertion(pos + 8);
|
|
4211
|
-
case 2:
|
|
4212
|
-
return deserializeBoxQuantifier(pos + 8);
|
|
4213
|
-
case 3:
|
|
4214
|
-
return deserializeBoxCharacter(pos + 8);
|
|
4215
|
-
case 4:
|
|
4216
|
-
return deserializeDot(pos + 8);
|
|
4217
|
-
case 5:
|
|
4218
|
-
return deserializeBoxCharacterClassEscape(pos + 8);
|
|
4219
|
-
case 6:
|
|
4220
|
-
return deserializeBoxUnicodePropertyEscape(pos + 8);
|
|
4221
|
-
case 7:
|
|
4222
|
-
return deserializeBoxCharacterClass(pos + 8);
|
|
4223
|
-
case 8:
|
|
4224
|
-
return deserializeBoxCapturingGroup(pos + 8);
|
|
4225
|
-
case 9:
|
|
4226
|
-
return deserializeBoxIgnoreGroup(pos + 8);
|
|
4227
|
-
case 10:
|
|
4228
|
-
return deserializeBoxIndexedReference(pos + 8);
|
|
4229
|
-
case 11:
|
|
4230
|
-
return deserializeBoxNamedReference(pos + 8);
|
|
4231
|
-
default:
|
|
4232
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for Term`);
|
|
4233
|
-
}
|
|
4234
|
-
}
|
|
4235
|
-
|
|
4236
|
-
function deserializeBoundaryAssertionKind(pos) {
|
|
4237
|
-
switch (uint8[pos]) {
|
|
4238
|
-
case 0:
|
|
4239
|
-
return 'start';
|
|
4240
|
-
case 1:
|
|
4241
|
-
return 'end';
|
|
4242
|
-
case 2:
|
|
4243
|
-
return 'boundary';
|
|
4244
|
-
case 3:
|
|
4245
|
-
return 'negativeBoundary';
|
|
4246
|
-
default:
|
|
4247
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for BoundaryAssertionKind`);
|
|
4248
|
-
}
|
|
4249
|
-
}
|
|
4250
|
-
|
|
4251
|
-
function deserializeLookAroundAssertionKind(pos) {
|
|
4252
|
-
switch (uint8[pos]) {
|
|
4253
|
-
case 0:
|
|
4254
|
-
return 'lookahead';
|
|
4255
|
-
case 1:
|
|
4256
|
-
return 'negativeLookahead';
|
|
4257
|
-
case 2:
|
|
4258
|
-
return 'lookbehind';
|
|
4259
|
-
case 3:
|
|
4260
|
-
return 'negativeLookbehind';
|
|
4261
|
-
default:
|
|
4262
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for LookAroundAssertionKind`);
|
|
4263
|
-
}
|
|
4264
|
-
}
|
|
4265
|
-
|
|
4266
|
-
function deserializeCharacterKind(pos) {
|
|
4267
|
-
switch (uint8[pos]) {
|
|
4268
|
-
case 0:
|
|
4269
|
-
return 'controlLetter';
|
|
4270
|
-
case 1:
|
|
4271
|
-
return 'hexadecimalEscape';
|
|
4272
|
-
case 2:
|
|
4273
|
-
return 'identifier';
|
|
4274
|
-
case 3:
|
|
4275
|
-
return 'null';
|
|
4276
|
-
case 4:
|
|
4277
|
-
return 'octal1';
|
|
4278
|
-
case 5:
|
|
4279
|
-
return 'octal2';
|
|
4280
|
-
case 6:
|
|
4281
|
-
return 'octal3';
|
|
4282
|
-
case 7:
|
|
4283
|
-
return 'singleEscape';
|
|
4284
|
-
case 8:
|
|
4285
|
-
return 'symbol';
|
|
4286
|
-
case 9:
|
|
4287
|
-
return 'unicodeEscape';
|
|
4288
|
-
default:
|
|
4289
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterKind`);
|
|
4290
|
-
}
|
|
4291
|
-
}
|
|
4292
|
-
|
|
4293
|
-
function deserializeCharacterClassEscapeKind(pos) {
|
|
4294
|
-
switch (uint8[pos]) {
|
|
4295
|
-
case 0:
|
|
4296
|
-
return 'd';
|
|
4297
|
-
case 1:
|
|
4298
|
-
return 'negativeD';
|
|
4299
|
-
case 2:
|
|
4300
|
-
return 's';
|
|
4301
|
-
case 3:
|
|
4302
|
-
return 'negativeS';
|
|
4303
|
-
case 4:
|
|
4304
|
-
return 'w';
|
|
4305
|
-
case 5:
|
|
4306
|
-
return 'negativeW';
|
|
4307
|
-
default:
|
|
4308
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterClassEscapeKind`);
|
|
4309
|
-
}
|
|
4310
|
-
}
|
|
4311
|
-
|
|
4312
|
-
function deserializeCharacterClassContentsKind(pos) {
|
|
4313
|
-
switch (uint8[pos]) {
|
|
4314
|
-
case 0:
|
|
4315
|
-
return 'union';
|
|
4316
|
-
case 1:
|
|
4317
|
-
return 'intersection';
|
|
4318
|
-
case 2:
|
|
4319
|
-
return 'subtraction';
|
|
4320
|
-
default:
|
|
4321
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterClassContentsKind`);
|
|
4322
|
-
}
|
|
4323
|
-
}
|
|
4324
|
-
|
|
4325
|
-
function deserializeCharacterClassContents(pos) {
|
|
4326
|
-
switch (uint8[pos]) {
|
|
4327
|
-
case 0:
|
|
4328
|
-
return deserializeBoxCharacterClassRange(pos + 8);
|
|
4329
|
-
case 1:
|
|
4330
|
-
return deserializeBoxCharacterClassEscape(pos + 8);
|
|
4331
|
-
case 2:
|
|
4332
|
-
return deserializeBoxUnicodePropertyEscape(pos + 8);
|
|
4333
|
-
case 3:
|
|
4334
|
-
return deserializeBoxCharacter(pos + 8);
|
|
4335
|
-
case 4:
|
|
4336
|
-
return deserializeBoxCharacterClass(pos + 8);
|
|
4337
|
-
case 5:
|
|
4338
|
-
return deserializeBoxClassStringDisjunction(pos + 8);
|
|
4339
|
-
default:
|
|
4340
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterClassContents`);
|
|
4341
|
-
}
|
|
4342
|
-
}
|
|
4343
|
-
|
|
4344
3994
|
function deserializeErrorSeverity(pos) {
|
|
4345
3995
|
switch (uint8[pos]) {
|
|
4346
3996
|
case 0:
|
|
@@ -5208,6 +4858,11 @@ function deserializeBoxPattern(pos) {
|
|
|
5208
4858
|
return deserializePattern(uint32[pos >> 2]);
|
|
5209
4859
|
}
|
|
5210
4860
|
|
|
4861
|
+
function deserializeOptionBoxPattern(pos) {
|
|
4862
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
4863
|
+
return deserializeBoxPattern(pos);
|
|
4864
|
+
}
|
|
4865
|
+
|
|
5211
4866
|
function deserializeU8(pos) {
|
|
5212
4867
|
return uint8[pos];
|
|
5213
4868
|
}
|
|
@@ -5216,15 +4871,6 @@ function deserializeBoxJSXOpeningElement(pos) {
|
|
|
5216
4871
|
return deserializeJSXOpeningElement(uint32[pos >> 2]);
|
|
5217
4872
|
}
|
|
5218
4873
|
|
|
5219
|
-
function deserializeBoxJSXClosingElement(pos) {
|
|
5220
|
-
return deserializeJSXClosingElement(uint32[pos >> 2]);
|
|
5221
|
-
}
|
|
5222
|
-
|
|
5223
|
-
function deserializeOptionBoxJSXClosingElement(pos) {
|
|
5224
|
-
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
5225
|
-
return deserializeBoxJSXClosingElement(pos);
|
|
5226
|
-
}
|
|
5227
|
-
|
|
5228
4874
|
function deserializeVecJSXChild(pos) {
|
|
5229
4875
|
const arr = [],
|
|
5230
4876
|
pos32 = pos >> 2,
|
|
@@ -5237,6 +4883,15 @@ function deserializeVecJSXChild(pos) {
|
|
|
5237
4883
|
return arr;
|
|
5238
4884
|
}
|
|
5239
4885
|
|
|
4886
|
+
function deserializeBoxJSXClosingElement(pos) {
|
|
4887
|
+
return deserializeJSXClosingElement(uint32[pos >> 2]);
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
function deserializeOptionBoxJSXClosingElement(pos) {
|
|
4891
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
4892
|
+
return deserializeBoxJSXClosingElement(pos);
|
|
4893
|
+
}
|
|
4894
|
+
|
|
5240
4895
|
function deserializeVecJSXAttributeItem(pos) {
|
|
5241
4896
|
const arr = [],
|
|
5242
4897
|
pos32 = pos >> 2,
|