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
|
|
|
@@ -177,8 +177,8 @@ function deserializeTaggedTemplateExpression(pos) {
|
|
|
177
177
|
start: deserializeU32(pos),
|
|
178
178
|
end: deserializeU32(pos + 4),
|
|
179
179
|
tag: deserializeExpression(pos + 8),
|
|
180
|
-
quasi: deserializeTemplateLiteral(pos +
|
|
181
|
-
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
180
|
+
quasi: deserializeTemplateLiteral(pos + 32),
|
|
181
|
+
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 24),
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
|
|
@@ -255,8 +255,8 @@ function deserializeNewExpression(pos) {
|
|
|
255
255
|
start: deserializeU32(pos),
|
|
256
256
|
end: deserializeU32(pos + 4),
|
|
257
257
|
callee: deserializeExpression(pos + 8),
|
|
258
|
-
arguments: deserializeVecArgument(pos +
|
|
259
|
-
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
258
|
+
arguments: deserializeVecArgument(pos + 32),
|
|
259
|
+
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 24),
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
|
|
@@ -997,18 +997,18 @@ function deserializePropertyDefinition(pos) {
|
|
|
997
997
|
type: deserializePropertyDefinitionType(pos + 8),
|
|
998
998
|
start: deserializeU32(pos),
|
|
999
999
|
end: deserializeU32(pos + 4),
|
|
1000
|
-
static: deserializeBool(pos +
|
|
1001
|
-
computed: deserializeBool(pos +
|
|
1000
|
+
static: deserializeBool(pos + 89),
|
|
1001
|
+
computed: deserializeBool(pos + 88),
|
|
1002
1002
|
key: deserializePropertyKey(pos + 48),
|
|
1003
|
-
value: deserializeOptionExpression(pos +
|
|
1003
|
+
value: deserializeOptionExpression(pos + 72),
|
|
1004
1004
|
decorators: deserializeVecDecorator(pos + 16),
|
|
1005
|
-
declare: deserializeBool(pos +
|
|
1006
|
-
override: deserializeBool(pos +
|
|
1007
|
-
optional: deserializeBool(pos +
|
|
1008
|
-
definite: deserializeBool(pos +
|
|
1009
|
-
readonly: deserializeBool(pos +
|
|
1010
|
-
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos +
|
|
1011
|
-
accessibility: deserializeOptionTSAccessibility(pos +
|
|
1005
|
+
declare: deserializeBool(pos + 90),
|
|
1006
|
+
override: deserializeBool(pos + 91),
|
|
1007
|
+
optional: deserializeBool(pos + 92),
|
|
1008
|
+
definite: deserializeBool(pos + 93),
|
|
1009
|
+
readonly: deserializeBool(pos + 94),
|
|
1010
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 64),
|
|
1011
|
+
accessibility: deserializeOptionTSAccessibility(pos + 95),
|
|
1012
1012
|
};
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
@@ -1036,15 +1036,15 @@ function deserializeAccessorProperty(pos) {
|
|
|
1036
1036
|
start: deserializeU32(pos),
|
|
1037
1037
|
end: deserializeU32(pos + 4),
|
|
1038
1038
|
key: deserializePropertyKey(pos + 48),
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1039
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 64),
|
|
1040
|
+
value: deserializeOptionExpression(pos + 72),
|
|
1041
|
+
computed: deserializeBool(pos + 88),
|
|
1042
|
+
static: deserializeBool(pos + 89),
|
|
1042
1043
|
decorators: deserializeVecDecorator(pos + 16),
|
|
1043
|
-
definite: deserializeBool(pos +
|
|
1044
|
-
|
|
1045
|
-
accessibility: deserializeOptionTSAccessibility(pos + 96),
|
|
1044
|
+
definite: deserializeBool(pos + 91),
|
|
1045
|
+
accessibility: deserializeOptionTSAccessibility(pos + 92),
|
|
1046
1046
|
optional: false,
|
|
1047
|
-
override: deserializeBool(pos +
|
|
1047
|
+
override: deserializeBool(pos + 90),
|
|
1048
1048
|
readonly: false,
|
|
1049
1049
|
declare: false,
|
|
1050
1050
|
};
|
|
@@ -1262,11 +1262,17 @@ function deserializeRegExpLiteral(pos) {
|
|
|
1262
1262
|
|
|
1263
1263
|
function deserializeRegExp(pos) {
|
|
1264
1264
|
return {
|
|
1265
|
-
pattern:
|
|
1265
|
+
pattern: deserializeStr(pos),
|
|
1266
1266
|
flags: deserializeRegExpFlags(pos + 24),
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
1269
|
|
|
1270
|
+
function deserializeRegExpPattern(pos) {
|
|
1271
|
+
return {
|
|
1272
|
+
pattern: deserializeStr(pos),
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1270
1276
|
function deserializeRegExpFlags(pos) {
|
|
1271
1277
|
const flagBits = deserializeU8(pos);
|
|
1272
1278
|
let flags = '';
|
|
@@ -1283,7 +1289,7 @@ function deserializeRegExpFlags(pos) {
|
|
|
1283
1289
|
}
|
|
1284
1290
|
|
|
1285
1291
|
function deserializeJSXElement(pos) {
|
|
1286
|
-
const closingElement = deserializeOptionBoxJSXClosingElement(pos +
|
|
1292
|
+
const closingElement = deserializeOptionBoxJSXClosingElement(pos + 48);
|
|
1287
1293
|
const openingElement = deserializeBoxJSXOpeningElement(pos + 8);
|
|
1288
1294
|
if (closingElement === null) openingElement.selfClosing = true;
|
|
1289
1295
|
return {
|
|
@@ -1292,7 +1298,7 @@ function deserializeJSXElement(pos) {
|
|
|
1292
1298
|
end: deserializeU32(pos + 4),
|
|
1293
1299
|
openingElement,
|
|
1294
1300
|
closingElement,
|
|
1295
|
-
children: deserializeVecJSXChild(pos +
|
|
1301
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1296
1302
|
};
|
|
1297
1303
|
}
|
|
1298
1304
|
|
|
@@ -1301,10 +1307,10 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
1301
1307
|
type: 'JSXOpeningElement',
|
|
1302
1308
|
start: deserializeU32(pos),
|
|
1303
1309
|
end: deserializeU32(pos + 4),
|
|
1304
|
-
attributes: deserializeVecJSXAttributeItem(pos +
|
|
1310
|
+
attributes: deserializeVecJSXAttributeItem(pos + 32),
|
|
1305
1311
|
name: deserializeJSXElementName(pos + 8),
|
|
1306
1312
|
selfClosing: false,
|
|
1307
|
-
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
1313
|
+
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 24),
|
|
1308
1314
|
};
|
|
1309
1315
|
}
|
|
1310
1316
|
|
|
@@ -1323,8 +1329,8 @@ function deserializeJSXFragment(pos) {
|
|
|
1323
1329
|
start: deserializeU32(pos),
|
|
1324
1330
|
end: deserializeU32(pos + 4),
|
|
1325
1331
|
openingFragment: deserializeJSXOpeningFragment(pos + 8),
|
|
1326
|
-
closingFragment: deserializeJSXClosingFragment(pos +
|
|
1327
|
-
children: deserializeVecJSXChild(pos +
|
|
1332
|
+
closingFragment: deserializeJSXClosingFragment(pos + 48),
|
|
1333
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1328
1334
|
};
|
|
1329
1335
|
}
|
|
1330
1336
|
|
|
@@ -1435,9 +1441,9 @@ function deserializeTSThisParameter(pos) {
|
|
|
1435
1441
|
start: deserializeU32(pos),
|
|
1436
1442
|
end: deserializeU32(pos + 4),
|
|
1437
1443
|
name: 'this',
|
|
1438
|
-
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1439
1444
|
decorators: [],
|
|
1440
1445
|
optional: false,
|
|
1446
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1441
1447
|
};
|
|
1442
1448
|
}
|
|
1443
1449
|
|
|
@@ -1573,8 +1579,8 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
1573
1579
|
type: 'TSNamedTupleMember',
|
|
1574
1580
|
start: deserializeU32(pos),
|
|
1575
1581
|
end: deserializeU32(pos + 4),
|
|
1576
|
-
|
|
1577
|
-
|
|
1582
|
+
label: deserializeIdentifierName(pos + 8),
|
|
1583
|
+
elementType: deserializeTSTupleElement(pos + 32),
|
|
1578
1584
|
optional: deserializeBool(pos + 48),
|
|
1579
1585
|
};
|
|
1580
1586
|
}
|
|
@@ -1910,9 +1916,9 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
1910
1916
|
start: deserializeU32(pos),
|
|
1911
1917
|
end: deserializeU32(pos + 4),
|
|
1912
1918
|
name: deserializeStr(pos + 8),
|
|
1913
|
-
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1914
1919
|
decorators: [],
|
|
1915
1920
|
optional: false,
|
|
1921
|
+
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1916
1922
|
};
|
|
1917
1923
|
}
|
|
1918
1924
|
|
|
@@ -2005,22 +2011,12 @@ function deserializeTSTypeQuery(pos) {
|
|
|
2005
2011
|
}
|
|
2006
2012
|
|
|
2007
2013
|
function deserializeTSImportType(pos) {
|
|
2008
|
-
let options = deserializeOptionBoxObjectExpression(pos + 24);
|
|
2009
|
-
if (options !== null && options.properties.length === 1) {
|
|
2010
|
-
const prop = options.properties[0];
|
|
2011
|
-
if (
|
|
2012
|
-
!prop.method && !prop.shorthand && !prop.computed &&
|
|
2013
|
-
prop.key.type === 'Identifier' && prop.key.name === 'assert'
|
|
2014
|
-
) {
|
|
2015
|
-
prop.key.name = 'with';
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
2014
|
return {
|
|
2019
2015
|
type: 'TSImportType',
|
|
2020
2016
|
start: deserializeU32(pos),
|
|
2021
2017
|
end: deserializeU32(pos + 4),
|
|
2022
2018
|
argument: deserializeTSType(pos + 8),
|
|
2023
|
-
options,
|
|
2019
|
+
options: deserializeOptionBoxObjectExpression(pos + 24),
|
|
2024
2020
|
qualifier: deserializeOptionTSTypeName(pos + 32),
|
|
2025
2021
|
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 48),
|
|
2026
2022
|
};
|
|
@@ -2053,6 +2049,8 @@ function deserializeTSConstructorType(pos) {
|
|
|
2053
2049
|
}
|
|
2054
2050
|
|
|
2055
2051
|
function deserializeTSMappedType(pos) {
|
|
2052
|
+
let optional = deserializeOptionTSMappedTypeModifierOperator(pos + 48) || false;
|
|
2053
|
+
if (optional === null) optional = false;
|
|
2056
2054
|
const typeParameter = deserializeBoxTSTypeParameter(pos + 8);
|
|
2057
2055
|
return {
|
|
2058
2056
|
type: 'TSMappedType',
|
|
@@ -2060,7 +2058,7 @@ function deserializeTSMappedType(pos) {
|
|
|
2060
2058
|
end: deserializeU32(pos + 4),
|
|
2061
2059
|
nameType: deserializeOptionTSType(pos + 16),
|
|
2062
2060
|
typeAnnotation: deserializeOptionTSType(pos + 32),
|
|
2063
|
-
optional
|
|
2061
|
+
optional,
|
|
2064
2062
|
readonly: deserializeOptionTSMappedTypeModifierOperator(pos + 49),
|
|
2065
2063
|
key: typeParameter.name,
|
|
2066
2064
|
constraint: typeParameter.constraint,
|
|
@@ -2102,8 +2100,8 @@ function deserializeTSTypeAssertion(pos) {
|
|
|
2102
2100
|
type: 'TSTypeAssertion',
|
|
2103
2101
|
start: deserializeU32(pos),
|
|
2104
2102
|
end: deserializeU32(pos + 4),
|
|
2105
|
-
|
|
2106
|
-
|
|
2103
|
+
typeAnnotation: deserializeTSType(pos + 8),
|
|
2104
|
+
expression: deserializeExpression(pos + 24),
|
|
2107
2105
|
};
|
|
2108
2106
|
}
|
|
2109
2107
|
|
|
@@ -2263,202 +2261,6 @@ function deserializeSourceType(pos) {
|
|
|
2263
2261
|
};
|
|
2264
2262
|
}
|
|
2265
2263
|
|
|
2266
|
-
function deserializePattern(pos) {
|
|
2267
|
-
return {
|
|
2268
|
-
type: 'Pattern',
|
|
2269
|
-
start: deserializeU32(pos),
|
|
2270
|
-
end: deserializeU32(pos + 4),
|
|
2271
|
-
body: deserializeDisjunction(pos + 8),
|
|
2272
|
-
};
|
|
2273
|
-
}
|
|
2274
|
-
|
|
2275
|
-
function deserializeDisjunction(pos) {
|
|
2276
|
-
return {
|
|
2277
|
-
type: 'Disjunction',
|
|
2278
|
-
start: deserializeU32(pos),
|
|
2279
|
-
end: deserializeU32(pos + 4),
|
|
2280
|
-
body: deserializeVecAlternative(pos + 8),
|
|
2281
|
-
};
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
function deserializeAlternative(pos) {
|
|
2285
|
-
return {
|
|
2286
|
-
type: 'Alternative',
|
|
2287
|
-
start: deserializeU32(pos),
|
|
2288
|
-
end: deserializeU32(pos + 4),
|
|
2289
|
-
body: deserializeVecTerm(pos + 8),
|
|
2290
|
-
};
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2293
|
-
function deserializeBoundaryAssertion(pos) {
|
|
2294
|
-
return {
|
|
2295
|
-
type: 'BoundaryAssertion',
|
|
2296
|
-
start: deserializeU32(pos),
|
|
2297
|
-
end: deserializeU32(pos + 4),
|
|
2298
|
-
kind: deserializeBoundaryAssertionKind(pos + 8),
|
|
2299
|
-
};
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
function deserializeLookAroundAssertion(pos) {
|
|
2303
|
-
return {
|
|
2304
|
-
type: 'LookAroundAssertion',
|
|
2305
|
-
start: deserializeU32(pos),
|
|
2306
|
-
end: deserializeU32(pos + 4),
|
|
2307
|
-
kind: deserializeLookAroundAssertionKind(pos + 8),
|
|
2308
|
-
body: deserializeDisjunction(pos + 16),
|
|
2309
|
-
};
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
function deserializeQuantifier(pos) {
|
|
2313
|
-
return {
|
|
2314
|
-
type: 'Quantifier',
|
|
2315
|
-
start: deserializeU32(pos),
|
|
2316
|
-
end: deserializeU32(pos + 4),
|
|
2317
|
-
min: deserializeU64(pos + 8),
|
|
2318
|
-
max: deserializeOptionU64(pos + 16),
|
|
2319
|
-
greedy: deserializeBool(pos + 32),
|
|
2320
|
-
body: deserializeTerm(pos + 40),
|
|
2321
|
-
};
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
function deserializeCharacter(pos) {
|
|
2325
|
-
return {
|
|
2326
|
-
type: 'Character',
|
|
2327
|
-
start: deserializeU32(pos),
|
|
2328
|
-
end: deserializeU32(pos + 4),
|
|
2329
|
-
kind: deserializeCharacterKind(pos + 8),
|
|
2330
|
-
value: deserializeU32(pos + 12),
|
|
2331
|
-
};
|
|
2332
|
-
}
|
|
2333
|
-
|
|
2334
|
-
function deserializeCharacterClassEscape(pos) {
|
|
2335
|
-
return {
|
|
2336
|
-
type: 'CharacterClassEscape',
|
|
2337
|
-
start: deserializeU32(pos),
|
|
2338
|
-
end: deserializeU32(pos + 4),
|
|
2339
|
-
kind: deserializeCharacterClassEscapeKind(pos + 8),
|
|
2340
|
-
};
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
function deserializeUnicodePropertyEscape(pos) {
|
|
2344
|
-
return {
|
|
2345
|
-
type: 'UnicodePropertyEscape',
|
|
2346
|
-
start: deserializeU32(pos),
|
|
2347
|
-
end: deserializeU32(pos + 4),
|
|
2348
|
-
negative: deserializeBool(pos + 8),
|
|
2349
|
-
strings: deserializeBool(pos + 9),
|
|
2350
|
-
name: deserializeStr(pos + 16),
|
|
2351
|
-
value: deserializeOptionStr(pos + 32),
|
|
2352
|
-
};
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
function deserializeDot(pos) {
|
|
2356
|
-
return {
|
|
2357
|
-
type: 'Dot',
|
|
2358
|
-
start: deserializeU32(pos),
|
|
2359
|
-
end: deserializeU32(pos + 4),
|
|
2360
|
-
};
|
|
2361
|
-
}
|
|
2362
|
-
|
|
2363
|
-
function deserializeCharacterClass(pos) {
|
|
2364
|
-
return {
|
|
2365
|
-
type: 'CharacterClass',
|
|
2366
|
-
start: deserializeU32(pos),
|
|
2367
|
-
end: deserializeU32(pos + 4),
|
|
2368
|
-
negative: deserializeBool(pos + 8),
|
|
2369
|
-
strings: deserializeBool(pos + 9),
|
|
2370
|
-
kind: deserializeCharacterClassContentsKind(pos + 10),
|
|
2371
|
-
body: deserializeVecCharacterClassContents(pos + 16),
|
|
2372
|
-
};
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
function deserializeCharacterClassRange(pos) {
|
|
2376
|
-
return {
|
|
2377
|
-
type: 'CharacterClassRange',
|
|
2378
|
-
start: deserializeU32(pos),
|
|
2379
|
-
end: deserializeU32(pos + 4),
|
|
2380
|
-
min: deserializeCharacter(pos + 8),
|
|
2381
|
-
max: deserializeCharacter(pos + 24),
|
|
2382
|
-
};
|
|
2383
|
-
}
|
|
2384
|
-
|
|
2385
|
-
function deserializeClassStringDisjunction(pos) {
|
|
2386
|
-
return {
|
|
2387
|
-
type: 'ClassStringDisjunction',
|
|
2388
|
-
start: deserializeU32(pos),
|
|
2389
|
-
end: deserializeU32(pos + 4),
|
|
2390
|
-
strings: deserializeBool(pos + 8),
|
|
2391
|
-
body: deserializeVecClassString(pos + 16),
|
|
2392
|
-
};
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
function deserializeClassString(pos) {
|
|
2396
|
-
return {
|
|
2397
|
-
type: 'ClassString',
|
|
2398
|
-
start: deserializeU32(pos),
|
|
2399
|
-
end: deserializeU32(pos + 4),
|
|
2400
|
-
strings: deserializeBool(pos + 8),
|
|
2401
|
-
body: deserializeVecCharacter(pos + 16),
|
|
2402
|
-
};
|
|
2403
|
-
}
|
|
2404
|
-
|
|
2405
|
-
function deserializeCapturingGroup(pos) {
|
|
2406
|
-
return {
|
|
2407
|
-
type: 'CapturingGroup',
|
|
2408
|
-
start: deserializeU32(pos),
|
|
2409
|
-
end: deserializeU32(pos + 4),
|
|
2410
|
-
name: deserializeOptionStr(pos + 8),
|
|
2411
|
-
body: deserializeDisjunction(pos + 24),
|
|
2412
|
-
};
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
function deserializeIgnoreGroup(pos) {
|
|
2416
|
-
return {
|
|
2417
|
-
type: 'IgnoreGroup',
|
|
2418
|
-
start: deserializeU32(pos),
|
|
2419
|
-
end: deserializeU32(pos + 4),
|
|
2420
|
-
modifiers: deserializeOptionModifiers(pos + 8),
|
|
2421
|
-
body: deserializeDisjunction(pos + 24),
|
|
2422
|
-
};
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
function deserializeModifiers(pos) {
|
|
2426
|
-
return {
|
|
2427
|
-
type: 'Modifiers',
|
|
2428
|
-
start: deserializeU32(pos),
|
|
2429
|
-
end: deserializeU32(pos + 4),
|
|
2430
|
-
enabling: deserializeOptionModifier(pos + 8),
|
|
2431
|
-
disabling: deserializeOptionModifier(pos + 11),
|
|
2432
|
-
};
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2435
|
-
function deserializeModifier(pos) {
|
|
2436
|
-
return {
|
|
2437
|
-
type: 'Modifier',
|
|
2438
|
-
ignoreCase: deserializeBool(pos),
|
|
2439
|
-
multiline: deserializeBool(pos + 1),
|
|
2440
|
-
sticky: deserializeBool(pos + 2),
|
|
2441
|
-
};
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
function deserializeIndexedReference(pos) {
|
|
2445
|
-
return {
|
|
2446
|
-
type: 'IndexedReference',
|
|
2447
|
-
start: deserializeU32(pos),
|
|
2448
|
-
end: deserializeU32(pos + 4),
|
|
2449
|
-
index: deserializeU32(pos + 8),
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
function deserializeNamedReference(pos) {
|
|
2454
|
-
return {
|
|
2455
|
-
type: 'NamedReference',
|
|
2456
|
-
start: deserializeU32(pos),
|
|
2457
|
-
end: deserializeU32(pos + 4),
|
|
2458
|
-
name: deserializeStr(pos + 8),
|
|
2459
|
-
};
|
|
2460
|
-
}
|
|
2461
|
-
|
|
2462
2264
|
function deserializeRawTransferData(pos) {
|
|
2463
2265
|
return {
|
|
2464
2266
|
program: deserializeProgram(pos),
|
|
@@ -3571,19 +3373,6 @@ function deserializeModuleExportName(pos) {
|
|
|
3571
3373
|
}
|
|
3572
3374
|
}
|
|
3573
3375
|
|
|
3574
|
-
function deserializeRegExpPattern(pos) {
|
|
3575
|
-
switch (uint8[pos]) {
|
|
3576
|
-
case 0:
|
|
3577
|
-
return deserializeStr(pos + 8);
|
|
3578
|
-
case 1:
|
|
3579
|
-
return deserializeStr(pos + 8);
|
|
3580
|
-
case 2:
|
|
3581
|
-
return deserializeBoxPattern(pos + 8);
|
|
3582
|
-
default:
|
|
3583
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for RegExpPattern`);
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
|
|
3587
3376
|
function deserializeJSXElementName(pos) {
|
|
3588
3377
|
switch (uint8[pos]) {
|
|
3589
3378
|
case 0:
|
|
@@ -3983,7 +3772,7 @@ function deserializeTSTupleElement(pos) {
|
|
|
3983
3772
|
function deserializeTSTypeName(pos) {
|
|
3984
3773
|
switch (uint8[pos]) {
|
|
3985
3774
|
case 0:
|
|
3986
|
-
let id =
|
|
3775
|
+
let id = deserializeBoxIdentifierReference(pos + 8);
|
|
3987
3776
|
if (id.name === 'this') id = { type: 'ThisExpression', start: id.start, end: id.end };
|
|
3988
3777
|
return id;
|
|
3989
3778
|
case 1:
|
|
@@ -4085,7 +3874,7 @@ function deserializeTSModuleDeclarationBody(pos) {
|
|
|
4085
3874
|
function deserializeTSTypeQueryExprName(pos) {
|
|
4086
3875
|
switch (uint8[pos]) {
|
|
4087
3876
|
case 0:
|
|
4088
|
-
let id =
|
|
3877
|
+
let id = deserializeBoxIdentifierReference(pos + 8);
|
|
4089
3878
|
if (id.name === 'this') id = { type: 'ThisExpression', start: id.start, end: id.end };
|
|
4090
3879
|
return id;
|
|
4091
3880
|
case 1:
|
|
@@ -4113,7 +3902,7 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
4113
3902
|
function deserializeTSModuleReference(pos) {
|
|
4114
3903
|
switch (uint8[pos]) {
|
|
4115
3904
|
case 0:
|
|
4116
|
-
let id =
|
|
3905
|
+
let id = deserializeBoxIdentifierReference(pos + 8);
|
|
4117
3906
|
if (id.name === 'this') id = { type: 'ThisExpression', start: id.start, end: id.end };
|
|
4118
3907
|
return id;
|
|
4119
3908
|
case 1:
|
|
@@ -4354,145 +4143,6 @@ function deserializeModuleKind(pos) {
|
|
|
4354
4143
|
}
|
|
4355
4144
|
}
|
|
4356
4145
|
|
|
4357
|
-
function deserializeTerm(pos) {
|
|
4358
|
-
switch (uint8[pos]) {
|
|
4359
|
-
case 0:
|
|
4360
|
-
return deserializeBoxBoundaryAssertion(pos + 8);
|
|
4361
|
-
case 1:
|
|
4362
|
-
return deserializeBoxLookAroundAssertion(pos + 8);
|
|
4363
|
-
case 2:
|
|
4364
|
-
return deserializeBoxQuantifier(pos + 8);
|
|
4365
|
-
case 3:
|
|
4366
|
-
return deserializeBoxCharacter(pos + 8);
|
|
4367
|
-
case 4:
|
|
4368
|
-
return deserializeDot(pos + 8);
|
|
4369
|
-
case 5:
|
|
4370
|
-
return deserializeBoxCharacterClassEscape(pos + 8);
|
|
4371
|
-
case 6:
|
|
4372
|
-
return deserializeBoxUnicodePropertyEscape(pos + 8);
|
|
4373
|
-
case 7:
|
|
4374
|
-
return deserializeBoxCharacterClass(pos + 8);
|
|
4375
|
-
case 8:
|
|
4376
|
-
return deserializeBoxCapturingGroup(pos + 8);
|
|
4377
|
-
case 9:
|
|
4378
|
-
return deserializeBoxIgnoreGroup(pos + 8);
|
|
4379
|
-
case 10:
|
|
4380
|
-
return deserializeBoxIndexedReference(pos + 8);
|
|
4381
|
-
case 11:
|
|
4382
|
-
return deserializeBoxNamedReference(pos + 8);
|
|
4383
|
-
default:
|
|
4384
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for Term`);
|
|
4385
|
-
}
|
|
4386
|
-
}
|
|
4387
|
-
|
|
4388
|
-
function deserializeBoundaryAssertionKind(pos) {
|
|
4389
|
-
switch (uint8[pos]) {
|
|
4390
|
-
case 0:
|
|
4391
|
-
return 'start';
|
|
4392
|
-
case 1:
|
|
4393
|
-
return 'end';
|
|
4394
|
-
case 2:
|
|
4395
|
-
return 'boundary';
|
|
4396
|
-
case 3:
|
|
4397
|
-
return 'negativeBoundary';
|
|
4398
|
-
default:
|
|
4399
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for BoundaryAssertionKind`);
|
|
4400
|
-
}
|
|
4401
|
-
}
|
|
4402
|
-
|
|
4403
|
-
function deserializeLookAroundAssertionKind(pos) {
|
|
4404
|
-
switch (uint8[pos]) {
|
|
4405
|
-
case 0:
|
|
4406
|
-
return 'lookahead';
|
|
4407
|
-
case 1:
|
|
4408
|
-
return 'negativeLookahead';
|
|
4409
|
-
case 2:
|
|
4410
|
-
return 'lookbehind';
|
|
4411
|
-
case 3:
|
|
4412
|
-
return 'negativeLookbehind';
|
|
4413
|
-
default:
|
|
4414
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for LookAroundAssertionKind`);
|
|
4415
|
-
}
|
|
4416
|
-
}
|
|
4417
|
-
|
|
4418
|
-
function deserializeCharacterKind(pos) {
|
|
4419
|
-
switch (uint8[pos]) {
|
|
4420
|
-
case 0:
|
|
4421
|
-
return 'controlLetter';
|
|
4422
|
-
case 1:
|
|
4423
|
-
return 'hexadecimalEscape';
|
|
4424
|
-
case 2:
|
|
4425
|
-
return 'identifier';
|
|
4426
|
-
case 3:
|
|
4427
|
-
return 'null';
|
|
4428
|
-
case 4:
|
|
4429
|
-
return 'octal1';
|
|
4430
|
-
case 5:
|
|
4431
|
-
return 'octal2';
|
|
4432
|
-
case 6:
|
|
4433
|
-
return 'octal3';
|
|
4434
|
-
case 7:
|
|
4435
|
-
return 'singleEscape';
|
|
4436
|
-
case 8:
|
|
4437
|
-
return 'symbol';
|
|
4438
|
-
case 9:
|
|
4439
|
-
return 'unicodeEscape';
|
|
4440
|
-
default:
|
|
4441
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterKind`);
|
|
4442
|
-
}
|
|
4443
|
-
}
|
|
4444
|
-
|
|
4445
|
-
function deserializeCharacterClassEscapeKind(pos) {
|
|
4446
|
-
switch (uint8[pos]) {
|
|
4447
|
-
case 0:
|
|
4448
|
-
return 'd';
|
|
4449
|
-
case 1:
|
|
4450
|
-
return 'negativeD';
|
|
4451
|
-
case 2:
|
|
4452
|
-
return 's';
|
|
4453
|
-
case 3:
|
|
4454
|
-
return 'negativeS';
|
|
4455
|
-
case 4:
|
|
4456
|
-
return 'w';
|
|
4457
|
-
case 5:
|
|
4458
|
-
return 'negativeW';
|
|
4459
|
-
default:
|
|
4460
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterClassEscapeKind`);
|
|
4461
|
-
}
|
|
4462
|
-
}
|
|
4463
|
-
|
|
4464
|
-
function deserializeCharacterClassContentsKind(pos) {
|
|
4465
|
-
switch (uint8[pos]) {
|
|
4466
|
-
case 0:
|
|
4467
|
-
return 'union';
|
|
4468
|
-
case 1:
|
|
4469
|
-
return 'intersection';
|
|
4470
|
-
case 2:
|
|
4471
|
-
return 'subtraction';
|
|
4472
|
-
default:
|
|
4473
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterClassContentsKind`);
|
|
4474
|
-
}
|
|
4475
|
-
}
|
|
4476
|
-
|
|
4477
|
-
function deserializeCharacterClassContents(pos) {
|
|
4478
|
-
switch (uint8[pos]) {
|
|
4479
|
-
case 0:
|
|
4480
|
-
return deserializeBoxCharacterClassRange(pos + 8);
|
|
4481
|
-
case 1:
|
|
4482
|
-
return deserializeBoxCharacterClassEscape(pos + 8);
|
|
4483
|
-
case 2:
|
|
4484
|
-
return deserializeBoxUnicodePropertyEscape(pos + 8);
|
|
4485
|
-
case 3:
|
|
4486
|
-
return deserializeBoxCharacter(pos + 8);
|
|
4487
|
-
case 4:
|
|
4488
|
-
return deserializeBoxCharacterClass(pos + 8);
|
|
4489
|
-
case 5:
|
|
4490
|
-
return deserializeBoxClassStringDisjunction(pos + 8);
|
|
4491
|
-
default:
|
|
4492
|
-
throw new Error(`Unexpected discriminant ${uint8[pos]} for CharacterClassContents`);
|
|
4493
|
-
}
|
|
4494
|
-
}
|
|
4495
|
-
|
|
4496
4146
|
function deserializeErrorSeverity(pos) {
|
|
4497
4147
|
switch (uint8[pos]) {
|
|
4498
4148
|
case 0:
|
|
@@ -5360,6 +5010,11 @@ function deserializeBoxPattern(pos) {
|
|
|
5360
5010
|
return deserializePattern(uint32[pos >> 2]);
|
|
5361
5011
|
}
|
|
5362
5012
|
|
|
5013
|
+
function deserializeOptionBoxPattern(pos) {
|
|
5014
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
5015
|
+
return deserializeBoxPattern(pos);
|
|
5016
|
+
}
|
|
5017
|
+
|
|
5363
5018
|
function deserializeU8(pos) {
|
|
5364
5019
|
return uint8[pos];
|
|
5365
5020
|
}
|
|
@@ -5368,15 +5023,6 @@ function deserializeBoxJSXOpeningElement(pos) {
|
|
|
5368
5023
|
return deserializeJSXOpeningElement(uint32[pos >> 2]);
|
|
5369
5024
|
}
|
|
5370
5025
|
|
|
5371
|
-
function deserializeBoxJSXClosingElement(pos) {
|
|
5372
|
-
return deserializeJSXClosingElement(uint32[pos >> 2]);
|
|
5373
|
-
}
|
|
5374
|
-
|
|
5375
|
-
function deserializeOptionBoxJSXClosingElement(pos) {
|
|
5376
|
-
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
5377
|
-
return deserializeBoxJSXClosingElement(pos);
|
|
5378
|
-
}
|
|
5379
|
-
|
|
5380
5026
|
function deserializeVecJSXChild(pos) {
|
|
5381
5027
|
const arr = [],
|
|
5382
5028
|
pos32 = pos >> 2,
|
|
@@ -5389,6 +5035,15 @@ function deserializeVecJSXChild(pos) {
|
|
|
5389
5035
|
return arr;
|
|
5390
5036
|
}
|
|
5391
5037
|
|
|
5038
|
+
function deserializeBoxJSXClosingElement(pos) {
|
|
5039
|
+
return deserializeJSXClosingElement(uint32[pos >> 2]);
|
|
5040
|
+
}
|
|
5041
|
+
|
|
5042
|
+
function deserializeOptionBoxJSXClosingElement(pos) {
|
|
5043
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
5044
|
+
return deserializeBoxJSXClosingElement(pos);
|
|
5045
|
+
}
|
|
5046
|
+
|
|
5392
5047
|
function deserializeVecJSXAttributeItem(pos) {
|
|
5393
5048
|
const arr = [],
|
|
5394
5049
|
pos32 = pos >> 2,
|