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
|
|
|
@@ -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
|
|
|
@@ -923,7 +923,7 @@ function deserializeImportDeclaration(pos) {
|
|
|
923
923
|
end: deserializeU32(pos + 4),
|
|
924
924
|
specifiers,
|
|
925
925
|
source: deserializeStringLiteral(pos + 40),
|
|
926
|
-
attributes: withClause === null ? [] : withClause.
|
|
926
|
+
attributes: withClause === null ? [] : withClause.attributes,
|
|
927
927
|
};
|
|
928
928
|
}
|
|
929
929
|
|
|
@@ -957,11 +957,7 @@ function deserializeImportNamespaceSpecifier(pos) {
|
|
|
957
957
|
|
|
958
958
|
function deserializeWithClause(pos) {
|
|
959
959
|
return {
|
|
960
|
-
|
|
961
|
-
start: deserializeU32(pos),
|
|
962
|
-
end: deserializeU32(pos + 4),
|
|
963
|
-
attributesKeyword: deserializeIdentifierName(pos + 8),
|
|
964
|
-
withEntries: deserializeVecImportAttribute(pos + 32),
|
|
960
|
+
attributes: deserializeVecImportAttribute(pos + 32),
|
|
965
961
|
};
|
|
966
962
|
}
|
|
967
963
|
|
|
@@ -984,7 +980,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
984
980
|
declaration: deserializeOptionDeclaration(pos + 8),
|
|
985
981
|
specifiers: deserializeVecExportSpecifier(pos + 24),
|
|
986
982
|
source: deserializeOptionStringLiteral(pos + 56),
|
|
987
|
-
attributes: withClause === null ? [] : withClause.
|
|
983
|
+
attributes: withClause === null ? [] : withClause.attributes,
|
|
988
984
|
};
|
|
989
985
|
}
|
|
990
986
|
|
|
@@ -1005,7 +1001,7 @@ function deserializeExportAllDeclaration(pos) {
|
|
|
1005
1001
|
end: deserializeU32(pos + 4),
|
|
1006
1002
|
exported: deserializeOptionModuleExportName(pos + 8),
|
|
1007
1003
|
source: deserializeStringLiteral(pos + 64),
|
|
1008
|
-
attributes: withClause === null ? [] : withClause.
|
|
1004
|
+
attributes: withClause === null ? [] : withClause.attributes,
|
|
1009
1005
|
};
|
|
1010
1006
|
}
|
|
1011
1007
|
|
|
@@ -1109,11 +1105,17 @@ function deserializeRegExpLiteral(pos) {
|
|
|
1109
1105
|
|
|
1110
1106
|
function deserializeRegExp(pos) {
|
|
1111
1107
|
return {
|
|
1112
|
-
pattern:
|
|
1108
|
+
pattern: deserializeStr(pos),
|
|
1113
1109
|
flags: deserializeRegExpFlags(pos + 24),
|
|
1114
1110
|
};
|
|
1115
1111
|
}
|
|
1116
1112
|
|
|
1113
|
+
function deserializeRegExpPattern(pos) {
|
|
1114
|
+
return {
|
|
1115
|
+
pattern: deserializeStr(pos),
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1117
1119
|
function deserializeRegExpFlags(pos) {
|
|
1118
1120
|
const flagBits = deserializeU8(pos);
|
|
1119
1121
|
let flags = '';
|
|
@@ -1130,7 +1132,7 @@ function deserializeRegExpFlags(pos) {
|
|
|
1130
1132
|
}
|
|
1131
1133
|
|
|
1132
1134
|
function deserializeJSXElement(pos) {
|
|
1133
|
-
const closingElement = deserializeOptionBoxJSXClosingElement(pos +
|
|
1135
|
+
const closingElement = deserializeOptionBoxJSXClosingElement(pos + 48);
|
|
1134
1136
|
const openingElement = deserializeBoxJSXOpeningElement(pos + 8);
|
|
1135
1137
|
if (closingElement === null) openingElement.selfClosing = true;
|
|
1136
1138
|
return {
|
|
@@ -1139,7 +1141,7 @@ function deserializeJSXElement(pos) {
|
|
|
1139
1141
|
end: deserializeU32(pos + 4),
|
|
1140
1142
|
openingElement,
|
|
1141
1143
|
closingElement,
|
|
1142
|
-
children: deserializeVecJSXChild(pos +
|
|
1144
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1143
1145
|
};
|
|
1144
1146
|
}
|
|
1145
1147
|
|
|
@@ -1148,7 +1150,7 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
1148
1150
|
type: 'JSXOpeningElement',
|
|
1149
1151
|
start: deserializeU32(pos),
|
|
1150
1152
|
end: deserializeU32(pos + 4),
|
|
1151
|
-
attributes: deserializeVecJSXAttributeItem(pos +
|
|
1153
|
+
attributes: deserializeVecJSXAttributeItem(pos + 32),
|
|
1152
1154
|
name: deserializeJSXElementName(pos + 8),
|
|
1153
1155
|
selfClosing: false,
|
|
1154
1156
|
};
|
|
@@ -1169,8 +1171,8 @@ function deserializeJSXFragment(pos) {
|
|
|
1169
1171
|
start: deserializeU32(pos),
|
|
1170
1172
|
end: deserializeU32(pos + 4),
|
|
1171
1173
|
openingFragment: deserializeJSXOpeningFragment(pos + 8),
|
|
1172
|
-
closingFragment: deserializeJSXClosingFragment(pos +
|
|
1173
|
-
children: deserializeVecJSXChild(pos +
|
|
1174
|
+
closingFragment: deserializeJSXClosingFragment(pos + 48),
|
|
1175
|
+
children: deserializeVecJSXChild(pos + 16),
|
|
1174
1176
|
};
|
|
1175
1177
|
}
|
|
1176
1178
|
|
|
@@ -1283,9 +1285,9 @@ function deserializeTSThisParameter(pos) {
|
|
|
1283
1285
|
start: deserializeU32(pos),
|
|
1284
1286
|
end: deserializeU32(pos + 4),
|
|
1285
1287
|
name: 'this',
|
|
1286
|
-
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1287
1288
|
decorators: [],
|
|
1288
1289
|
optional: false,
|
|
1290
|
+
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(pos + 16),
|
|
1289
1291
|
};
|
|
1290
1292
|
}
|
|
1291
1293
|
|
|
@@ -1421,8 +1423,8 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
1421
1423
|
type: 'TSNamedTupleMember',
|
|
1422
1424
|
start: deserializeU32(pos),
|
|
1423
1425
|
end: deserializeU32(pos + 4),
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
+
label: deserializeIdentifierName(pos + 8),
|
|
1427
|
+
elementType: deserializeTSTupleElement(pos + 32),
|
|
1426
1428
|
optional: deserializeBool(pos + 48),
|
|
1427
1429
|
};
|
|
1428
1430
|
}
|
|
@@ -1758,9 +1760,9 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
1758
1760
|
start: deserializeU32(pos),
|
|
1759
1761
|
end: deserializeU32(pos + 4),
|
|
1760
1762
|
name: deserializeStr(pos + 8),
|
|
1761
|
-
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1762
1763
|
decorators: [],
|
|
1763
1764
|
optional: false,
|
|
1765
|
+
typeAnnotation: deserializeBoxTSTypeAnnotation(pos + 24),
|
|
1764
1766
|
};
|
|
1765
1767
|
}
|
|
1766
1768
|
|
|
@@ -1796,13 +1798,32 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
1796
1798
|
|
|
1797
1799
|
// Flatten `body`, and nest `id`
|
|
1798
1800
|
if (body !== null && body.type === 'TSModuleDeclaration') {
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1801
|
+
let innerId = body.id;
|
|
1802
|
+
if (innerId.type === 'Identifier') {
|
|
1803
|
+
id = {
|
|
1804
|
+
type: 'TSQualifiedName',
|
|
1805
|
+
start: id.start,
|
|
1806
|
+
end: innerId.end,
|
|
1807
|
+
left: id,
|
|
1808
|
+
right: innerId,
|
|
1809
|
+
};
|
|
1810
|
+
} else {
|
|
1811
|
+
// Replace `left` of innermost `TSQualifiedName` with a nested `TSQualifiedName` with `id` of
|
|
1812
|
+
// this module on left, and previous `left` of innermost `TSQualifiedName` on right
|
|
1813
|
+
while (true) {
|
|
1814
|
+
innerId.start = id.start;
|
|
1815
|
+
if (innerId.left.type === 'Identifier') break;
|
|
1816
|
+
innerId = innerId.left;
|
|
1817
|
+
}
|
|
1818
|
+
innerId.left = {
|
|
1819
|
+
type: 'TSQualifiedName',
|
|
1820
|
+
start: id.start,
|
|
1821
|
+
end: innerId.left.end,
|
|
1822
|
+
left: id,
|
|
1823
|
+
right: innerId.left,
|
|
1824
|
+
};
|
|
1825
|
+
id = body.id;
|
|
1826
|
+
}
|
|
1806
1827
|
body = Object.hasOwn(body, 'body') ? body.body : null;
|
|
1807
1828
|
}
|
|
1808
1829
|
|
|
@@ -1853,22 +1874,12 @@ function deserializeTSTypeQuery(pos) {
|
|
|
1853
1874
|
}
|
|
1854
1875
|
|
|
1855
1876
|
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
1877
|
return {
|
|
1867
1878
|
type: 'TSImportType',
|
|
1868
1879
|
start: deserializeU32(pos),
|
|
1869
1880
|
end: deserializeU32(pos + 4),
|
|
1870
1881
|
argument: deserializeTSType(pos + 8),
|
|
1871
|
-
options,
|
|
1882
|
+
options: deserializeOptionBoxObjectExpression(pos + 24),
|
|
1872
1883
|
qualifier: deserializeOptionTSTypeName(pos + 32),
|
|
1873
1884
|
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 48),
|
|
1874
1885
|
};
|
|
@@ -1901,6 +1912,8 @@ function deserializeTSConstructorType(pos) {
|
|
|
1901
1912
|
}
|
|
1902
1913
|
|
|
1903
1914
|
function deserializeTSMappedType(pos) {
|
|
1915
|
+
let optional = deserializeOptionTSMappedTypeModifierOperator(pos + 48);
|
|
1916
|
+
if (optional === null) optional = false;
|
|
1904
1917
|
const typeParameter = deserializeBoxTSTypeParameter(pos + 8);
|
|
1905
1918
|
return {
|
|
1906
1919
|
type: 'TSMappedType',
|
|
@@ -1908,7 +1921,7 @@ function deserializeTSMappedType(pos) {
|
|
|
1908
1921
|
end: deserializeU32(pos + 4),
|
|
1909
1922
|
nameType: deserializeOptionTSType(pos + 16),
|
|
1910
1923
|
typeAnnotation: deserializeOptionTSType(pos + 32),
|
|
1911
|
-
optional
|
|
1924
|
+
optional,
|
|
1912
1925
|
readonly: deserializeOptionTSMappedTypeModifierOperator(pos + 49),
|
|
1913
1926
|
key: typeParameter.name,
|
|
1914
1927
|
constraint: typeParameter.constraint,
|
|
@@ -1950,8 +1963,8 @@ function deserializeTSTypeAssertion(pos) {
|
|
|
1950
1963
|
type: 'TSTypeAssertion',
|
|
1951
1964
|
start: deserializeU32(pos),
|
|
1952
1965
|
end: deserializeU32(pos + 4),
|
|
1953
|
-
|
|
1954
|
-
|
|
1966
|
+
typeAnnotation: deserializeTSType(pos + 8),
|
|
1967
|
+
expression: deserializeExpression(pos + 24),
|
|
1955
1968
|
};
|
|
1956
1969
|
}
|
|
1957
1970
|
|
|
@@ -2111,202 +2124,6 @@ function deserializeSourceType(pos) {
|
|
|
2111
2124
|
};
|
|
2112
2125
|
}
|
|
2113
2126
|
|
|
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
2127
|
function deserializeRawTransferData(pos) {
|
|
2311
2128
|
return {
|
|
2312
2129
|
program: deserializeProgram(pos),
|
|
@@ -3419,19 +3236,6 @@ function deserializeModuleExportName(pos) {
|
|
|
3419
3236
|
}
|
|
3420
3237
|
}
|
|
3421
3238
|
|
|
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
3239
|
function deserializeJSXElementName(pos) {
|
|
3436
3240
|
switch (uint8[pos]) {
|
|
3437
3241
|
case 0:
|
|
@@ -4202,145 +4006,6 @@ function deserializeModuleKind(pos) {
|
|
|
4202
4006
|
}
|
|
4203
4007
|
}
|
|
4204
4008
|
|
|
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
4009
|
function deserializeErrorSeverity(pos) {
|
|
4345
4010
|
switch (uint8[pos]) {
|
|
4346
4011
|
case 0:
|
|
@@ -5208,6 +4873,11 @@ function deserializeBoxPattern(pos) {
|
|
|
5208
4873
|
return deserializePattern(uint32[pos >> 2]);
|
|
5209
4874
|
}
|
|
5210
4875
|
|
|
4876
|
+
function deserializeOptionBoxPattern(pos) {
|
|
4877
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
4878
|
+
return deserializeBoxPattern(pos);
|
|
4879
|
+
}
|
|
4880
|
+
|
|
5211
4881
|
function deserializeU8(pos) {
|
|
5212
4882
|
return uint8[pos];
|
|
5213
4883
|
}
|
|
@@ -5216,15 +4886,6 @@ function deserializeBoxJSXOpeningElement(pos) {
|
|
|
5216
4886
|
return deserializeJSXOpeningElement(uint32[pos >> 2]);
|
|
5217
4887
|
}
|
|
5218
4888
|
|
|
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
4889
|
function deserializeVecJSXChild(pos) {
|
|
5229
4890
|
const arr = [],
|
|
5230
4891
|
pos32 = pos >> 2,
|
|
@@ -5237,6 +4898,15 @@ function deserializeVecJSXChild(pos) {
|
|
|
5237
4898
|
return arr;
|
|
5238
4899
|
}
|
|
5239
4900
|
|
|
4901
|
+
function deserializeBoxJSXClosingElement(pos) {
|
|
4902
|
+
return deserializeJSXClosingElement(uint32[pos >> 2]);
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
function deserializeOptionBoxJSXClosingElement(pos) {
|
|
4906
|
+
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
4907
|
+
return deserializeBoxJSXClosingElement(pos);
|
|
4908
|
+
}
|
|
4909
|
+
|
|
5240
4910
|
function deserializeVecJSXAttributeItem(pos) {
|
|
5241
4911
|
const arr = [],
|
|
5242
4912
|
pos32 = pos >> 2,
|