oxc-parser 0.72.3 → 0.73.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 +4 -146
- package/generated/deserialize/lazy.js +13853 -0
- package/generated/deserialize/ts.js +4 -146
- package/index.js +11 -288
- package/package.json +26 -21
- package/raw-transfer/eager.js +56 -0
- package/raw-transfer/index.js +283 -0
- package/raw-transfer/lazy.js +87 -0
|
@@ -13,8 +13,8 @@ const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }),
|
|
|
13
13
|
|
|
14
14
|
function deserialize(buffer, sourceTextInput, sourceLenInput) {
|
|
15
15
|
uint8 = buffer;
|
|
16
|
-
uint32 =
|
|
17
|
-
float64 =
|
|
16
|
+
uint32 = buffer.uint32;
|
|
17
|
+
float64 = buffer.float64;
|
|
18
18
|
|
|
19
19
|
sourceText = sourceTextInput;
|
|
20
20
|
sourceLen = sourceLenInput;
|
|
@@ -1078,14 +1078,13 @@ function deserializeStringLiteral(pos) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
|
|
1080
1080
|
function deserializeBigIntLiteral(pos) {
|
|
1081
|
-
const
|
|
1082
|
-
bigint = raw.slice(0, -1).replace(/_/g, '');
|
|
1081
|
+
const bigint = deserializeStr(pos + 8);
|
|
1083
1082
|
return {
|
|
1084
1083
|
type: 'Literal',
|
|
1085
1084
|
start: deserializeU32(pos),
|
|
1086
1085
|
end: deserializeU32(pos + 4),
|
|
1087
1086
|
value: BigInt(bigint),
|
|
1088
|
-
raw,
|
|
1087
|
+
raw: deserializeOptionStr(pos + 24),
|
|
1089
1088
|
bigint,
|
|
1090
1089
|
};
|
|
1091
1090
|
}
|
|
@@ -4092,11 +4091,6 @@ function deserializeVecStatement(pos) {
|
|
|
4092
4091
|
return arr;
|
|
4093
4092
|
}
|
|
4094
4093
|
|
|
4095
|
-
function deserializeOptionScopeId(pos) {
|
|
4096
|
-
if (uint32[pos >> 2] === 0) return null;
|
|
4097
|
-
return deserializeScopeId(pos);
|
|
4098
|
-
}
|
|
4099
|
-
|
|
4100
4094
|
function deserializeBoxBooleanLiteral(pos) {
|
|
4101
4095
|
return deserializeBooleanLiteral(uint32[pos >> 2]);
|
|
4102
4096
|
}
|
|
@@ -4257,16 +4251,6 @@ function deserializeBoxV8IntrinsicExpression(pos) {
|
|
|
4257
4251
|
return deserializeV8IntrinsicExpression(uint32[pos >> 2]);
|
|
4258
4252
|
}
|
|
4259
4253
|
|
|
4260
|
-
function deserializeOptionReferenceId(pos) {
|
|
4261
|
-
if (uint32[pos >> 2] === 0) return null;
|
|
4262
|
-
return deserializeReferenceId(pos);
|
|
4263
|
-
}
|
|
4264
|
-
|
|
4265
|
-
function deserializeOptionSymbolId(pos) {
|
|
4266
|
-
if (uint32[pos >> 2] === 0) return null;
|
|
4267
|
-
return deserializeSymbolId(pos);
|
|
4268
|
-
}
|
|
4269
|
-
|
|
4270
4254
|
function deserializeVecArrayExpressionElement(pos) {
|
|
4271
4255
|
const arr = [],
|
|
4272
4256
|
pos32 = pos >> 2,
|
|
@@ -4872,15 +4856,6 @@ function deserializeF64(pos) {
|
|
|
4872
4856
|
return float64[pos >> 3];
|
|
4873
4857
|
}
|
|
4874
4858
|
|
|
4875
|
-
function deserializeBoxPattern(pos) {
|
|
4876
|
-
return deserializePattern(uint32[pos >> 2]);
|
|
4877
|
-
}
|
|
4878
|
-
|
|
4879
|
-
function deserializeOptionBoxPattern(pos) {
|
|
4880
|
-
if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
|
|
4881
|
-
return deserializeBoxPattern(pos);
|
|
4882
|
-
}
|
|
4883
|
-
|
|
4884
4859
|
function deserializeU8(pos) {
|
|
4885
4860
|
return uint8[pos];
|
|
4886
4861
|
}
|
|
@@ -5269,74 +5244,6 @@ function deserializeOptionNameSpan(pos) {
|
|
|
5269
5244
|
return deserializeNameSpan(pos);
|
|
5270
5245
|
}
|
|
5271
5246
|
|
|
5272
|
-
function deserializeVecAlternative(pos) {
|
|
5273
|
-
const arr = [],
|
|
5274
|
-
pos32 = pos >> 2,
|
|
5275
|
-
len = uint32[pos32 + 2];
|
|
5276
|
-
pos = uint32[pos32];
|
|
5277
|
-
for (let i = 0; i < len; i++) {
|
|
5278
|
-
arr.push(deserializeAlternative(pos));
|
|
5279
|
-
pos += 32;
|
|
5280
|
-
}
|
|
5281
|
-
return arr;
|
|
5282
|
-
}
|
|
5283
|
-
|
|
5284
|
-
function deserializeVecTerm(pos) {
|
|
5285
|
-
const arr = [],
|
|
5286
|
-
pos32 = pos >> 2,
|
|
5287
|
-
len = uint32[pos32 + 2];
|
|
5288
|
-
pos = uint32[pos32];
|
|
5289
|
-
for (let i = 0; i < len; i++) {
|
|
5290
|
-
arr.push(deserializeTerm(pos));
|
|
5291
|
-
pos += 16;
|
|
5292
|
-
}
|
|
5293
|
-
return arr;
|
|
5294
|
-
}
|
|
5295
|
-
|
|
5296
|
-
function deserializeBoxBoundaryAssertion(pos) {
|
|
5297
|
-
return deserializeBoundaryAssertion(uint32[pos >> 2]);
|
|
5298
|
-
}
|
|
5299
|
-
|
|
5300
|
-
function deserializeBoxLookAroundAssertion(pos) {
|
|
5301
|
-
return deserializeLookAroundAssertion(uint32[pos >> 2]);
|
|
5302
|
-
}
|
|
5303
|
-
|
|
5304
|
-
function deserializeBoxQuantifier(pos) {
|
|
5305
|
-
return deserializeQuantifier(uint32[pos >> 2]);
|
|
5306
|
-
}
|
|
5307
|
-
|
|
5308
|
-
function deserializeBoxCharacter(pos) {
|
|
5309
|
-
return deserializeCharacter(uint32[pos >> 2]);
|
|
5310
|
-
}
|
|
5311
|
-
|
|
5312
|
-
function deserializeBoxCharacterClassEscape(pos) {
|
|
5313
|
-
return deserializeCharacterClassEscape(uint32[pos >> 2]);
|
|
5314
|
-
}
|
|
5315
|
-
|
|
5316
|
-
function deserializeBoxUnicodePropertyEscape(pos) {
|
|
5317
|
-
return deserializeUnicodePropertyEscape(uint32[pos >> 2]);
|
|
5318
|
-
}
|
|
5319
|
-
|
|
5320
|
-
function deserializeBoxCharacterClass(pos) {
|
|
5321
|
-
return deserializeCharacterClass(uint32[pos >> 2]);
|
|
5322
|
-
}
|
|
5323
|
-
|
|
5324
|
-
function deserializeBoxCapturingGroup(pos) {
|
|
5325
|
-
return deserializeCapturingGroup(uint32[pos >> 2]);
|
|
5326
|
-
}
|
|
5327
|
-
|
|
5328
|
-
function deserializeBoxIgnoreGroup(pos) {
|
|
5329
|
-
return deserializeIgnoreGroup(uint32[pos >> 2]);
|
|
5330
|
-
}
|
|
5331
|
-
|
|
5332
|
-
function deserializeBoxIndexedReference(pos) {
|
|
5333
|
-
return deserializeIndexedReference(uint32[pos >> 2]);
|
|
5334
|
-
}
|
|
5335
|
-
|
|
5336
|
-
function deserializeBoxNamedReference(pos) {
|
|
5337
|
-
return deserializeNamedReference(uint32[pos >> 2]);
|
|
5338
|
-
}
|
|
5339
|
-
|
|
5340
5247
|
function deserializeU64(pos) {
|
|
5341
5248
|
const pos32 = pos >> 2;
|
|
5342
5249
|
return uint32[pos32] + uint32[pos32 + 1] * 4294967296;
|
|
@@ -5347,55 +5254,6 @@ function deserializeOptionU64(pos) {
|
|
|
5347
5254
|
return deserializeU64(pos + 8);
|
|
5348
5255
|
}
|
|
5349
5256
|
|
|
5350
|
-
function deserializeVecCharacterClassContents(pos) {
|
|
5351
|
-
const arr = [],
|
|
5352
|
-
pos32 = pos >> 2,
|
|
5353
|
-
len = uint32[pos32 + 2];
|
|
5354
|
-
pos = uint32[pos32];
|
|
5355
|
-
for (let i = 0; i < len; i++) {
|
|
5356
|
-
arr.push(deserializeCharacterClassContents(pos));
|
|
5357
|
-
pos += 16;
|
|
5358
|
-
}
|
|
5359
|
-
return arr;
|
|
5360
|
-
}
|
|
5361
|
-
|
|
5362
|
-
function deserializeBoxCharacterClassRange(pos) {
|
|
5363
|
-
return deserializeCharacterClassRange(uint32[pos >> 2]);
|
|
5364
|
-
}
|
|
5365
|
-
|
|
5366
|
-
function deserializeBoxClassStringDisjunction(pos) {
|
|
5367
|
-
return deserializeClassStringDisjunction(uint32[pos >> 2]);
|
|
5368
|
-
}
|
|
5369
|
-
|
|
5370
|
-
function deserializeVecClassString(pos) {
|
|
5371
|
-
const arr = [],
|
|
5372
|
-
pos32 = pos >> 2,
|
|
5373
|
-
len = uint32[pos32 + 2];
|
|
5374
|
-
pos = uint32[pos32];
|
|
5375
|
-
for (let i = 0; i < len; i++) {
|
|
5376
|
-
arr.push(deserializeClassString(pos));
|
|
5377
|
-
pos += 40;
|
|
5378
|
-
}
|
|
5379
|
-
return arr;
|
|
5380
|
-
}
|
|
5381
|
-
|
|
5382
|
-
function deserializeVecCharacter(pos) {
|
|
5383
|
-
const arr = [],
|
|
5384
|
-
pos32 = pos >> 2,
|
|
5385
|
-
len = uint32[pos32 + 2];
|
|
5386
|
-
pos = uint32[pos32];
|
|
5387
|
-
for (let i = 0; i < len; i++) {
|
|
5388
|
-
arr.push(deserializeCharacter(pos));
|
|
5389
|
-
pos += 16;
|
|
5390
|
-
}
|
|
5391
|
-
return arr;
|
|
5392
|
-
}
|
|
5393
|
-
|
|
5394
|
-
function deserializeOptionModifiers(pos) {
|
|
5395
|
-
if (uint8[pos] === 0) return null;
|
|
5396
|
-
return deserializeModifiers(pos + 8);
|
|
5397
|
-
}
|
|
5398
|
-
|
|
5399
5257
|
function deserializeVecError(pos) {
|
|
5400
5258
|
const arr = [],
|
|
5401
5259
|
pos32 = pos >> 2,
|