|
1 | 1 | // Auto-generated code, DO NOT EDIT DIRECTLY! |
2 | 2 | // To edit this generated file you have to edit `tasks/ast_tools/src/generators/raw_transfer.rs`. |
3 | 3 |
|
4 | | -let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen; |
| 4 | +let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen, preserveParens; |
5 | 5 |
|
6 | 6 | const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }), |
7 | 7 | decodeStr = textDecoder.decode.bind(textDecoder), |
8 | 8 | { fromCodePoint } = String; |
9 | 9 |
|
10 | | -export function deserialize(buffer, sourceTextInput, sourceByteLenInput) { |
| 10 | +export function deserialize(buffer, sourceTextInput, sourceByteLenInput, preserveParensInput) { |
11 | 11 | uint8 = buffer; |
12 | 12 | uint32 = buffer.uint32; |
13 | 13 | float64 = buffer.float64; |
14 | 14 |
|
15 | 15 | sourceText = sourceTextInput; |
16 | 16 | sourceByteLen = sourceByteLenInput; |
17 | 17 | sourceIsAscii = sourceText.length === sourceByteLen; |
| 18 | + preserveParens = preserveParensInput; |
18 | 19 |
|
19 | 20 | const data = deserializeRawTransferData(uint32[536870902]); |
20 | 21 |
|
@@ -438,12 +439,16 @@ function deserializeChainExpression(pos) { |
438 | 439 | } |
439 | 440 |
|
440 | 441 | function deserializeParenthesizedExpression(pos) { |
441 | | - return { |
442 | | - type: 'ParenthesizedExpression', |
443 | | - expression: deserializeExpression(pos + 8), |
444 | | - start: deserializeU32(pos), |
445 | | - end: deserializeU32(pos + 4), |
446 | | - }; |
| 442 | + let node = deserializeExpression(pos + 8); |
| 443 | + if (preserveParens) { |
| 444 | + node = { |
| 445 | + type: 'ParenthesizedExpression', |
| 446 | + expression: node, |
| 447 | + start: deserializeU32(pos), |
| 448 | + end: deserializeU32(pos + 4), |
| 449 | + }; |
| 450 | + } |
| 451 | + return node; |
447 | 452 | } |
448 | 453 |
|
449 | 454 | function deserializeDirective(pos) { |
|
0 commit comments