oxc-parser 0.80.0 → 0.81.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 +77 -5
- package/generated/deserialize/ts.js +77 -5
- package/generated/lazy/constructors.js +73 -5
- package/generated/lazy/types.js +18 -17
- package/generated/lazy/walk.js +53 -20
- package/package.json +18 -18
|
@@ -987,7 +987,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
987
987
|
function deserializeExportDefaultDeclaration(pos) {
|
|
988
988
|
return {
|
|
989
989
|
type: 'ExportDefaultDeclaration',
|
|
990
|
-
declaration: deserializeExportDefaultDeclarationKind(pos +
|
|
990
|
+
declaration: deserializeExportDefaultDeclarationKind(pos + 8),
|
|
991
991
|
start: deserializeU32(pos),
|
|
992
992
|
end: deserializeU32(pos + 4),
|
|
993
993
|
};
|
|
@@ -1874,17 +1874,74 @@ function deserializeTSTypeQuery(pos) {
|
|
|
1874
1874
|
}
|
|
1875
1875
|
|
|
1876
1876
|
function deserializeTSImportType(pos) {
|
|
1877
|
+
let qualifier = deserializeOptionTSImportTypeQualifier(pos + 32);
|
|
1878
|
+
if (qualifier !== null) {
|
|
1879
|
+
if (qualifier.type === 'IdentifierName') {
|
|
1880
|
+
qualifier = {
|
|
1881
|
+
type: 'Identifier',
|
|
1882
|
+
decorators: [],
|
|
1883
|
+
name: qualifier.name,
|
|
1884
|
+
optional: false,
|
|
1885
|
+
typeAnnotation: null,
|
|
1886
|
+
start: qualifier.start,
|
|
1887
|
+
end: qualifier.end,
|
|
1888
|
+
};
|
|
1889
|
+
} else if (qualifier.type === 'TSImportTypeQualifiedName') {
|
|
1890
|
+
// Convert TSImportTypeQualifiedName to TSQualifiedName
|
|
1891
|
+
const convertQualifier = (q) => {
|
|
1892
|
+
if (q.type === 'IdentifierName') {
|
|
1893
|
+
return {
|
|
1894
|
+
type: 'Identifier',
|
|
1895
|
+
decorators: [],
|
|
1896
|
+
name: q.name,
|
|
1897
|
+
optional: false,
|
|
1898
|
+
typeAnnotation: null,
|
|
1899
|
+
start: q.start,
|
|
1900
|
+
end: q.end,
|
|
1901
|
+
};
|
|
1902
|
+
} else if (q.type === 'TSImportTypeQualifiedName') {
|
|
1903
|
+
return {
|
|
1904
|
+
type: 'TSQualifiedName',
|
|
1905
|
+
left: convertQualifier(q.left),
|
|
1906
|
+
right: {
|
|
1907
|
+
type: 'Identifier',
|
|
1908
|
+
decorators: [],
|
|
1909
|
+
name: q.right.name,
|
|
1910
|
+
optional: false,
|
|
1911
|
+
typeAnnotation: null,
|
|
1912
|
+
start: q.right.start,
|
|
1913
|
+
end: q.right.end,
|
|
1914
|
+
},
|
|
1915
|
+
start: q.start,
|
|
1916
|
+
end: q.end,
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
return q;
|
|
1920
|
+
};
|
|
1921
|
+
qualifier = convertQualifier(qualifier);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1877
1924
|
return {
|
|
1878
1925
|
type: 'TSImportType',
|
|
1879
1926
|
argument: deserializeTSType(pos + 8),
|
|
1880
1927
|
options: deserializeOptionBoxObjectExpression(pos + 24),
|
|
1881
|
-
qualifier
|
|
1928
|
+
qualifier,
|
|
1882
1929
|
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 48),
|
|
1883
1930
|
start: deserializeU32(pos),
|
|
1884
1931
|
end: deserializeU32(pos + 4),
|
|
1885
1932
|
};
|
|
1886
1933
|
}
|
|
1887
1934
|
|
|
1935
|
+
function deserializeTSImportTypeQualifiedName(pos) {
|
|
1936
|
+
return {
|
|
1937
|
+
type: 'TSImportTypeQualifiedName',
|
|
1938
|
+
left: deserializeTSImportTypeQualifier(pos + 8),
|
|
1939
|
+
right: deserializeIdentifierName(pos + 24),
|
|
1940
|
+
start: deserializeU32(pos),
|
|
1941
|
+
end: deserializeU32(pos + 4),
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1888
1945
|
function deserializeTSFunctionType(pos) {
|
|
1889
1946
|
const params = deserializeBoxFormalParameters(pos + 24);
|
|
1890
1947
|
const thisParam = deserializeOptionBoxTSThisParameter(pos + 16);
|
|
@@ -3750,6 +3807,17 @@ function deserializeTSTypeQueryExprName(pos) {
|
|
|
3750
3807
|
}
|
|
3751
3808
|
}
|
|
3752
3809
|
|
|
3810
|
+
function deserializeTSImportTypeQualifier(pos) {
|
|
3811
|
+
switch (uint8[pos]) {
|
|
3812
|
+
case 0:
|
|
3813
|
+
return deserializeBoxIdentifierName(pos + 8);
|
|
3814
|
+
case 1:
|
|
3815
|
+
return deserializeBoxTSImportTypeQualifiedName(pos + 8);
|
|
3816
|
+
default:
|
|
3817
|
+
throw new Error(`Unexpected discriminant ${uint8[pos]} for TSImportTypeQualifier`);
|
|
3818
|
+
}
|
|
3819
|
+
}
|
|
3820
|
+
|
|
3753
3821
|
function deserializeTSMappedTypeModifierOperator(pos) {
|
|
3754
3822
|
switch (uint8[pos]) {
|
|
3755
3823
|
case 0:
|
|
@@ -5228,9 +5296,13 @@ function deserializeOptionBoxObjectExpression(pos) {
|
|
|
5228
5296
|
return deserializeBoxObjectExpression(pos);
|
|
5229
5297
|
}
|
|
5230
5298
|
|
|
5231
|
-
function
|
|
5232
|
-
if (uint8[pos] ===
|
|
5233
|
-
return
|
|
5299
|
+
function deserializeOptionTSImportTypeQualifier(pos) {
|
|
5300
|
+
if (uint8[pos] === 2) return null;
|
|
5301
|
+
return deserializeTSImportTypeQualifier(pos);
|
|
5302
|
+
}
|
|
5303
|
+
|
|
5304
|
+
function deserializeBoxTSImportTypeQualifiedName(pos) {
|
|
5305
|
+
return deserializeTSImportTypeQualifiedName(uint32[pos >> 2]);
|
|
5234
5306
|
}
|
|
5235
5307
|
|
|
5236
5308
|
function deserializeOptionTSMappedTypeModifierOperator(pos) {
|
|
@@ -1116,7 +1116,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
1116
1116
|
function deserializeExportDefaultDeclaration(pos) {
|
|
1117
1117
|
return {
|
|
1118
1118
|
type: 'ExportDefaultDeclaration',
|
|
1119
|
-
declaration: deserializeExportDefaultDeclarationKind(pos +
|
|
1119
|
+
declaration: deserializeExportDefaultDeclarationKind(pos + 8),
|
|
1120
1120
|
exportKind: 'value',
|
|
1121
1121
|
start: deserializeU32(pos),
|
|
1122
1122
|
end: deserializeU32(pos + 4),
|
|
@@ -2005,17 +2005,74 @@ function deserializeTSTypeQuery(pos) {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
|
|
2007
2007
|
function deserializeTSImportType(pos) {
|
|
2008
|
+
let qualifier = deserializeOptionTSImportTypeQualifier(pos + 32);
|
|
2009
|
+
if (qualifier !== null) {
|
|
2010
|
+
if (qualifier.type === 'IdentifierName') {
|
|
2011
|
+
qualifier = {
|
|
2012
|
+
type: 'Identifier',
|
|
2013
|
+
decorators: [],
|
|
2014
|
+
name: qualifier.name,
|
|
2015
|
+
optional: false,
|
|
2016
|
+
typeAnnotation: null,
|
|
2017
|
+
start: qualifier.start,
|
|
2018
|
+
end: qualifier.end,
|
|
2019
|
+
};
|
|
2020
|
+
} else if (qualifier.type === 'TSImportTypeQualifiedName') {
|
|
2021
|
+
// Convert TSImportTypeQualifiedName to TSQualifiedName
|
|
2022
|
+
const convertQualifier = (q) => {
|
|
2023
|
+
if (q.type === 'IdentifierName') {
|
|
2024
|
+
return {
|
|
2025
|
+
type: 'Identifier',
|
|
2026
|
+
decorators: [],
|
|
2027
|
+
name: q.name,
|
|
2028
|
+
optional: false,
|
|
2029
|
+
typeAnnotation: null,
|
|
2030
|
+
start: q.start,
|
|
2031
|
+
end: q.end,
|
|
2032
|
+
};
|
|
2033
|
+
} else if (q.type === 'TSImportTypeQualifiedName') {
|
|
2034
|
+
return {
|
|
2035
|
+
type: 'TSQualifiedName',
|
|
2036
|
+
left: convertQualifier(q.left),
|
|
2037
|
+
right: {
|
|
2038
|
+
type: 'Identifier',
|
|
2039
|
+
decorators: [],
|
|
2040
|
+
name: q.right.name,
|
|
2041
|
+
optional: false,
|
|
2042
|
+
typeAnnotation: null,
|
|
2043
|
+
start: q.right.start,
|
|
2044
|
+
end: q.right.end,
|
|
2045
|
+
},
|
|
2046
|
+
start: q.start,
|
|
2047
|
+
end: q.end,
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
return q;
|
|
2051
|
+
};
|
|
2052
|
+
qualifier = convertQualifier(qualifier);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2008
2055
|
return {
|
|
2009
2056
|
type: 'TSImportType',
|
|
2010
2057
|
argument: deserializeTSType(pos + 8),
|
|
2011
2058
|
options: deserializeOptionBoxObjectExpression(pos + 24),
|
|
2012
|
-
qualifier
|
|
2059
|
+
qualifier,
|
|
2013
2060
|
typeArguments: deserializeOptionBoxTSTypeParameterInstantiation(pos + 48),
|
|
2014
2061
|
start: deserializeU32(pos),
|
|
2015
2062
|
end: deserializeU32(pos + 4),
|
|
2016
2063
|
};
|
|
2017
2064
|
}
|
|
2018
2065
|
|
|
2066
|
+
function deserializeTSImportTypeQualifiedName(pos) {
|
|
2067
|
+
return {
|
|
2068
|
+
type: 'TSImportTypeQualifiedName',
|
|
2069
|
+
left: deserializeTSImportTypeQualifier(pos + 8),
|
|
2070
|
+
right: deserializeIdentifierName(pos + 24),
|
|
2071
|
+
start: deserializeU32(pos),
|
|
2072
|
+
end: deserializeU32(pos + 4),
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2019
2076
|
function deserializeTSFunctionType(pos) {
|
|
2020
2077
|
const params = deserializeBoxFormalParameters(pos + 24);
|
|
2021
2078
|
const thisParam = deserializeOptionBoxTSThisParameter(pos + 16);
|
|
@@ -3881,6 +3938,17 @@ function deserializeTSTypeQueryExprName(pos) {
|
|
|
3881
3938
|
}
|
|
3882
3939
|
}
|
|
3883
3940
|
|
|
3941
|
+
function deserializeTSImportTypeQualifier(pos) {
|
|
3942
|
+
switch (uint8[pos]) {
|
|
3943
|
+
case 0:
|
|
3944
|
+
return deserializeBoxIdentifierName(pos + 8);
|
|
3945
|
+
case 1:
|
|
3946
|
+
return deserializeBoxTSImportTypeQualifiedName(pos + 8);
|
|
3947
|
+
default:
|
|
3948
|
+
throw new Error(`Unexpected discriminant ${uint8[pos]} for TSImportTypeQualifier`);
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3884
3952
|
function deserializeTSMappedTypeModifierOperator(pos) {
|
|
3885
3953
|
switch (uint8[pos]) {
|
|
3886
3954
|
case 0:
|
|
@@ -5359,9 +5427,13 @@ function deserializeOptionBoxObjectExpression(pos) {
|
|
|
5359
5427
|
return deserializeBoxObjectExpression(pos);
|
|
5360
5428
|
}
|
|
5361
5429
|
|
|
5362
|
-
function
|
|
5363
|
-
if (uint8[pos] ===
|
|
5364
|
-
return
|
|
5430
|
+
function deserializeOptionTSImportTypeQualifier(pos) {
|
|
5431
|
+
if (uint8[pos] === 2) return null;
|
|
5432
|
+
return deserializeTSImportTypeQualifier(pos);
|
|
5433
|
+
}
|
|
5434
|
+
|
|
5435
|
+
function deserializeBoxTSImportTypeQualifiedName(pos) {
|
|
5436
|
+
return deserializeTSImportTypeQualifiedName(uint32[pos >> 2]);
|
|
5365
5437
|
}
|
|
5366
5438
|
|
|
5367
5439
|
function deserializeOptionTSMappedTypeModifierOperator(pos) {
|
|
@@ -5965,7 +5965,7 @@ class ExportDefaultDeclaration {
|
|
|
5965
5965
|
|
|
5966
5966
|
get declaration() {
|
|
5967
5967
|
const internal = this.#internal;
|
|
5968
|
-
return constructExportDefaultDeclarationKind(internal.pos +
|
|
5968
|
+
return constructExportDefaultDeclarationKind(internal.pos + 8, internal.ast);
|
|
5969
5969
|
}
|
|
5970
5970
|
|
|
5971
5971
|
toJSON() {
|
|
@@ -10650,7 +10650,7 @@ class TSImportType {
|
|
|
10650
10650
|
|
|
10651
10651
|
get qualifier() {
|
|
10652
10652
|
const internal = this.#internal;
|
|
10653
|
-
return
|
|
10653
|
+
return constructOptionTSImportTypeQualifier(internal.pos + 32, internal.ast);
|
|
10654
10654
|
}
|
|
10655
10655
|
|
|
10656
10656
|
get typeArguments() {
|
|
@@ -10677,6 +10677,69 @@ class TSImportType {
|
|
|
10677
10677
|
|
|
10678
10678
|
const DebugTSImportType = class TSImportType {};
|
|
10679
10679
|
|
|
10680
|
+
function constructTSImportTypeQualifier(pos, ast) {
|
|
10681
|
+
switch (ast.buffer[pos]) {
|
|
10682
|
+
case 0:
|
|
10683
|
+
return constructBoxIdentifierName(pos + 8, ast);
|
|
10684
|
+
case 1:
|
|
10685
|
+
return constructBoxTSImportTypeQualifiedName(pos + 8, ast);
|
|
10686
|
+
default:
|
|
10687
|
+
throw new Error(`Unexpected discriminant ${ast.buffer[pos]} for TSImportTypeQualifier`);
|
|
10688
|
+
}
|
|
10689
|
+
}
|
|
10690
|
+
|
|
10691
|
+
class TSImportTypeQualifiedName {
|
|
10692
|
+
type = 'TSImportTypeQualifiedName';
|
|
10693
|
+
#internal;
|
|
10694
|
+
|
|
10695
|
+
constructor(pos, ast) {
|
|
10696
|
+
if (ast?.token !== TOKEN) constructorError();
|
|
10697
|
+
|
|
10698
|
+
const { nodes } = ast;
|
|
10699
|
+
const cached = nodes.get(pos);
|
|
10700
|
+
if (cached !== void 0) return cached;
|
|
10701
|
+
|
|
10702
|
+
this.#internal = { pos, ast };
|
|
10703
|
+
nodes.set(pos, this);
|
|
10704
|
+
}
|
|
10705
|
+
|
|
10706
|
+
get start() {
|
|
10707
|
+
const internal = this.#internal;
|
|
10708
|
+
return constructU32(internal.pos, internal.ast);
|
|
10709
|
+
}
|
|
10710
|
+
|
|
10711
|
+
get end() {
|
|
10712
|
+
const internal = this.#internal;
|
|
10713
|
+
return constructU32(internal.pos + 4, internal.ast);
|
|
10714
|
+
}
|
|
10715
|
+
|
|
10716
|
+
get left() {
|
|
10717
|
+
const internal = this.#internal;
|
|
10718
|
+
return constructTSImportTypeQualifier(internal.pos + 8, internal.ast);
|
|
10719
|
+
}
|
|
10720
|
+
|
|
10721
|
+
get right() {
|
|
10722
|
+
const internal = this.#internal;
|
|
10723
|
+
return new IdentifierName(internal.pos + 24, internal.ast);
|
|
10724
|
+
}
|
|
10725
|
+
|
|
10726
|
+
toJSON() {
|
|
10727
|
+
return {
|
|
10728
|
+
type: 'TSImportTypeQualifiedName',
|
|
10729
|
+
start: this.start,
|
|
10730
|
+
end: this.end,
|
|
10731
|
+
left: this.left,
|
|
10732
|
+
right: this.right,
|
|
10733
|
+
};
|
|
10734
|
+
}
|
|
10735
|
+
|
|
10736
|
+
[inspectSymbol]() {
|
|
10737
|
+
return Object.setPrototypeOf(this.toJSON(), DebugTSImportTypeQualifiedName.prototype);
|
|
10738
|
+
}
|
|
10739
|
+
}
|
|
10740
|
+
|
|
10741
|
+
const DebugTSImportTypeQualifiedName = class TSImportTypeQualifiedName {};
|
|
10742
|
+
|
|
10680
10743
|
class TSFunctionType {
|
|
10681
10744
|
type = 'TSFunctionType';
|
|
10682
10745
|
#internal;
|
|
@@ -13742,9 +13805,13 @@ function constructOptionBoxObjectExpression(pos, ast) {
|
|
|
13742
13805
|
return constructBoxObjectExpression(pos, ast);
|
|
13743
13806
|
}
|
|
13744
13807
|
|
|
13745
|
-
function
|
|
13746
|
-
if (ast.buffer[pos] ===
|
|
13747
|
-
return
|
|
13808
|
+
function constructOptionTSImportTypeQualifier(pos, ast) {
|
|
13809
|
+
if (ast.buffer[pos] === 2) return null;
|
|
13810
|
+
return constructTSImportTypeQualifier(pos, ast);
|
|
13811
|
+
}
|
|
13812
|
+
|
|
13813
|
+
function constructBoxTSImportTypeQualifiedName(pos, ast) {
|
|
13814
|
+
return new TSImportTypeQualifiedName(ast.buffer.uint32[pos >> 2], ast);
|
|
13748
13815
|
}
|
|
13749
13816
|
|
|
13750
13817
|
function constructOptionTSMappedTypeModifierOperator(pos, ast) {
|
|
@@ -14074,6 +14141,7 @@ module.exports = {
|
|
|
14074
14141
|
TSInferType,
|
|
14075
14142
|
TSTypeQuery,
|
|
14076
14143
|
TSImportType,
|
|
14144
|
+
TSImportTypeQualifiedName,
|
|
14077
14145
|
TSFunctionType,
|
|
14078
14146
|
TSConstructorType,
|
|
14079
14147
|
TSMappedType,
|
package/generated/lazy/types.js
CHANGED
|
@@ -169,25 +169,26 @@ const NODE_TYPE_IDS_MAP = new Map([
|
|
|
169
169
|
['TSInferType', 159],
|
|
170
170
|
['TSTypeQuery', 160],
|
|
171
171
|
['TSImportType', 161],
|
|
172
|
-
['
|
|
173
|
-
['
|
|
174
|
-
['
|
|
175
|
-
['
|
|
176
|
-
['
|
|
177
|
-
['
|
|
178
|
-
['
|
|
179
|
-
['
|
|
180
|
-
['
|
|
181
|
-
['
|
|
182
|
-
['
|
|
183
|
-
['
|
|
184
|
-
['
|
|
185
|
-
['
|
|
186
|
-
['
|
|
187
|
-
['
|
|
172
|
+
['TSImportTypeQualifiedName', 162],
|
|
173
|
+
['TSFunctionType', 163],
|
|
174
|
+
['TSConstructorType', 164],
|
|
175
|
+
['TSMappedType', 165],
|
|
176
|
+
['TSTemplateLiteralType', 166],
|
|
177
|
+
['TSAsExpression', 167],
|
|
178
|
+
['TSSatisfiesExpression', 168],
|
|
179
|
+
['TSTypeAssertion', 169],
|
|
180
|
+
['TSImportEqualsDeclaration', 170],
|
|
181
|
+
['TSExternalModuleReference', 171],
|
|
182
|
+
['TSNonNullExpression', 172],
|
|
183
|
+
['Decorator', 173],
|
|
184
|
+
['TSExportAssignment', 174],
|
|
185
|
+
['TSNamespaceExportDeclaration', 175],
|
|
186
|
+
['TSInstantiationExpression', 176],
|
|
187
|
+
['JSDocNullableType', 177],
|
|
188
|
+
['JSDocNonNullableType', 178],
|
|
188
189
|
]);
|
|
189
190
|
|
|
190
|
-
const NODE_TYPES_COUNT =
|
|
191
|
+
const NODE_TYPES_COUNT = 179,
|
|
191
192
|
LEAF_NODE_TYPES_COUNT = 38;
|
|
192
193
|
|
|
193
194
|
module.exports = {
|
package/generated/lazy/walk.js
CHANGED
|
@@ -165,6 +165,7 @@ const {
|
|
|
165
165
|
TSInferType,
|
|
166
166
|
TSTypeQuery,
|
|
167
167
|
TSImportType,
|
|
168
|
+
TSImportTypeQualifiedName,
|
|
168
169
|
TSFunctionType,
|
|
169
170
|
TSConstructorType,
|
|
170
171
|
TSMappedType,
|
|
@@ -2437,7 +2438,7 @@ function walkExportDefaultDeclaration(pos, ast, visitors) {
|
|
|
2437
2438
|
if (enter !== null) enter(node);
|
|
2438
2439
|
}
|
|
2439
2440
|
|
|
2440
|
-
walkExportDefaultDeclarationKind(pos +
|
|
2441
|
+
walkExportDefaultDeclarationKind(pos + 8, ast, visitors);
|
|
2441
2442
|
|
|
2442
2443
|
if (exit !== null) exit(node);
|
|
2443
2444
|
}
|
|
@@ -4122,15 +4123,43 @@ function walkTSImportType(pos, ast, visitors) {
|
|
|
4122
4123
|
|
|
4123
4124
|
walkTSType(pos + 8, ast, visitors);
|
|
4124
4125
|
walkOptionBoxObjectExpression(pos + 24, ast, visitors);
|
|
4125
|
-
|
|
4126
|
+
walkOptionTSImportTypeQualifier(pos + 32, ast, visitors);
|
|
4126
4127
|
walkOptionBoxTSTypeParameterInstantiation(pos + 48, ast, visitors);
|
|
4127
4128
|
|
|
4128
4129
|
if (exit !== null) exit(node);
|
|
4129
4130
|
}
|
|
4130
4131
|
|
|
4131
|
-
function
|
|
4132
|
+
function walkTSImportTypeQualifier(pos, ast, visitors) {
|
|
4133
|
+
switch (ast.buffer[pos]) {
|
|
4134
|
+
case 0:
|
|
4135
|
+
walkBoxIdentifierName(pos + 8, ast, visitors);
|
|
4136
|
+
return;
|
|
4137
|
+
case 1:
|
|
4138
|
+
walkBoxTSImportTypeQualifiedName(pos + 8, ast, visitors);
|
|
4139
|
+
return;
|
|
4140
|
+
default:
|
|
4141
|
+
throw new Error(`Unexpected discriminant ${ast.buffer[pos]} for TSImportTypeQualifier`);
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
|
|
4145
|
+
function walkTSImportTypeQualifiedName(pos, ast, visitors) {
|
|
4132
4146
|
const enterExit = visitors[162];
|
|
4133
4147
|
let node, enter, exit = null;
|
|
4148
|
+
if (enterExit !== null) {
|
|
4149
|
+
({ enter, exit } = enterExit);
|
|
4150
|
+
node = new TSImportTypeQualifiedName(pos, ast);
|
|
4151
|
+
if (enter !== null) enter(node);
|
|
4152
|
+
}
|
|
4153
|
+
|
|
4154
|
+
walkTSImportTypeQualifier(pos + 8, ast, visitors);
|
|
4155
|
+
walkIdentifierName(pos + 24, ast, visitors);
|
|
4156
|
+
|
|
4157
|
+
if (exit !== null) exit(node);
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
function walkTSFunctionType(pos, ast, visitors) {
|
|
4161
|
+
const enterExit = visitors[163];
|
|
4162
|
+
let node, enter, exit = null;
|
|
4134
4163
|
if (enterExit !== null) {
|
|
4135
4164
|
({ enter, exit } = enterExit);
|
|
4136
4165
|
node = new TSFunctionType(pos, ast);
|
|
@@ -4145,7 +4174,7 @@ function walkTSFunctionType(pos, ast, visitors) {
|
|
|
4145
4174
|
}
|
|
4146
4175
|
|
|
4147
4176
|
function walkTSConstructorType(pos, ast, visitors) {
|
|
4148
|
-
const enterExit = visitors[
|
|
4177
|
+
const enterExit = visitors[164];
|
|
4149
4178
|
let node, enter, exit = null;
|
|
4150
4179
|
if (enterExit !== null) {
|
|
4151
4180
|
({ enter, exit } = enterExit);
|
|
@@ -4161,7 +4190,7 @@ function walkTSConstructorType(pos, ast, visitors) {
|
|
|
4161
4190
|
}
|
|
4162
4191
|
|
|
4163
4192
|
function walkTSMappedType(pos, ast, visitors) {
|
|
4164
|
-
const enterExit = visitors[
|
|
4193
|
+
const enterExit = visitors[165];
|
|
4165
4194
|
let node, enter, exit = null;
|
|
4166
4195
|
if (enterExit !== null) {
|
|
4167
4196
|
({ enter, exit } = enterExit);
|
|
@@ -4176,7 +4205,7 @@ function walkTSMappedType(pos, ast, visitors) {
|
|
|
4176
4205
|
}
|
|
4177
4206
|
|
|
4178
4207
|
function walkTSTemplateLiteralType(pos, ast, visitors) {
|
|
4179
|
-
const enterExit = visitors[
|
|
4208
|
+
const enterExit = visitors[166];
|
|
4180
4209
|
let node, enter, exit = null;
|
|
4181
4210
|
if (enterExit !== null) {
|
|
4182
4211
|
({ enter, exit } = enterExit);
|
|
@@ -4191,7 +4220,7 @@ function walkTSTemplateLiteralType(pos, ast, visitors) {
|
|
|
4191
4220
|
}
|
|
4192
4221
|
|
|
4193
4222
|
function walkTSAsExpression(pos, ast, visitors) {
|
|
4194
|
-
const enterExit = visitors[
|
|
4223
|
+
const enterExit = visitors[167];
|
|
4195
4224
|
let node, enter, exit = null;
|
|
4196
4225
|
if (enterExit !== null) {
|
|
4197
4226
|
({ enter, exit } = enterExit);
|
|
@@ -4206,7 +4235,7 @@ function walkTSAsExpression(pos, ast, visitors) {
|
|
|
4206
4235
|
}
|
|
4207
4236
|
|
|
4208
4237
|
function walkTSSatisfiesExpression(pos, ast, visitors) {
|
|
4209
|
-
const enterExit = visitors[
|
|
4238
|
+
const enterExit = visitors[168];
|
|
4210
4239
|
let node, enter, exit = null;
|
|
4211
4240
|
if (enterExit !== null) {
|
|
4212
4241
|
({ enter, exit } = enterExit);
|
|
@@ -4221,7 +4250,7 @@ function walkTSSatisfiesExpression(pos, ast, visitors) {
|
|
|
4221
4250
|
}
|
|
4222
4251
|
|
|
4223
4252
|
function walkTSTypeAssertion(pos, ast, visitors) {
|
|
4224
|
-
const enterExit = visitors[
|
|
4253
|
+
const enterExit = visitors[169];
|
|
4225
4254
|
let node, enter, exit = null;
|
|
4226
4255
|
if (enterExit !== null) {
|
|
4227
4256
|
({ enter, exit } = enterExit);
|
|
@@ -4236,7 +4265,7 @@ function walkTSTypeAssertion(pos, ast, visitors) {
|
|
|
4236
4265
|
}
|
|
4237
4266
|
|
|
4238
4267
|
function walkTSImportEqualsDeclaration(pos, ast, visitors) {
|
|
4239
|
-
const enterExit = visitors[
|
|
4268
|
+
const enterExit = visitors[170];
|
|
4240
4269
|
let node, enter, exit = null;
|
|
4241
4270
|
if (enterExit !== null) {
|
|
4242
4271
|
({ enter, exit } = enterExit);
|
|
@@ -4270,7 +4299,7 @@ function walkTSModuleReference(pos, ast, visitors) {
|
|
|
4270
4299
|
}
|
|
4271
4300
|
|
|
4272
4301
|
function walkTSExternalModuleReference(pos, ast, visitors) {
|
|
4273
|
-
const enterExit = visitors[
|
|
4302
|
+
const enterExit = visitors[171];
|
|
4274
4303
|
let node, enter, exit = null;
|
|
4275
4304
|
if (enterExit !== null) {
|
|
4276
4305
|
({ enter, exit } = enterExit);
|
|
@@ -4284,7 +4313,7 @@ function walkTSExternalModuleReference(pos, ast, visitors) {
|
|
|
4284
4313
|
}
|
|
4285
4314
|
|
|
4286
4315
|
function walkTSNonNullExpression(pos, ast, visitors) {
|
|
4287
|
-
const enterExit = visitors[
|
|
4316
|
+
const enterExit = visitors[172];
|
|
4288
4317
|
let node, enter, exit = null;
|
|
4289
4318
|
if (enterExit !== null) {
|
|
4290
4319
|
({ enter, exit } = enterExit);
|
|
@@ -4298,7 +4327,7 @@ function walkTSNonNullExpression(pos, ast, visitors) {
|
|
|
4298
4327
|
}
|
|
4299
4328
|
|
|
4300
4329
|
function walkDecorator(pos, ast, visitors) {
|
|
4301
|
-
const enterExit = visitors[
|
|
4330
|
+
const enterExit = visitors[173];
|
|
4302
4331
|
let node, enter, exit = null;
|
|
4303
4332
|
if (enterExit !== null) {
|
|
4304
4333
|
({ enter, exit } = enterExit);
|
|
@@ -4312,7 +4341,7 @@ function walkDecorator(pos, ast, visitors) {
|
|
|
4312
4341
|
}
|
|
4313
4342
|
|
|
4314
4343
|
function walkTSExportAssignment(pos, ast, visitors) {
|
|
4315
|
-
const enterExit = visitors[
|
|
4344
|
+
const enterExit = visitors[174];
|
|
4316
4345
|
let node, enter, exit = null;
|
|
4317
4346
|
if (enterExit !== null) {
|
|
4318
4347
|
({ enter, exit } = enterExit);
|
|
@@ -4326,7 +4355,7 @@ function walkTSExportAssignment(pos, ast, visitors) {
|
|
|
4326
4355
|
}
|
|
4327
4356
|
|
|
4328
4357
|
function walkTSNamespaceExportDeclaration(pos, ast, visitors) {
|
|
4329
|
-
const enterExit = visitors[
|
|
4358
|
+
const enterExit = visitors[175];
|
|
4330
4359
|
let node, enter, exit = null;
|
|
4331
4360
|
if (enterExit !== null) {
|
|
4332
4361
|
({ enter, exit } = enterExit);
|
|
@@ -4340,7 +4369,7 @@ function walkTSNamespaceExportDeclaration(pos, ast, visitors) {
|
|
|
4340
4369
|
}
|
|
4341
4370
|
|
|
4342
4371
|
function walkTSInstantiationExpression(pos, ast, visitors) {
|
|
4343
|
-
const enterExit = visitors[
|
|
4372
|
+
const enterExit = visitors[176];
|
|
4344
4373
|
let node, enter, exit = null;
|
|
4345
4374
|
if (enterExit !== null) {
|
|
4346
4375
|
({ enter, exit } = enterExit);
|
|
@@ -4355,7 +4384,7 @@ function walkTSInstantiationExpression(pos, ast, visitors) {
|
|
|
4355
4384
|
}
|
|
4356
4385
|
|
|
4357
4386
|
function walkJSDocNullableType(pos, ast, visitors) {
|
|
4358
|
-
const enterExit = visitors[
|
|
4387
|
+
const enterExit = visitors[177];
|
|
4359
4388
|
let node, enter, exit = null;
|
|
4360
4389
|
if (enterExit !== null) {
|
|
4361
4390
|
({ enter, exit } = enterExit);
|
|
@@ -4369,7 +4398,7 @@ function walkJSDocNullableType(pos, ast, visitors) {
|
|
|
4369
4398
|
}
|
|
4370
4399
|
|
|
4371
4400
|
function walkJSDocNonNullableType(pos, ast, visitors) {
|
|
4372
|
-
const enterExit = visitors[
|
|
4401
|
+
const enterExit = visitors[178];
|
|
4373
4402
|
let node, enter, exit = null;
|
|
4374
4403
|
if (enterExit !== null) {
|
|
4375
4404
|
({ enter, exit } = enterExit);
|
|
@@ -5457,8 +5486,12 @@ function walkOptionBoxObjectExpression(pos, ast, visitors) {
|
|
|
5457
5486
|
}
|
|
5458
5487
|
}
|
|
5459
5488
|
|
|
5460
|
-
function
|
|
5461
|
-
if (!(ast.buffer[pos] ===
|
|
5489
|
+
function walkOptionTSImportTypeQualifier(pos, ast, visitors) {
|
|
5490
|
+
if (!(ast.buffer[pos] === 2)) walkTSImportTypeQualifier(pos, ast, visitors);
|
|
5491
|
+
}
|
|
5492
|
+
|
|
5493
|
+
function walkBoxTSImportTypeQualifiedName(pos, ast, visitors) {
|
|
5494
|
+
return walkTSImportTypeQualifiedName(ast.buffer.uint32[pos >> 2], ast, visitors);
|
|
5462
5495
|
}
|
|
5463
5496
|
|
|
5464
5497
|
function walkBoxTSExternalModuleReference(pos, ast, visitors) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"browser": "wasm.mjs",
|
|
6
6
|
"engines": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@oxc-project/types": "^0.
|
|
53
|
+
"@oxc-project/types": "^0.81.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@codspeed/vitest-plugin": "^4.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"esbuild": "^0.25.0",
|
|
60
60
|
"playwright": "^1.51.0",
|
|
61
61
|
"tinypool": "^1.1.0",
|
|
62
|
-
"typescript": "5.
|
|
62
|
+
"typescript": "5.9.2",
|
|
63
63
|
"vitest": "3.2.4"
|
|
64
64
|
},
|
|
65
65
|
"napi": {
|
|
@@ -90,21 +90,21 @@
|
|
|
90
90
|
"dtsHeaderFile": "header.js"
|
|
91
91
|
},
|
|
92
92
|
"optionalDependencies": {
|
|
93
|
-
"@oxc-parser/binding-win32-x64-msvc": "0.
|
|
94
|
-
"@oxc-parser/binding-win32-arm64-msvc": "0.
|
|
95
|
-
"@oxc-parser/binding-linux-x64-gnu": "0.
|
|
96
|
-
"@oxc-parser/binding-linux-x64-musl": "0.
|
|
97
|
-
"@oxc-parser/binding-freebsd-x64": "0.
|
|
98
|
-
"@oxc-parser/binding-linux-arm64-gnu": "0.
|
|
99
|
-
"@oxc-parser/binding-linux-arm64-musl": "0.
|
|
100
|
-
"@oxc-parser/binding-linux-arm-gnueabihf": "0.
|
|
101
|
-
"@oxc-parser/binding-linux-arm-musleabihf": "0.
|
|
102
|
-
"@oxc-parser/binding-linux-s390x-gnu": "0.
|
|
103
|
-
"@oxc-parser/binding-linux-riscv64-gnu": "0.
|
|
104
|
-
"@oxc-parser/binding-darwin-x64": "0.
|
|
105
|
-
"@oxc-parser/binding-darwin-arm64": "0.
|
|
106
|
-
"@oxc-parser/binding-android-arm64": "0.
|
|
107
|
-
"@oxc-parser/binding-wasm32-wasi": "0.
|
|
93
|
+
"@oxc-parser/binding-win32-x64-msvc": "0.81.0",
|
|
94
|
+
"@oxc-parser/binding-win32-arm64-msvc": "0.81.0",
|
|
95
|
+
"@oxc-parser/binding-linux-x64-gnu": "0.81.0",
|
|
96
|
+
"@oxc-parser/binding-linux-x64-musl": "0.81.0",
|
|
97
|
+
"@oxc-parser/binding-freebsd-x64": "0.81.0",
|
|
98
|
+
"@oxc-parser/binding-linux-arm64-gnu": "0.81.0",
|
|
99
|
+
"@oxc-parser/binding-linux-arm64-musl": "0.81.0",
|
|
100
|
+
"@oxc-parser/binding-linux-arm-gnueabihf": "0.81.0",
|
|
101
|
+
"@oxc-parser/binding-linux-arm-musleabihf": "0.81.0",
|
|
102
|
+
"@oxc-parser/binding-linux-s390x-gnu": "0.81.0",
|
|
103
|
+
"@oxc-parser/binding-linux-riscv64-gnu": "0.81.0",
|
|
104
|
+
"@oxc-parser/binding-darwin-x64": "0.81.0",
|
|
105
|
+
"@oxc-parser/binding-darwin-arm64": "0.81.0",
|
|
106
|
+
"@oxc-parser/binding-android-arm64": "0.81.0",
|
|
107
|
+
"@oxc-parser/binding-wasm32-wasi": "0.81.0"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"build-dev": "napi build --platform --js bindings.js",
|