@jspicl/core 4.0.0-alpha.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/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/ast/declarations/classDeclaration.d.ts +4 -0
- package/dist/ast/declarations/classDeclaration.d.ts.map +1 -0
- package/dist/ast/declarations/classDeclaration.js +8 -0
- package/dist/ast/declarations/classDeclaration.js.map +1 -0
- package/dist/ast/declarations/functionDeclaration.d.ts +3 -0
- package/dist/ast/declarations/functionDeclaration.d.ts.map +1 -0
- package/dist/ast/declarations/functionDeclaration.js +49 -0
- package/dist/ast/declarations/functionDeclaration.js.map +1 -0
- package/dist/ast/declarations/index.d.ts +5 -0
- package/dist/ast/declarations/index.d.ts.map +1 -0
- package/dist/ast/declarations/index.js +5 -0
- package/dist/ast/declarations/index.js.map +1 -0
- package/dist/ast/declarations/variableDeclaration.d.ts +4 -0
- package/dist/ast/declarations/variableDeclaration.d.ts.map +1 -0
- package/dist/ast/declarations/variableDeclaration.js +3 -0
- package/dist/ast/declarations/variableDeclaration.js.map +1 -0
- package/dist/ast/declarations/variableDeclarator.d.ts +4 -0
- package/dist/ast/declarations/variableDeclarator.d.ts.map +1 -0
- package/dist/ast/declarations/variableDeclarator.js +13 -0
- package/dist/ast/declarations/variableDeclarator.js.map +1 -0
- package/dist/ast/expressions/arrayExpression.d.ts +4 -0
- package/dist/ast/expressions/arrayExpression.d.ts.map +1 -0
- package/dist/ast/expressions/arrayExpression.js +5 -0
- package/dist/ast/expressions/arrayExpression.js.map +1 -0
- package/dist/ast/expressions/arrowFunctionExpression.d.ts +4 -0
- package/dist/ast/expressions/arrowFunctionExpression.d.ts.map +1 -0
- package/dist/ast/expressions/arrowFunctionExpression.js +29 -0
- package/dist/ast/expressions/arrowFunctionExpression.js.map +1 -0
- package/dist/ast/expressions/assignmentExpression.d.ts +4 -0
- package/dist/ast/expressions/assignmentExpression.d.ts.map +1 -0
- package/dist/ast/expressions/assignmentExpression.js +7 -0
- package/dist/ast/expressions/assignmentExpression.js.map +1 -0
- package/dist/ast/expressions/binaryExpression.d.ts +4 -0
- package/dist/ast/expressions/binaryExpression.d.ts.map +1 -0
- package/dist/ast/expressions/binaryExpression.js +20 -0
- package/dist/ast/expressions/binaryExpression.js.map +1 -0
- package/dist/ast/expressions/callExpression.d.ts +4 -0
- package/dist/ast/expressions/callExpression.d.ts.map +1 -0
- package/dist/ast/expressions/callExpression.js +14 -0
- package/dist/ast/expressions/callExpression.js.map +1 -0
- package/dist/ast/expressions/classBody.d.ts +4 -0
- package/dist/ast/expressions/classBody.d.ts.map +1 -0
- package/dist/ast/expressions/classBody.js +5 -0
- package/dist/ast/expressions/classBody.js.map +1 -0
- package/dist/ast/expressions/conditionalExpression.d.ts +4 -0
- package/dist/ast/expressions/conditionalExpression.d.ts.map +1 -0
- package/dist/ast/expressions/conditionalExpression.js +8 -0
- package/dist/ast/expressions/conditionalExpression.js.map +1 -0
- package/dist/ast/expressions/functionExpression.d.ts +4 -0
- package/dist/ast/expressions/functionExpression.d.ts.map +1 -0
- package/dist/ast/expressions/functionExpression.js +17 -0
- package/dist/ast/expressions/functionExpression.js.map +1 -0
- package/dist/ast/expressions/identifier.d.ts +4 -0
- package/dist/ast/expressions/identifier.d.ts.map +1 -0
- package/dist/ast/expressions/identifier.js +11 -0
- package/dist/ast/expressions/identifier.js.map +1 -0
- package/dist/ast/expressions/index.d.ts +21 -0
- package/dist/ast/expressions/index.d.ts.map +1 -0
- package/dist/ast/expressions/index.js +21 -0
- package/dist/ast/expressions/index.js.map +1 -0
- package/dist/ast/expressions/literal.d.ts +4 -0
- package/dist/ast/expressions/literal.d.ts.map +1 -0
- package/dist/ast/expressions/literal.js +11 -0
- package/dist/ast/expressions/literal.js.map +1 -0
- package/dist/ast/expressions/logicalExpression.d.ts +4 -0
- package/dist/ast/expressions/logicalExpression.d.ts.map +1 -0
- package/dist/ast/expressions/logicalExpression.js +9 -0
- package/dist/ast/expressions/logicalExpression.js.map +1 -0
- package/dist/ast/expressions/memberExpression.d.ts +4 -0
- package/dist/ast/expressions/memberExpression.d.ts.map +1 -0
- package/dist/ast/expressions/memberExpression.js +4 -0
- package/dist/ast/expressions/memberExpression.js.map +1 -0
- package/dist/ast/expressions/methodDefinition.d.ts +4 -0
- package/dist/ast/expressions/methodDefinition.d.ts.map +1 -0
- package/dist/ast/expressions/methodDefinition.js +3 -0
- package/dist/ast/expressions/methodDefinition.js.map +1 -0
- package/dist/ast/expressions/newExpression.d.ts +4 -0
- package/dist/ast/expressions/newExpression.d.ts.map +1 -0
- package/dist/ast/expressions/newExpression.js +7 -0
- package/dist/ast/expressions/newExpression.js.map +1 -0
- package/dist/ast/expressions/objectExpression.d.ts +4 -0
- package/dist/ast/expressions/objectExpression.d.ts.map +1 -0
- package/dist/ast/expressions/objectExpression.js +5 -0
- package/dist/ast/expressions/objectExpression.js.map +1 -0
- package/dist/ast/expressions/property.d.ts +4 -0
- package/dist/ast/expressions/property.d.ts.map +1 -0
- package/dist/ast/expressions/property.js +8 -0
- package/dist/ast/expressions/property.js.map +1 -0
- package/dist/ast/expressions/sequenceExpression.d.ts +4 -0
- package/dist/ast/expressions/sequenceExpression.d.ts.map +1 -0
- package/dist/ast/expressions/sequenceExpression.js +3 -0
- package/dist/ast/expressions/sequenceExpression.js.map +1 -0
- package/dist/ast/expressions/thisExpression.d.ts +4 -0
- package/dist/ast/expressions/thisExpression.d.ts.map +1 -0
- package/dist/ast/expressions/thisExpression.js +3 -0
- package/dist/ast/expressions/thisExpression.js.map +1 -0
- package/dist/ast/expressions/unaryExpression.d.ts +4 -0
- package/dist/ast/expressions/unaryExpression.d.ts.map +1 -0
- package/dist/ast/expressions/unaryExpression.js +10 -0
- package/dist/ast/expressions/unaryExpression.js.map +1 -0
- package/dist/ast/expressions/updateExpression.d.ts +4 -0
- package/dist/ast/expressions/updateExpression.d.ts.map +1 -0
- package/dist/ast/expressions/updateExpression.js +6 -0
- package/dist/ast/expressions/updateExpression.js.map +1 -0
- package/dist/ast/index.d.ts +4 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/index.js +4 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/ast/statements/blockStatement.d.ts +4 -0
- package/dist/ast/statements/blockStatement.d.ts.map +1 -0
- package/dist/ast/statements/blockStatement.js +4 -0
- package/dist/ast/statements/blockStatement.js.map +1 -0
- package/dist/ast/statements/breakStatement.d.ts +4 -0
- package/dist/ast/statements/breakStatement.d.ts.map +1 -0
- package/dist/ast/statements/breakStatement.js +3 -0
- package/dist/ast/statements/breakStatement.js.map +1 -0
- package/dist/ast/statements/doWhileStatement.d.ts +4 -0
- package/dist/ast/statements/doWhileStatement.d.ts.map +1 -0
- package/dist/ast/statements/doWhileStatement.js +5 -0
- package/dist/ast/statements/doWhileStatement.js.map +1 -0
- package/dist/ast/statements/emptyStatement.d.ts +4 -0
- package/dist/ast/statements/emptyStatement.d.ts.map +1 -0
- package/dist/ast/statements/emptyStatement.js +3 -0
- package/dist/ast/statements/emptyStatement.js.map +1 -0
- package/dist/ast/statements/expressionStatement.d.ts +4 -0
- package/dist/ast/statements/expressionStatement.d.ts.map +1 -0
- package/dist/ast/statements/expressionStatement.js +6 -0
- package/dist/ast/statements/expressionStatement.js.map +1 -0
- package/dist/ast/statements/forStatement.d.ts +4 -0
- package/dist/ast/statements/forStatement.d.ts.map +1 -0
- package/dist/ast/statements/forStatement.js +7 -0
- package/dist/ast/statements/forStatement.js.map +1 -0
- package/dist/ast/statements/ifStatement.d.ts +5 -0
- package/dist/ast/statements/ifStatement.d.ts.map +1 -0
- package/dist/ast/statements/ifStatement.js +18 -0
- package/dist/ast/statements/ifStatement.js.map +1 -0
- package/dist/ast/statements/index.d.ts +13 -0
- package/dist/ast/statements/index.d.ts.map +1 -0
- package/dist/ast/statements/index.js +13 -0
- package/dist/ast/statements/index.js.map +1 -0
- package/dist/ast/statements/returnStatement.d.ts +4 -0
- package/dist/ast/statements/returnStatement.d.ts.map +1 -0
- package/dist/ast/statements/returnStatement.js +6 -0
- package/dist/ast/statements/returnStatement.js.map +1 -0
- package/dist/ast/statements/switchCase.d.ts +4 -0
- package/dist/ast/statements/switchCase.d.ts.map +1 -0
- package/dist/ast/statements/switchCase.js +15 -0
- package/dist/ast/statements/switchCase.js.map +1 -0
- package/dist/ast/statements/switchStatement.d.ts +4 -0
- package/dist/ast/statements/switchStatement.d.ts.map +1 -0
- package/dist/ast/statements/switchStatement.js +13 -0
- package/dist/ast/statements/switchStatement.js.map +1 -0
- package/dist/ast/statements/throwStatement.d.ts +4 -0
- package/dist/ast/statements/throwStatement.d.ts.map +1 -0
- package/dist/ast/statements/throwStatement.js +9 -0
- package/dist/ast/statements/throwStatement.js.map +1 -0
- package/dist/ast/statements/whileStatement.d.ts +4 -0
- package/dist/ast/statements/whileStatement.d.ts.map +1 -0
- package/dist/ast/statements/whileStatement.js +5 -0
- package/dist/ast/statements/whileStatement.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/jspicl.d.ts +3 -0
- package/dist/jspicl.d.ts.map +1 -0
- package/dist/jspicl.js +24 -0
- package/dist/jspicl.js.map +1 -0
- package/dist/polyfills/constants.d.ts +3 -0
- package/dist/polyfills/constants.d.ts.map +1 -0
- package/dist/polyfills/constants.js +34 -0
- package/dist/polyfills/constants.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_assign.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_assign.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_assign.js +14 -0
- package/dist/polyfills/defaultImplementations/_assign.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_filter.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_filter.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_filter.js +13 -0
- package/dist/polyfills/defaultImplementations/_filter.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_findindex.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_findindex.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_findindex.js +8 -0
- package/dist/polyfills/defaultImplementations/_findindex.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_includes.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_includes.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_includes.js +12 -0
- package/dist/polyfills/defaultImplementations/_includes.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_join.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_join.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_join.js +16 -0
- package/dist/polyfills/defaultImplementations/_join.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_map.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_map.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_map.js +11 -0
- package/dist/polyfills/defaultImplementations/_map.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_objmap.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_objmap.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_objmap.js +23 -0
- package/dist/polyfills/defaultImplementations/_objmap.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_pop.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_pop.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_pop.js +7 -0
- package/dist/polyfills/defaultImplementations/_pop.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_reduce.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_reduce.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_reduce.js +17 -0
- package/dist/polyfills/defaultImplementations/_reduce.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_sort.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_sort.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_sort.js +23 -0
- package/dist/polyfills/defaultImplementations/_sort.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_split.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_split.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_split.js +27 -0
- package/dist/polyfills/defaultImplementations/_split.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_substr.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_substr.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_substr.js +5 -0
- package/dist/polyfills/defaultImplementations/_substr.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_substring.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_substring.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_substring.js +5 -0
- package/dist/polyfills/defaultImplementations/_substring.js.map +1 -0
- package/dist/polyfills/defaultImplementations/_tostring.d.ts +2 -0
- package/dist/polyfills/defaultImplementations/_tostring.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/_tostring.js +32 -0
- package/dist/polyfills/defaultImplementations/_tostring.js.map +1 -0
- package/dist/polyfills/defaultImplementations/index.d.ts +15 -0
- package/dist/polyfills/defaultImplementations/index.d.ts.map +1 -0
- package/dist/polyfills/defaultImplementations/index.js +15 -0
- package/dist/polyfills/defaultImplementations/index.js.map +1 -0
- package/dist/polyfills/getPolyfilledCallExpression.d.ts +9 -0
- package/dist/polyfills/getPolyfilledCallExpression.d.ts.map +1 -0
- package/dist/polyfills/getPolyfilledCallExpression.js +17 -0
- package/dist/polyfills/getPolyfilledCallExpression.js.map +1 -0
- package/dist/polyfills/getPolyfilledMemberExpression.d.ts +10 -0
- package/dist/polyfills/getPolyfilledMemberExpression.d.ts.map +1 -0
- package/dist/polyfills/getPolyfilledMemberExpression.js +13 -0
- package/dist/polyfills/getPolyfilledMemberExpression.js.map +1 -0
- package/dist/polyfills/getRequiredPolyfills.d.ts +2 -0
- package/dist/polyfills/getRequiredPolyfills.d.ts.map +1 -0
- package/dist/polyfills/getRequiredPolyfills.js +15 -0
- package/dist/polyfills/getRequiredPolyfills.js.map +1 -0
- package/dist/prettify.d.ts +2 -0
- package/dist/prettify.d.ts.map +1 -0
- package/dist/prettify.js +42 -0
- package/dist/prettify.js.map +1 -0
- package/dist/transpile.d.ts +3 -0
- package/dist/transpile.d.ts.map +1 -0
- package/dist/transpile.js +12 -0
- package/dist/transpile.js.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/assert.d.ts +2 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/assert.js +6 -0
- package/dist/utils/assert.js.map +1 -0
- package/dist/utils/declareVariable.d.ts +6 -0
- package/dist/utils/declareVariable.d.ts.map +1 -0
- package/dist/utils/declareVariable.js +33 -0
- package/dist/utils/declareVariable.js.map +1 -0
- package/dist/utils/normalizeName.d.ts +2 -0
- package/dist/utils/normalizeName.d.ts.map +1 -0
- package/dist/utils/normalizeName.js +4 -0
- package/dist/utils/normalizeName.js.map +1 -0
- package/dist/utils/wrapWithParantheses.d.ts +2 -0
- package/dist/utils/wrapWithParantheses.d.ts.map +1 -0
- package/dist/utils/wrapWithParantheses.js +4 -0
- package/dist/utils/wrapWithParantheses.js.map +1 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Agron Kabashi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# @jspicl/core
|
|
2
|
+
|
|
3
|
+
The core transpiler library for jspicl. Converts JavaScript to PICO-8 Lua.
|
|
4
|
+
|
|
5
|
+
<a href="https://www.npmjs.com/package/@jspicl/core" target="_blank" rel="noopener noreferrer">
|
|
6
|
+
<img alt="npm version" src="https://img.shields.io/npm/v/@jspicl/core.svg?style=for-the-badge" />
|
|
7
|
+
<img alt="License" src="https://img.shields.io/npm/l/@jspicl/core.svg?style=for-the-badge">
|
|
8
|
+
</a>
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @jspicl/core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import {jspicl} from "@jspicl/core";
|
|
20
|
+
|
|
21
|
+
const javascript = `
|
|
22
|
+
function _init() {
|
|
23
|
+
x = 64;
|
|
24
|
+
y = 64;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _update() {
|
|
28
|
+
if (btn(0)) x -= 1;
|
|
29
|
+
if (btn(1)) x += 1;
|
|
30
|
+
if (btn(2)) y -= 1;
|
|
31
|
+
if (btn(3)) y += 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _draw() {
|
|
35
|
+
cls();
|
|
36
|
+
circfill(x, y, 4, 8);
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const result = jspicl(javascript);
|
|
41
|
+
console.log(result.code);
|
|
42
|
+
// Output: Lua code ready for PICO-8
|
|
43
|
+
|
|
44
|
+
console.log(result.polyfills);
|
|
45
|
+
// Output: Any required polyfill implementations
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### `jspicl(source, options?)`
|
|
51
|
+
|
|
52
|
+
Transpiles JavaScript source code to PICO-8 Lua.
|
|
53
|
+
|
|
54
|
+
#### Parameters
|
|
55
|
+
|
|
56
|
+
- `source` (string) - The JavaScript source code to transpile
|
|
57
|
+
- `options` (object, optional)
|
|
58
|
+
- `prettify` (boolean, default: `true`) - Whether to format the output with proper indentation
|
|
59
|
+
- `customMappers` (object) - Custom AST node handlers to override or extend transpilation
|
|
60
|
+
|
|
61
|
+
#### Returns
|
|
62
|
+
|
|
63
|
+
An object containing:
|
|
64
|
+
- `code` (string) - The transpiled Lua code
|
|
65
|
+
- `polyfills` (object) - Map of required polyfill function names to their Lua implementations
|
|
66
|
+
|
|
67
|
+
### Types
|
|
68
|
+
|
|
69
|
+
Types can be imported from `@jspicl/core/types`:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import type {JspiclOptions, JspiclOutput, AstNodeParser} from "@jspicl/core/types";
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Custom Mappers
|
|
76
|
+
|
|
77
|
+
You can provide custom mappers to override how specific AST node types are transpiled:
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
import {jspicl} from "@jspicl/core";
|
|
81
|
+
|
|
82
|
+
const customMappers = {
|
|
83
|
+
Literal: ({raw}) => {
|
|
84
|
+
// Custom handling for literals
|
|
85
|
+
return raw === "null" ? "nil" : raw;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const result = jspicl(source, {customMappers});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Each mapper receives the AST node and an options object with:
|
|
93
|
+
- `transpile` - Function to recursively transpile child nodes
|
|
94
|
+
- `scope` - Object containing variable metadata and scope information
|
|
95
|
+
|
|
96
|
+
## Supported Polyfills
|
|
97
|
+
|
|
98
|
+
When your JavaScript uses methods without direct Lua equivalents, jspicl automatically detects and provides polyfill implementations:
|
|
99
|
+
|
|
100
|
+
- Array methods: `map`, `filter`, `reduce`, `includes`, `findIndex`, `join`, `pop`, `sort`
|
|
101
|
+
- String methods: `split`, `substr`, `substring`, `toString`
|
|
102
|
+
- Object methods: `Object.assign`, `Object.keys`, `Object.values`, `Object.entries`
|
|
103
|
+
|
|
104
|
+
The polyfills are returned separately so you can include them once at the top of your PICO-8 cartridge.
|
|
105
|
+
|
|
106
|
+
## Requirements
|
|
107
|
+
|
|
108
|
+
- Node.js 22+
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isClassDeclaration: (node?: ASTNode | null) => node is ClassDeclaration;
|
|
3
|
+
export declare const ClassDeclaration: AstNodeVisitor<ClassDeclaration>;
|
|
4
|
+
//# sourceMappingURL=classDeclaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classDeclaration.d.ts","sourceRoot":"","sources":["../../../src/ast/declarations/classDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,kBAAkB,GAC7B,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,gBAAqD,CAAC;AAEjE,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,CASxD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const isClassDeclaration = (node) => node?.type === "ClassDeclaration";
|
|
2
|
+
export const ClassDeclaration = ({ id, body }, { transpile }) => `local class_${transpile(id)} = function (...)
|
|
3
|
+
local this = {}
|
|
4
|
+
local classinstance = ${transpile(body)}
|
|
5
|
+
if (classinstance.constructor) classinstance.constructor(...)
|
|
6
|
+
return classinstance
|
|
7
|
+
end`;
|
|
8
|
+
//# sourceMappingURL=classDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classDeclaration.js","sourceRoot":"","sources":["../../../src/ast/declarations/classDeclaration.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,IAAqB,EACK,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,kBAAkB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAqC,CAChE,EAAC,EAAE,EAAE,IAAI,EAAC,EACV,EAAC,SAAS,EAAC,EACX,EAAE,CACF,eAAe,SAAS,CAAC,EAAE,CAAC;;4BAEF,SAAS,CAAC,IAAI,CAAC;;;MAGrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionDeclaration.d.ts","sourceRoot":"","sources":["../../../src/ast/declarations/functionDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAQnD,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,CAsEnE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { normalizeName } from "../../utils/normalizeName.js";
|
|
2
|
+
import { assert } from "../../utils/assert.js";
|
|
3
|
+
import { declareLocalVariablesForArrayPattern, declareLocalVariablesForObjectPattern, declareVariable } from "../../utils/declareVariable.js";
|
|
4
|
+
export const FunctionDeclaration = ({ id, body, params, async, generator }, { transpile, scope }) => {
|
|
5
|
+
assert(async === false, "Async functions are not supported.");
|
|
6
|
+
assert(generator === false, "Generator functions are not supported.");
|
|
7
|
+
const name = id?.name || "";
|
|
8
|
+
// Handle destructuring in parameters
|
|
9
|
+
const processedArguments = [];
|
|
10
|
+
const destructuringStatements = [];
|
|
11
|
+
// Process arguments that are destructured in the argument list
|
|
12
|
+
params.forEach((param, index) => {
|
|
13
|
+
if (param.type === "ObjectPattern" || param.type === "ArrayPattern") {
|
|
14
|
+
// Generate temporary parameter name
|
|
15
|
+
const tempParam = `__p${index}`;
|
|
16
|
+
processedArguments.push(tempParam);
|
|
17
|
+
// Generate destructuring statements for the function body
|
|
18
|
+
if (param.type === "ObjectPattern") {
|
|
19
|
+
destructuringStatements.push(declareLocalVariablesForObjectPattern(param, tempParam, scope, transpile));
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
destructuringStatements.push(declareLocalVariablesForArrayPattern(param, tempParam, scope, transpile));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (param.type === "AssignmentPattern") {
|
|
26
|
+
const variableName = normalizeName(transpile(param.left));
|
|
27
|
+
processedArguments.push(variableName);
|
|
28
|
+
destructuringStatements.push(declareVariable(variableName, `${variableName} or ${transpile(param.right)}`, scope));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
// Regular parameter
|
|
32
|
+
processedArguments.push(normalizeName(transpile(param)));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const argumentList = processedArguments.join(", ");
|
|
36
|
+
let functionContent = transpile(body);
|
|
37
|
+
// Prepend destructuring statements at the top of the function body
|
|
38
|
+
if (destructuringStatements.length > 0) {
|
|
39
|
+
const destructuringCode = destructuringStatements.join("\n");
|
|
40
|
+
functionContent = functionContent
|
|
41
|
+
? `${destructuringCode}\n${functionContent}`
|
|
42
|
+
: destructuringCode;
|
|
43
|
+
}
|
|
44
|
+
return `function ${normalizeName(name)}(${argumentList})
|
|
45
|
+
${functionContent}
|
|
46
|
+
end`;
|
|
47
|
+
};
|
|
48
|
+
FunctionDeclaration.scopeBoundary = true;
|
|
49
|
+
//# sourceMappingURL=functionDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionDeclaration.js","sourceRoot":"","sources":["../../../src/ast/declarations/functionDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EACL,oCAAoC,EACpC,qCAAqC,EACrC,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAAwC,CACtE,EAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAC,EACpC,EAAC,SAAS,EAAE,KAAK,EAAC,EAClB,EAAE;IACF,MAAM,CAAC,KAAK,KAAK,KAAK,EAAE,oCAAoC,CAAC,CAAC;IAC9D,MAAM,CAAC,SAAS,KAAK,KAAK,EAAE,wCAAwC,CAAC,CAAC;IAEtE,MAAM,IAAI,GAAG,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC;IAE5B,qCAAqC;IACrC,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,uBAAuB,GAAa,EAAE,CAAC;IAE7C,+DAA+D;IAC/D,MAAM,CAAC,OAAO,CAAC,CAAC,KAAwB,EAAE,KAAa,EAAE,EAAE;QACzD,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YACpE,oCAAoC;YACpC,MAAM,SAAS,GAAG,MAAM,KAAK,EAAE,CAAC;YAChC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAEnC,0DAA0D;YAC1D,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;gBACnC,uBAAuB,CAAC,IAAI,CAC1B,qCAAqC,CACnC,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,CACV,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,uBAAuB,CAAC,IAAI,CAC1B,oCAAoC,CAClC,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,CACV,CACF,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YAC9C,MAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YAC1D,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACtC,uBAAuB,CAAC,IAAI,CAC1B,eAAe,CACb,YAAY,EACZ,GAAG,YAAY,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAC9C,KAAK,CACN,CACF,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,oBAAoB;YACpB,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAEtC,mEAAmE;IACnE,IAAI,uBAAuB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,eAAe,GAAG,eAAe;YAC/B,CAAC,CAAC,GAAG,iBAAiB,KAAK,eAAe,EAAE;YAC5C,CAAC,CAAC,iBAAiB,CAAC;IACxB,CAAC;IAED,OAAO,YAAY,aAAa,CAAC,IAAI,CAAC,IAAI,YAAY;MAClD,eAAe;MACf,CAAC;AACP,CAAC,CAAC;AAEF,mBAAmB,CAAC,aAAa,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast/declarations/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ast/declarations/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isVariableDeclaration: (node?: ASTNode | null) => node is VariableDeclaration;
|
|
3
|
+
export declare const VariableDeclaration: AstNodeVisitor<VariableDeclaration>;
|
|
4
|
+
//# sourceMappingURL=variableDeclaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variableDeclaration.d.ts","sourceRoot":"","sources":["../../../src/ast/declarations/variableDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,GAChC,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,mBAA2D,CAAC;AAEvE,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,CAGxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variableDeclaration.js","sourceRoot":"","sources":["../../../src/ast/declarations/variableDeclaration.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAqB,EACQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,qBAAqB,CAAC;AAEvE,MAAM,CAAC,MAAM,mBAAmB,GAAwC,CACtE,EAAC,YAAY,EAAC,EACd,EAAC,SAAS,EAAC,EACX,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isVariableDeclarator: (node?: ASTNode | null) => node is VariableDeclarator;
|
|
3
|
+
export declare const VariableDeclarator: AstNodeVisitor<VariableDeclarator>;
|
|
4
|
+
//# sourceMappingURL=variableDeclarator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variableDeclarator.d.ts","sourceRoot":"","sources":["../../../src/ast/declarations/variableDeclarator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAO5D,eAAO,MAAM,oBAAoB,GAC/B,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,kBAAyD,CAAC;AAErE,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,CAyBjE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { declareLocalVariablesForArrayPattern, declareLocalVariablesForObjectPattern, declareVariable } from "../../utils/declareVariable.js";
|
|
2
|
+
export const isVariableDeclarator = (node) => node?.type === "VariableDeclarator";
|
|
3
|
+
export const VariableDeclarator = ({ id, init }, { scope, transpile }) => {
|
|
4
|
+
const initValue = transpile(init) || "nil";
|
|
5
|
+
if (id.type === "ArrayPattern") {
|
|
6
|
+
return declareLocalVariablesForArrayPattern(id, initValue, scope, transpile);
|
|
7
|
+
}
|
|
8
|
+
if (id.type === "ObjectPattern") {
|
|
9
|
+
return declareLocalVariablesForObjectPattern(id, initValue, scope, transpile);
|
|
10
|
+
}
|
|
11
|
+
return declareVariable(id.name, initValue, scope);
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=variableDeclarator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variableDeclarator.js","sourceRoot":"","sources":["../../../src/ast/declarations/variableDeclarator.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oCAAoC,EACpC,qCAAqC,EACrC,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAqB,EACO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,oBAAoB,CAAC;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAuC,CACpE,EAAC,EAAE,EAAE,IAAI,EAAC,EACV,EAAC,KAAK,EAAE,SAAS,EAAC,EAClB,EAAE;IACF,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;IAE3C,IAAI,EAAE,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QAC/B,OAAO,oCAAoC,CACzC,EAAE,EACF,SAAS,EACT,KAAK,EACL,SAAS,CACV,CAAC;IACJ,CAAC;IAED,IAAI,EAAE,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QAChC,OAAO,qCAAqC,CAC1C,EAAE,EACF,SAAS,EACT,KAAK,EACL,SAAS,CACV,CAAC;IACJ,CAAC;IAED,OAAO,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isArrayExpression: (node?: ASTNode | null) => node is ArrayExpression;
|
|
3
|
+
export declare const ArrayExpression: AstNodeVisitor<ArrayExpression>;
|
|
4
|
+
//# sourceMappingURL=arrayExpression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/arrayExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,iBAAiB,GAC5B,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,eAAmD,CAAC;AAE/D,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,eAAe,CAMxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/arrayExpression.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAqB,EACI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,iBAAiB,CAAC;AAE/D,MAAM,CAAC,MAAM,eAAe,GAAoC,CAC9D,EAAC,QAAQ,EAAC,EACV,EAAC,SAAS,EAAC,EACX,EAAE,CACF;MACI,SAAS,CAAC,QAAQ,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC;IAC7C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isArrowFunctionExpression: (node?: ASTNode | null) => node is ArrowFunctionExpression;
|
|
3
|
+
export declare const ArrowFunctionExpression: AstNodeVisitor<ArrowFunctionExpression>;
|
|
4
|
+
//# sourceMappingURL=arrowFunctionExpression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrowFunctionExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/arrowFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAI5D,eAAO,MAAM,yBAAyB,GACpC,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,uBAAmE,CAAC;AAE/E,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAClD,uBAAuB,CA8BxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { assert } from "../../utils/assert.js";
|
|
2
|
+
import { FunctionDeclaration } from "../declarations/functionDeclaration.js";
|
|
3
|
+
export const isArrowFunctionExpression = (node) => node?.type === "ArrowFunctionExpression";
|
|
4
|
+
export const ArrowFunctionExpression = (node, options) => {
|
|
5
|
+
assert(!node.async, "Async arrow functions are not supported.");
|
|
6
|
+
assert(!node.generator, "Generator arrow functions are not supported.");
|
|
7
|
+
const body = node.body.type !== "BlockStatement"
|
|
8
|
+
? {
|
|
9
|
+
type: "BlockStatement",
|
|
10
|
+
body: [
|
|
11
|
+
{
|
|
12
|
+
type: "ReturnStatement",
|
|
13
|
+
argument: node.body
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
: node.body;
|
|
18
|
+
return FunctionDeclaration({
|
|
19
|
+
id: node.id,
|
|
20
|
+
params: node.params,
|
|
21
|
+
body,
|
|
22
|
+
async: false,
|
|
23
|
+
generator: false,
|
|
24
|
+
expression: false,
|
|
25
|
+
type: "FunctionDeclaration"
|
|
26
|
+
}, options);
|
|
27
|
+
};
|
|
28
|
+
ArrowFunctionExpression.scopeBoundary = true;
|
|
29
|
+
//# sourceMappingURL=arrowFunctionExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrowFunctionExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/arrowFunctionExpression.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,wCAAwC,CAAC;AAE3E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,IAAqB,EACY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,yBAAyB,CAAC;AAE/E,MAAM,CAAC,MAAM,uBAAuB,GAEhC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IACpB,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAAC;IAChE,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,8CAA8C,CAAC,CAAC;IAExE,MAAM,IAAI,GACR,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAgB;QACjC,CAAC,CAAC;YACE,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE;gBACJ;oBACE,IAAI,EAAE,iBAAiB;oBACvB,QAAQ,EAAE,IAAI,CAAC,IAAI;iBACpB;aACF;SACF;QACH,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAEhB,OAAO,mBAAmB,CACxB;QACE,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,IAAI;QACJ,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,qBAAqB;KAC5B,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,uBAAuB,CAAC,aAAa,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isAssignmentExpression: (node?: ASTNode | null) => node is AssignmentExpression;
|
|
3
|
+
export declare const AssignmentExpression: AstNodeVisitor<AssignmentExpression>;
|
|
4
|
+
//# sourceMappingURL=assignmentExpression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignmentExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/assignmentExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,sBAAsB,GACjC,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,oBAA6D,CAAC;AAEzE,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,oBAAoB,CAQrE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const isAssignmentExpression = (node) => node?.type === "AssignmentExpression";
|
|
2
|
+
export const AssignmentExpression = ({ operator, left, right }, { transpile }) => {
|
|
3
|
+
const leftExpression = transpile(left);
|
|
4
|
+
const rightExpression = transpile(right);
|
|
5
|
+
return `${leftExpression}${operator}${rightExpression}`;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=assignmentExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignmentExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/assignmentExpression.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,IAAqB,EACS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,sBAAsB,CAAC;AAEzE,MAAM,CAAC,MAAM,oBAAoB,GAAyC,CACxE,EAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,EACvB,EAAC,SAAS,EAAC,EACX,EAAE;IACF,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEzC,OAAO,GAAG,cAAc,GAAG,QAAQ,GAAG,eAAe,EAAE,CAAC;AAC1D,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isBinaryExpression: (node?: ASTNode | null) => node is BinaryExpression;
|
|
3
|
+
export declare const BinaryExpression: AstNodeVisitor<BinaryExpression>;
|
|
4
|
+
//# sourceMappingURL=binaryExpression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binaryExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/binaryExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,kBAAkB,GAC7B,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,gBAAqD,CAAC;AAOjE,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,CAmB7D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const isBinaryExpression = (node) => node?.type === "BinaryExpression";
|
|
2
|
+
const operatorTable = {
|
|
3
|
+
"!==": "!=",
|
|
4
|
+
"===": "=="
|
|
5
|
+
};
|
|
6
|
+
export const BinaryExpression = ({ operator, left, right }, { transpile }) => {
|
|
7
|
+
let leftExpression = transpile(left);
|
|
8
|
+
let rightExpression = transpile(right);
|
|
9
|
+
const luaOperator = operatorTable[operator] || operator;
|
|
10
|
+
if (luaOperator === "*" || luaOperator === "/" || luaOperator === "%") {
|
|
11
|
+
if (left.type === "BinaryExpression") {
|
|
12
|
+
leftExpression = `(${leftExpression})`;
|
|
13
|
+
}
|
|
14
|
+
if (right.type === "BinaryExpression") {
|
|
15
|
+
rightExpression = `(${rightExpression})`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return `${leftExpression} ${luaOperator} ${rightExpression}`;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=binaryExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binaryExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/binaryExpression.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,IAAqB,EACK,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,kBAAkB,CAAC;AAEjE,MAAM,aAAa,GAA2B;IAC5C,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAqC,CAChE,EAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,EACvB,EAAC,SAAS,EAAC,EACX,EAAE;IACF,IAAI,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;IAExD,IAAI,WAAW,KAAK,GAAG,IAAI,WAAW,KAAK,GAAG,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;QACtE,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACrC,cAAc,GAAG,IAAI,cAAc,GAAG,CAAC;QACzC,CAAC;QAED,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACtC,eAAe,GAAG,IAAI,eAAe,GAAG,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO,GAAG,cAAc,IAAI,WAAW,IAAI,eAAe,EAAE,CAAC;AAC/D,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/callExpression.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,GAC3B,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,cAAiD,CAAC;AAE7D,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,cAAc,CAiBzD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getPolyfilledCallExpression } from "../../polyfills/getPolyfilledCallExpression.js";
|
|
2
|
+
import { wrapWithParantheses } from "../../utils/wrapWithParantheses.js";
|
|
3
|
+
export const isCallExpression = (node) => node?.type === "CallExpression";
|
|
4
|
+
export const CallExpression = ({ callee, arguments: args }, { transpile }) => {
|
|
5
|
+
const argumentList = transpile(args, { arraySeparator: ", " });
|
|
6
|
+
// Is it a function inside an object?
|
|
7
|
+
if (callee.object) {
|
|
8
|
+
return getPolyfilledCallExpression({ transpile, callee, argumentList });
|
|
9
|
+
}
|
|
10
|
+
// Regular function call
|
|
11
|
+
const calleeExpression = wrapWithParantheses(callee.type === "FunctionExpression", transpile(callee));
|
|
12
|
+
return `${calleeExpression}(${argumentList})`;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=callExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/callExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,2BAA2B,EAAC,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAC,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AAGvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,IAAqB,EACG,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,cAAc,GAAmC,CAC5D,EAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,EACzB,EAAC,SAAS,EAAC,EACX,EAAE;IACF,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,EAAE,EAAC,cAAc,EAAE,IAAI,EAAC,CAAC,CAAC;IAE7D,qCAAqC;IACrC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,2BAA2B,CAAC,EAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAC,CAAC,CAAC;IACxE,CAAC;IAED,wBAAwB;IACxB,MAAM,gBAAgB,GAAG,mBAAmB,CAC1C,MAAM,CAAC,IAAI,KAAK,oBAAoB,EACpC,SAAS,CAAC,MAAM,CAAC,CAClB,CAAC;IACF,OAAO,GAAG,gBAAgB,IAAI,YAAY,GAAG,CAAC;AAChD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classBody.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/classBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,GAAG,IAAI,KAAG,IAAI,IAAI,SAChC,CAAC;AAE7B,eAAO,MAAM,SAAS,EAAE,cAAc,CAAC,SAAS,CAG5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classBody.js","sourceRoot":"","sources":["../../../src/ast/expressions/classBody.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAqB,EAAqB,EAAE,CACtE,IAAI,EAAE,IAAI,KAAK,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,SAAS,GAA8B,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,SAAS,EAAC,EAAE,EAAE,CAC1E;MACI,SAAS,CAAC,IAAI,EAAE,EAAC,cAAc,EAAE,KAAK,EAAC,CAAC;IAC1C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isConditionalExpression: (node?: ASTNode | null) => node is ConditionalExpression;
|
|
3
|
+
export declare const ConditionalExpression: AstNodeVisitor<ConditionalExpression>;
|
|
4
|
+
//# sourceMappingURL=conditionalExpression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/conditionalExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,GAClC,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,qBAA+D,CAAC;AAE3E,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,qBAAqB,CASvE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const isConditionalExpression = (node) => node?.type === "ConditionalExpression";
|
|
2
|
+
export const ConditionalExpression = ({ test, consequent, alternate }, { transpile }) => {
|
|
3
|
+
const testExpression = transpile(test);
|
|
4
|
+
const consequentPath = transpile(consequent);
|
|
5
|
+
const alternatePath = transpile(alternate);
|
|
6
|
+
return `(function () if ${testExpression} then return ${consequentPath} else return ${alternatePath} end end)()`;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=conditionalExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/conditionalExpression.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,IAAqB,EACU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,uBAAuB,CAAC;AAE3E,MAAM,CAAC,MAAM,qBAAqB,GAA0C,CAC1E,EAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAC,EAC7B,EAAC,SAAS,EAAC,EACX,EAAE;IACF,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAE3C,OAAO,mBAAmB,cAAc,gBAAgB,cAAc,gBAAgB,aAAa,aAAa,CAAC;AACnH,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ASTNode, AstNodeVisitor } from "../../types.js";
|
|
2
|
+
export declare const isFunctionExpression: (node?: ASTNode | null) => node is FunctionExpression;
|
|
3
|
+
export declare const FunctionExpression: AstNodeVisitor<FunctionExpression>;
|
|
4
|
+
//# sourceMappingURL=functionExpression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionExpression.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/functionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAI5D,eAAO,MAAM,oBAAoB,GAC/B,OAAO,OAAO,GAAG,IAAI,KACpB,IAAI,IAAI,kBAAyD,CAAC;AAErE,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,CAkBjE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { assert } from "../../utils/assert.js";
|
|
2
|
+
import { FunctionDeclaration } from "../declarations/functionDeclaration.js";
|
|
3
|
+
export const isFunctionExpression = (node) => node?.type === "FunctionExpression";
|
|
4
|
+
export const FunctionExpression = (node, options) => {
|
|
5
|
+
assert(!node.async, "Async arrow functions are not supported.");
|
|
6
|
+
assert(!node.generator, "Generator arrow functions are not supported.");
|
|
7
|
+
return FunctionDeclaration({
|
|
8
|
+
id: null,
|
|
9
|
+
params: node.params,
|
|
10
|
+
body: node.body,
|
|
11
|
+
async: node.async,
|
|
12
|
+
generator: node.generator,
|
|
13
|
+
type: "FunctionDeclaration"
|
|
14
|
+
}, options);
|
|
15
|
+
};
|
|
16
|
+
FunctionExpression.scopeBoundary = true;
|
|
17
|
+
//# sourceMappingURL=functionExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionExpression.js","sourceRoot":"","sources":["../../../src/ast/expressions/functionExpression.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,mBAAmB,EAAC,MAAM,wCAAwC,CAAC;AAE3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAqB,EACO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,oBAAoB,CAAC;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAuC,CACpE,IAAI,EACJ,OAAO,EACP,EAAE;IACF,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAAC;IAChE,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,8CAA8C,CAAC,CAAC;IAExE,OAAO,mBAAmB,CACxB;QACE,EAAE,EAAE,IAAI;QACR,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,IAAI,EAAE,qBAAqB;KAC5B,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAkB,CAAC,aAAa,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/identifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,GAAG,IAAI,KAAG,IAAI,IAAI,UAChC,CAAC;AAM9B,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,UAAU,CAOjD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { normalizeName } from "../../utils/normalizeName.js";
|
|
2
|
+
export const isIdentifier = (node) => node?.type === "Identifier";
|
|
3
|
+
const specialCases = {
|
|
4
|
+
undefined: "nil"
|
|
5
|
+
};
|
|
6
|
+
export const Identifier = ({ name }) => {
|
|
7
|
+
const identifier = normalizeName(name);
|
|
8
|
+
return ((specialCases.hasOwnProperty(identifier) && specialCases[identifier]) ||
|
|
9
|
+
identifier);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../src/ast/expressions/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAG3D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAqB,EAAsB,EAAE,CACxE,IAAI,EAAE,IAAI,KAAK,YAAY,CAAC;AAE9B,MAAM,YAAY,GAA2B;IAC3C,SAAS,EAAE,KAAK;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAA+B,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE;IAC/D,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,CACL,CAAC,YAAY,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;QACrE,UAAU,CACX,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from "./arrayExpression.js";
|
|
2
|
+
export * from "./arrowFunctionExpression.js";
|
|
3
|
+
export * from "./assignmentExpression.js";
|
|
4
|
+
export * from "./binaryExpression.js";
|
|
5
|
+
export * from "./callExpression.js";
|
|
6
|
+
export * from "./classBody.js";
|
|
7
|
+
export * from "./conditionalExpression.js";
|
|
8
|
+
export * from "./functionExpression.js";
|
|
9
|
+
export * from "./identifier.js";
|
|
10
|
+
export * from "./literal.js";
|
|
11
|
+
export * from "./logicalExpression.js";
|
|
12
|
+
export * from "./memberExpression.js";
|
|
13
|
+
export * from "./methodDefinition.js";
|
|
14
|
+
export * from "./newExpression.js";
|
|
15
|
+
export * from "./objectExpression.js";
|
|
16
|
+
export * from "./property.js";
|
|
17
|
+
export * from "./sequenceExpression.js";
|
|
18
|
+
export * from "./thisExpression.js";
|
|
19
|
+
export * from "./unaryExpression.js";
|
|
20
|
+
export * from "./updateExpression.js";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast/expressions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from "./arrayExpression.js";
|
|
2
|
+
export * from "./arrowFunctionExpression.js";
|
|
3
|
+
export * from "./assignmentExpression.js";
|
|
4
|
+
export * from "./binaryExpression.js";
|
|
5
|
+
export * from "./callExpression.js";
|
|
6
|
+
export * from "./classBody.js";
|
|
7
|
+
export * from "./conditionalExpression.js";
|
|
8
|
+
export * from "./functionExpression.js";
|
|
9
|
+
export * from "./identifier.js";
|
|
10
|
+
export * from "./literal.js";
|
|
11
|
+
export * from "./logicalExpression.js";
|
|
12
|
+
export * from "./memberExpression.js";
|
|
13
|
+
export * from "./methodDefinition.js";
|
|
14
|
+
export * from "./newExpression.js";
|
|
15
|
+
export * from "./objectExpression.js";
|
|
16
|
+
export * from "./property.js";
|
|
17
|
+
export * from "./sequenceExpression.js";
|
|
18
|
+
export * from "./thisExpression.js";
|
|
19
|
+
export * from "./unaryExpression.js";
|
|
20
|
+
export * from "./updateExpression.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ast/expressions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|