oxc-parser 0.68.1 → 0.70.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 +75 -405
- package/generated/deserialize/ts.js +95 -425
- package/index.d.ts +2 -1
- package/package.json +24 -15
- 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
|
|
|
@@ -426,9 +426,9 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
426
426
|
end: end,
|
|
427
427
|
left: keyCopy,
|
|
428
428
|
right: init,
|
|
429
|
-
typeAnnotation: null,
|
|
430
|
-
optional: false,
|
|
431
429
|
decorators: [],
|
|
430
|
+
optional: false,
|
|
431
|
+
typeAnnotation: null,
|
|
432
432
|
};
|
|
433
433
|
return {
|
|
434
434
|
type: 'Property',
|
|
@@ -858,11 +858,11 @@ function deserializeFormalParameters(pos) {
|
|
|
858
858
|
start: deserializeU32(pos),
|
|
859
859
|
end: deserializeU32(pos + 4),
|
|
860
860
|
argument: deserializeBindingPatternKind(pos + 8),
|
|
861
|
+
decorators: [],
|
|
862
|
+
optional: deserializeBool(pos + 32),
|
|
861
863
|
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(
|
|
862
864
|
pos + 24,
|
|
863
865
|
),
|
|
864
|
-
optional: deserializeBool(pos + 32),
|
|
865
|
-
decorators: [],
|
|
866
866
|
value: null,
|
|
867
867
|
});
|
|
868
868
|
}
|
|
@@ -877,9 +877,9 @@ function deserializeFormalParameter(pos) {
|
|
|
877
877
|
if (accessibility === null && !readonly && !override) {
|
|
878
878
|
param = {
|
|
879
879
|
...deserializeBindingPatternKind(pos + 40),
|
|
880
|
-
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 56),
|
|
881
|
-
optional: deserializeBool(pos + 64),
|
|
882
880
|
decorators: deserializeVecDecorator(pos + 8),
|
|
881
|
+
optional: deserializeBool(pos + 64),
|
|
882
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 56),
|
|
883
883
|
};
|
|
884
884
|
} else {
|
|
885
885
|
param = {
|
|
@@ -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
|
};
|
|
@@ -1070,7 +1070,7 @@ function deserializeImportDeclaration(pos) {
|
|
|
1070
1070
|
end: deserializeU32(pos + 4),
|
|
1071
1071
|
specifiers,
|
|
1072
1072
|
source: deserializeStringLiteral(pos + 40),
|
|
1073
|
-
attributes: withClause === null ? [] : withClause.
|
|
1073
|
+
attributes: withClause === null ? [] : withClause.attributes,
|
|
1074
1074
|
importKind: deserializeImportOrExportKind(pos + 104),
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
@@ -1106,11 +1106,7 @@ function deserializeImportNamespaceSpecifier(pos) {
|
|
|
1106
1106
|
|
|
1107
1107
|
function deserializeWithClause(pos) {
|
|
1108
1108
|
return {
|
|
1109
|
-
|
|
1110
|
-
start: deserializeU32(pos),
|
|
1111
|
-
end: deserializeU32(pos + 4),
|
|
1112
|
-
attributesKeyword: deserializeIdentifierName(pos + 8),
|
|
1113
|
-
withEntries: deserializeVecImportAttribute(pos + 32),
|
|
1109
|
+
attributes: deserializeVecImportAttribute(pos + 32),
|
|
1114
1110
|
};
|
|
1115
1111
|
}
|
|
1116
1112
|
|
|
@@ -1133,7 +1129,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
1133
1129
|
declaration: deserializeOptionDeclaration(pos + 8),
|
|
1134
1130
|
specifiers: deserializeVecExportSpecifier(pos + 24),
|
|
1135
1131
|
source: deserializeOptionStringLiteral(pos + 56),
|
|
1136
|
-
attributes: withClause === null ? [] : withClause.
|
|
1132
|
+
attributes: withClause === null ? [] : withClause.attributes,
|
|
1137
1133
|
exportKind: deserializeImportOrExportKind(pos + 104),
|
|
1138
1134
|
};
|
|
1139
1135
|
}
|
|
@@ -1156,7 +1152,7 @@ function deserializeExportAllDeclaration(pos) {
|
|
|
1156
1152
|
end: deserializeU32(pos + 4),
|
|
1157
1153
|
exported: deserializeOptionModuleExportName(pos + 8),
|
|
1158
1154
|
source: deserializeStringLiteral(pos + 64),
|
|
1159
|
-
attributes: withClause === null ? [] : withClause.
|
|
1155
|
+
attributes: withClause === null ? [] : withClause.attributes,
|
|
1160
1156
|
exportKind: deserializeImportOrExportKind(pos + 120),
|
|
1161
1157
|
};
|
|
1162
1158
|
}
|
|
@@ -1262,11 +1258,17 @@ function deserializeRegExpLiteral(pos) {
|
|
|
1262
1258
|
|
|
1263
1259
|
function deserializeRegExp(pos) {
|
|
1264
1260
|
return {
|
|
1265
|
-
pattern:
|
|
1261
|
+
pattern: deserializeStr(pos),
|
|
1266
1262
|
flags: deserializeRegExpFlags(pos + 24),
|
|
1267
1263
|
};
|
|
1268
1264
|
}
|
|
1269
1265
|
|
|
1266
|
+
function deserializeRegExpPattern(pos) {
|
|
1267
|
+
return {
|
|
1268
|
+
pattern: deserializeStr(pos),
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1270
1272
|
function deserializeRegExpFlags(pos) {
|
|
1271
1273
|
const flagBits = deserializeU8(pos);
|
|
1272
1274
|
let flags = '';
|
|
@@ -1283,7 +1285,7 @@ function deserializeRegExpFlags(pos) {
|
|
|
1283
1285
|
}
|
|
1284
1286
|
|
|
1285
1287
|
function deserializeJSXElement(pos) {
|
|
1286
|
-
const closingElement = deserializeOptionBoxJSXClosingElement(pos +
|
|
1288
|
+
const closingElement = deserializeOptionBoxJSXClosingElement(pos + 48);
|
|
1287
1289
|
const openingElement = deserializeBoxJSXOpeningElement(pos + 8);
|
|
1288
1290
|
if (closingElement === null) openingElement.selfClosing = true;
|
|
1289
1291
|
return {
|
|
@@ -1292,7 +1294,7 @@ function deserializeJSXElement(pos) {
|
|
|
1292
1294
|
end: deserializeU32(pos + 4),
|
|
1293
1295
|
openingElement,
|
|
1294
1296
|
closingElement,
|
|
1295
|
-
children: deserializeVecJSXChild(pos +
|
|
1297
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1296
1298
|
};
|
|
1297
1299
|
}
|
|
1298
1300
|
|
|
@@ -1301,10 +1303,10 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
1301
1303
|
type: 'JSXOpeningElement',
|
|
1302
1304
|
start: deserializeU32(pos),
|
|
1303
1305
|
end: deserializeU32(pos + 4),
|
|
1304
|
-
attributes: deserializeVecJSXAttributeItem(pos +
|
|
1306
|
+
attributes: deserializeVecJSXAttributeItem(pos + 32),
|
|
1305
1307
|
name: deserializeJSXElementName(pos + 8),
|
|
1306
1308
|
selfClosing: false,
|
|
1307
|
-
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
1309
|
+
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 24),
|
|
1308
1310
|
};
|
|
1309
1311
|
}
|
|
1310
1312
|
|
|
@@ -1323,8 +1325,8 @@ function deserializeJSXFragment(pos) {
|
|
|
1323
1325
|
start: deserializeU32(pos),
|
|
1324
1326
|
end: deserializeU32(pos + 4),
|
|
1325
1327
|
openingFragment: deserializeJSXOpeningFragment(pos + 8),
|
|
1326
|
-
closingFragment: deserializeJSXClosingFragment(pos +
|
|
1327
|
-
children: deserializeVecJSXChild(pos +
|
|
1328
|
+
closingFragment: deserializeJSXClosingFragment(pos + 48),
|
|
1329
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1328
1330
|
};
|
|
1329
1331
|
}
|
|
1330
1332
|
|
|
@@ -1435,9 +1437,9 @@ function deserializeTSThisParameter(pos) {
|
|
|
1435
1437
|
start: deserializeU32(pos),
|
|
1436
1438
|
end: deserializeU32(pos + 4),
|
|
1437
1439
|
name: 'this',
|
|
1438
|
-
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1439
1440
|
decorators: [],
|
|
1440
1441
|
optional: false,
|
|
1442
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1441
1443
|
};
|
|
1442
1444
|
}
|
|
1443
1445
|
|
|
@@ -1573,8 +1575,8 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
1573
1575
|
type: 'TSNamedTupleMember',
|
|
1574
1576
|
start: deserializeU32(pos),
|
|
1575
1577
|
end: deserializeU32(pos + 4),
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
+
label: deserializeIdentifierName(pos + 8),
|
|
1579
|
+
elementType: deserializeTSTupleElement(pos + 32),
|
|
1578
1580
|
optional: deserializeBool(pos + 48),
|
|
1579
1581
|
};
|
|
1580
1582
|
}
|
|
@@ -1910,9 +1912,9 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
1910
1912
|
start: deserializeU32(pos),
|
|
1911
1913
|
end: deserializeU32(pos + 4),
|
|
1912
1914
|
name: deserializeStr(pos + 8),
|
|
1913
|
-
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1914
1915
|
decorators: [],
|
|
1915
1916
|
optional: false,
|
|
1917
|
+
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1916
1918
|
};
|
|
1917
1919
|
}
|
|
1918
1920
|
|
|
@@ -1948,13 +1950,32 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
1948
1950
|
|
|
1949
1951
|
// Flatten `body`, and nest `id`
|
|
1950
1952
|
if (body !== null && body.type === 'TSModuleDeclaration') {
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1953
|
+
let innerId = body.id;
|
|
1954
|
+
if (innerId.type === 'Identifier') {
|
|
1955
|
+
id = {
|
|
1956
|
+
type: 'TSQualifiedName',
|
|
1957
|
+
start: id.start,
|
|
1958
|
+
end: innerId.end,
|
|
1959
|
+
left: id,
|
|
1960
|
+
right: innerId,
|
|
1961
|
+
};
|
|
1962
|
+
} else {
|
|
1963
|
+
// Replace `left` of innermost `TSQualifiedName` with a nested `TSQualifiedName` with `id` of
|
|
1964
|
+
// this module on left, and previous `left` of innermost `TSQualifiedName` on right
|
|
1965
|
+
while (true) {
|
|
1966
|
+
innerId.start = id.start;
|
|
1967
|
+
if (innerId.left.type === 'Identifier') break;
|
|
1968
|
+
innerId = innerId.left;
|
|
1969
|
+
}
|
|
1970
|
+
innerId.left = {
|
|
1971
|
+
type: 'TSQualifiedName',
|
|
1972
|
+
start: id.start,
|
|
1973
|
+
end: innerId.left.end,
|
|
1974
|
+
left: id,
|
|
1975
|
+
right: innerId.left,
|
|
1976
|
+
};
|
|
1977
|
+
id = body.id;
|
|
1978
|
+
}
|
|
1958
1979
|
body = Object.hasOwn(body, 'body') ? body.body : null;
|
|
1959
1980
|
}
|
|
1960
1981
|
|
|
@@ -2005,22 +2026,12 @@ function deserializeTSTypeQuery(pos) {
|
|
|
2005
2026
|
}
|
|
2006
2027
|
|
|
2007
2028
|
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
2029
|
return {
|
|
2019
2030
|
type: 'TSImportType',
|
|
2020
2031
|
start: deserializeU32(pos),
|
|
2021
2032
|
end: deserializeU32(pos + 4),
|
|
2022
2033
|
argument: deserializeTSType(pos + 8),
|
|
2023
|
-
options,
|
|
2034
|
+
options: deserializeOptionBoxObjectExpression(pos + 24),
|
|
2024
2035
|
qualifier: deserializeOptionTSTypeName(pos + 32),
|
|
2025
2036
|
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 48),
|
|
2026
2037
|
};
|
|
@@ -2053,6 +2064,8 @@ function deserializeTSConstructorType(pos) {
|
|
|
2053
2064
|
}
|
|
2054
2065
|
|
|
2055
2066
|
function deserializeTSMappedType(pos) {
|
|
2067
|
+
let optional = deserializeOptionTSMappedTypeModifierOperator(pos + 48);
|
|
2068
|
+
if (optional === null) optional = false;
|
|
2056
2069
|
const typeParameter = deserializeBoxTSTypeParameter(pos + 8);
|
|
2057
2070
|
return {
|
|
2058
2071
|
type: 'TSMappedType',
|
|
@@ -2060,7 +2073,7 @@ function deserializeTSMappedType(pos) {
|
|
|
2060
2073
|
end: deserializeU32(pos + 4),
|
|
2061
2074
|
nameType: deserializeOptionTSType(pos + 16),
|
|
2062
2075
|
typeAnnotation: deserializeOptionTSType(pos + 32),
|
|
2063
|
-
optional
|
|
2076
|
+
optional,
|
|
2064
2077
|
readonly: deserializeOptionTSMappedTypeModifierOperator(pos + 49),
|
|
2065
2078
|
key: typeParameter.name,
|
|
2066
2079
|
constraint: typeParameter.constraint,
|
|
@@ -2102,8 +2115,8 @@ function deserializeTSTypeAssertion(pos) {
|
|
|
2102
2115
|
type: 'TSTypeAssertion',
|
|
2103
2116
|
start: deserializeU32(pos),
|
|
2104
2117
|
end: deserializeU32(pos + 4),
|
|
2105
|
-
|
|
2106
|
-
|
|
2118
|
+
typeAnnotation: deserializeTSType(pos + 8),
|
|
2119
|
+
expression: deserializeExpression(pos + 24),
|
|
2107
2120
|
};
|
|
2108
2121
|
}
|
|
2109
2122
|
|
|
@@ -2263,202 +2276,6 @@ function deserializeSourceType(pos) {
|
|
|
2263
2276
|
};
|
|
2264
2277
|
}
|
|
2265
2278
|
|
|
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
2279
|
function deserializeRawTransferData(pos) {
|
|
2463
2280
|
return {
|
|
2464
2281
|
program: deserializeProgram(pos),
|
|
@@ -3571,19 +3388,6 @@ function deserializeModuleExportName(pos) {
|
|
|
3571
3388
|
}
|
|
3572
3389
|
}
|
|
3573
3390
|
|
|
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
3391
|
function deserializeJSXElementName(pos) {
|
|
3588
3392
|
switch (uint8[pos]) {
|
|
3589
3393
|
case 0:
|
|
@@ -4354,145 +4158,6 @@ function deserializeModuleKind(pos) {
|
|
|
4354
4158
|
}
|
|
4355
4159
|
}
|
|
4356
4160
|
|
|
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
4161
|
function deserializeErrorSeverity(pos) {
|
|
4497
4162
|
switch (uint8[pos]) {
|
|
4498
4163
|
case 0:
|
|
@@ -5360,6 +5025,11 @@ function deserializeBoxPattern(pos) {
|
|
|
5360
5025
|
return deserializePattern(uint32[pos >> 2]);
|
|
5361
5026
|
}
|
|
5362
5027
|
|
|
5028
|
+
function deserializeOptionBoxPattern(pos) {
|
|
5029
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
5030
|
+
return deserializeBoxPattern(pos);
|
|
5031
|
+
}
|
|
5032
|
+
|
|
5363
5033
|
function deserializeU8(pos) {
|
|
5364
5034
|
return uint8[pos];
|
|
5365
5035
|
}
|
|
@@ -5368,15 +5038,6 @@ function deserializeBoxJSXOpeningElement(pos) {
|
|
|
5368
5038
|
return deserializeJSXOpeningElement(uint32[pos >> 2]);
|
|
5369
5039
|
}
|
|
5370
5040
|
|
|
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
5041
|
function deserializeVecJSXChild(pos) {
|
|
5381
5042
|
const arr = [],
|
|
5382
5043
|
pos32 = pos >> 2,
|
|
@@ -5389,6 +5050,15 @@ function deserializeVecJSXChild(pos) {
|
|
|
5389
5050
|
return arr;
|
|
5390
5051
|
}
|
|
5391
5052
|
|
|
5053
|
+
function deserializeBoxJSXClosingElement(pos) {
|
|
5054
|
+
return deserializeJSXClosingElement(uint32[pos >> 2]);
|
|
5055
|
+
}
|
|
5056
|
+
|
|
5057
|
+
function deserializeOptionBoxJSXClosingElement(pos) {
|
|
5058
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
5059
|
+
return deserializeBoxJSXClosingElement(pos);
|
|
5060
|
+
}
|
|
5061
|
+
|
|
5392
5062
|
function deserializeVecJSXAttributeItem(pos) {
|
|
5393
5063
|
const arr = [],
|
|
5394
5064
|
pos32 = pos >> 2,
|