@ibyar/expressions 0.5.2 → 0.5.4
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/README.md +3 -3
- package/api/abstract.d.ts +3 -4
- package/api/abstract.js +1 -1
- package/api/abstract.js.map +1 -1
- package/api/class/class.d.ts +196 -0
- package/api/class/class.js +594 -0
- package/api/class/class.js.map +1 -0
- package/api/class/decorator.d.ts +20 -0
- package/api/class/decorator.js +48 -0
- package/api/class/decorator.js.map +1 -0
- package/api/computing/call.d.ts +3 -1
- package/api/computing/call.js +16 -4
- package/api/computing/call.js.map +1 -1
- package/api/computing/new.d.ts +2 -1
- package/api/computing/new.js +4 -0
- package/api/computing/new.js.map +1 -1
- package/api/computing/rest.d.ts +3 -3
- package/api/computing/rest.js +5 -2
- package/api/computing/rest.js.map +1 -1
- package/api/computing/return.d.ts +2 -1
- package/api/computing/return.js +3 -0
- package/api/computing/return.js.map +1 -1
- package/api/computing/spread.d.ts +2 -1
- package/api/computing/spread.js +5 -2
- package/api/computing/spread.js.map +1 -1
- package/api/computing/throw.d.ts +2 -1
- package/api/computing/throw.js +3 -0
- package/api/computing/throw.js.map +1 -1
- package/api/computing/yield.d.ts +2 -1
- package/api/computing/yield.js +3 -0
- package/api/computing/yield.js.map +1 -1
- package/api/definition/array.d.ts +6 -7
- package/api/definition/array.js +13 -13
- package/api/definition/array.js.map +1 -1
- package/api/definition/bind.d.ts +2 -2
- package/api/definition/bind.js +1 -1
- package/api/definition/bind.js.map +1 -1
- package/api/definition/function.d.ts +8 -8
- package/api/definition/function.js +25 -25
- package/api/definition/function.js.map +1 -1
- package/api/definition/member.d.ts +2 -2
- package/api/definition/member.js +1 -1
- package/api/definition/member.js.map +1 -1
- package/api/definition/object.d.ts +7 -7
- package/api/definition/object.js +9 -9
- package/api/definition/object.js.map +1 -1
- package/api/definition/statement.d.ts +2 -2
- package/api/definition/statement.js +2 -2
- package/api/definition/statement.js.map +1 -1
- package/api/definition/values.d.ts +5 -4
- package/api/definition/values.js +7 -4
- package/api/definition/values.js.map +1 -1
- package/api/expression.d.ts +9 -12
- package/api/expression.js.map +1 -1
- package/api/{app → module/app}/program.d.ts +8 -9
- package/api/module/app/program.js +45 -0
- package/api/module/app/program.js.map +1 -0
- package/api/module/export.d.ts +60 -25
- package/api/module/export.js +230 -60
- package/api/module/export.js.map +1 -1
- package/api/module/import.d.ts +66 -25
- package/api/module/import.js +236 -68
- package/api/module/import.js.map +1 -1
- package/api/operators/assignment.d.ts +2 -2
- package/api/operators/assignment.js +1 -1
- package/api/operators/assignment.js.map +1 -1
- package/api/operators/await.d.ts +2 -2
- package/api/operators/await.js +1 -1
- package/api/operators/await.js.map +1 -1
- package/api/operators/binary.d.ts +2 -2
- package/api/operators/binary.js +1 -1
- package/api/operators/binary.js.map +1 -1
- package/api/operators/chaining.d.ts +2 -2
- package/api/operators/chaining.js +1 -1
- package/api/operators/chaining.js.map +1 -1
- package/api/operators/comma.d.ts +2 -2
- package/api/operators/comma.js +2 -2
- package/api/operators/comma.js.map +1 -1
- package/api/operators/grouping.d.ts +2 -2
- package/api/operators/grouping.js +1 -1
- package/api/operators/grouping.js.map +1 -1
- package/api/operators/logical.d.ts +2 -2
- package/api/operators/logical.js +1 -1
- package/api/operators/logical.js.map +1 -1
- package/api/operators/pipeline.d.ts +2 -2
- package/api/operators/pipeline.js +1 -1
- package/api/operators/pipeline.js.map +1 -1
- package/api/operators/ternary.d.ts +2 -2
- package/api/operators/ternary.js +1 -1
- package/api/operators/ternary.js.map +1 -1
- package/api/operators/unary.d.ts +3 -3
- package/api/operators/unary.js +4 -3
- package/api/operators/unary.js.map +1 -1
- package/api/operators/update.d.ts +2 -2
- package/api/operators/update.js +1 -1
- package/api/operators/update.js.map +1 -1
- package/api/statement/control/block.d.ts +3 -3
- package/api/statement/control/block.js +2 -2
- package/api/statement/control/block.js.map +1 -1
- package/api/statement/control/empty.d.ts +1 -1
- package/api/statement/control/empty.js.map +1 -1
- package/api/statement/control/if.d.ts +2 -2
- package/api/statement/control/if.js +1 -1
- package/api/statement/control/if.js.map +1 -1
- package/api/statement/control/switch.d.ts +4 -5
- package/api/statement/control/switch.js +5 -6
- package/api/statement/control/switch.js.map +1 -1
- package/api/statement/control/terminate.d.ts +3 -3
- package/api/statement/control/terminate.js +2 -2
- package/api/statement/control/terminate.js.map +1 -1
- package/api/statement/declarations/declares.d.ts +12 -11
- package/api/statement/declarations/declares.js +23 -18
- package/api/statement/declarations/declares.js.map +1 -1
- package/api/statement/iterations/for.d.ts +5 -5
- package/api/statement/iterations/for.js +7 -7
- package/api/statement/iterations/for.js.map +1 -1
- package/api/statement/iterations/while.d.ts +3 -3
- package/api/statement/iterations/while.js +2 -2
- package/api/statement/iterations/while.js.map +1 -1
- package/api/utils.d.ts +3 -0
- package/api/utils.js +2 -0
- package/api/utils.js.map +1 -0
- package/package.json +4 -4
- package/scope/finalizer.d.ts +4 -0
- package/scope/finalizer.js +11 -0
- package/scope/finalizer.js.map +1 -0
- package/scope/proxy.d.ts +2 -1
- package/scope/proxy.js +18 -2
- package/scope/proxy.js.map +1 -1
- package/scope/scope.d.ts +40 -51
- package/scope/scope.js +67 -134
- package/scope/scope.js.map +1 -1
- package/scope/stack.d.ts +41 -24
- package/scope/stack.js +148 -102
- package/scope/stack.js.map +1 -1
- package/v8/parser.js +3 -2
- package/v8/parser.js.map +1 -1
- package/visit/visitor.js +4 -7
- package/visit/visitor.js.map +1 -1
- package/api/app/class.d.ts +0 -117
- package/api/app/class.js +0 -292
- package/api/app/class.js.map +0 -1
- package/api/app/program.js +0 -39
- package/api/app/program.js.map +0 -1
- package/api/module/module.d.ts +0 -26
- package/api/module/module.js +0 -63
- package/api/module/module.js.map +0 -1
package/visit/visitor.js
CHANGED
|
@@ -14,14 +14,11 @@ export class ExpressionVisitor {
|
|
|
14
14
|
};
|
|
15
15
|
const visitNode = (expression) => {
|
|
16
16
|
visitorCallback(expression, this.getType(expression), control);
|
|
17
|
-
this.visitExpressionNode(expression, visitNode
|
|
18
|
-
};
|
|
19
|
-
const visitNodeList = (expressions) => {
|
|
20
|
-
expressions.forEach(visitNode);
|
|
17
|
+
this.visitExpressionNode(expression, visitNode);
|
|
21
18
|
};
|
|
22
19
|
try {
|
|
23
20
|
visitorCallback(node, this.getType(node), control);
|
|
24
|
-
this.visitExpressionNode(node, visitNode
|
|
21
|
+
this.visitExpressionNode(node, visitNode);
|
|
25
22
|
}
|
|
26
23
|
catch (abort) {
|
|
27
24
|
if (!(abort instanceof AbortException)) {
|
|
@@ -29,13 +26,13 @@ export class ExpressionVisitor {
|
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
|
-
visitExpressionNode(node, visitNode
|
|
29
|
+
visitExpressionNode(node, visitNode) {
|
|
33
30
|
const classType = expressionTypes.get(this.getType(node));
|
|
34
31
|
const visit = classType.visit;
|
|
35
32
|
if (!visit) {
|
|
36
33
|
return;
|
|
37
34
|
}
|
|
38
|
-
visit(node, visitNode
|
|
35
|
+
visit(node, visitNode);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
export const expressionVisitor = new ExpressionVisitor();
|
package/visit/visitor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitor.js","sourceRoot":"","sources":["../../../src/expressions/visit/visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAclE,CAAC;AAEF,MAAM,cAAe,SAAQ,KAAK;CAEjC;AAID,MAAM,OAAO,iBAAiB;IAErB,OAAO,CAAC,IAAoB;QACnC,OAAQ,IAAI,CAAC,WAAsD,CAAC,IAAI,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,IAAoB,EAAE,eAAgC;QAC3D,MAAM,OAAO,GAAmB;YAC/B,KAAK;gBACJ,MAAM,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;YACvC,CAAC;SACD,CAAC;QACF,MAAM,SAAS,GAAkB,CAAC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GAAG,SAAS,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,KAAK,EAAE;YACX,OAAO;SACP;QACD,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACxB,CAAC;CAED;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC","sourcesContent":["import { expressionTypes } from '../api/deserialize/type-store.js';\nimport { ExpressionNode, NodeExpressionWithType, VisitNodeType } from '../api/expression.js';\n\nexport interface VisitorControl {\n\n\t/**\n\t * terminate the traversal\n\t */\n\tabort(): void;\n\n\t// /**\n\t// * indicate that the traversal need not continue any further down this subtree.\n\t// */\n\t// traverse(): void;\n};\n\nclass AbortException extends Error {\n\n}\n\nexport type VisitorCallback = (expression: ExpressionNode, type: string, control: VisitorControl) => void;\n\nexport class ExpressionVisitor {\n\n\tprivate getType(node: ExpressionNode): string {\n\t\treturn (node.constructor as NodeExpressionWithType<ExpressionNode>).type;\n\t}\n\n\tvisit(node: ExpressionNode, visitorCallback: VisitorCallback): void {\n\t\tconst control: VisitorControl = {\n\t\t\tabort() {\n\t\t\t\tthrow new AbortException('terminate');\n\t\t\t}\n\t\t};\n\t\tconst visitNode: VisitNodeType = (expression) => {\n\t\t\tvisitorCallback(expression, this.getType(expression), control);\n\t\t\tthis.visitExpressionNode(expression, visitNode);\n\t\t};\n\t\ttry {\n\t\t\tvisitorCallback(node, this.getType(node), control);\n\t\t\tthis.visitExpressionNode(node, visitNode);\n\t\t} catch (abort) {\n\t\t\tif (!(abort instanceof AbortException)) {\n\t\t\t\tthrow abort;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate visitExpressionNode(node: ExpressionNode, visitNode: VisitNodeType): void {\n\t\tconst classType = expressionTypes.get(this.getType(node))!;\n\t\tconst visit = classType.visit;\n\t\tif (!visit) {\n\t\t\treturn;\n\t\t}\n\t\tvisit(node, visitNode);\n\t}\n\n}\n\nexport const expressionVisitor = new ExpressionVisitor();\n"]}
|
package/api/app/class.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { CanDeclareExpression, ExpressionEventPath, ExpressionNode, NodeDeserializer } from '../expression.js';
|
|
2
|
-
import type { Stack } from '../../scope/stack.js';
|
|
3
|
-
import type { Scope, ScopeType } from '../../scope/scope.js';
|
|
4
|
-
import { AbstractExpressionNode } from '../abstract.js';
|
|
5
|
-
import { Identifier } from '../definition/values.js';
|
|
6
|
-
import { MemberExpression } from '../definition/member.js';
|
|
7
|
-
import { FunctionExpression } from '../definition/function.js';
|
|
8
|
-
export declare class MetaProperty extends MemberExpression {
|
|
9
|
-
private meta;
|
|
10
|
-
static NewTarget: MetaProperty;
|
|
11
|
-
static ImportMeta: MetaProperty;
|
|
12
|
-
private static getJsonName;
|
|
13
|
-
static fromJSON(node: MetaProperty, deserializer: NodeDeserializer<any>): MetaProperty;
|
|
14
|
-
constructor(meta: Identifier, property: Identifier);
|
|
15
|
-
getMeta(): Identifier;
|
|
16
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
17
|
-
toString(): string;
|
|
18
|
-
toJson(): {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare class PrivateIdentifier extends Identifier {
|
|
23
|
-
private privateName;
|
|
24
|
-
static fromJSON(node: PrivateIdentifier): PrivateIdentifier;
|
|
25
|
-
constructor(privateName: string);
|
|
26
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
27
|
-
toString(): string;
|
|
28
|
-
toJson(): {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export declare type MethodDefinitionKind = 'constructor' | 'method' | 'set' | 'get';
|
|
33
|
-
export declare class MethodDefinition extends AbstractExpressionNode implements CanDeclareExpression {
|
|
34
|
-
private kind;
|
|
35
|
-
private key;
|
|
36
|
-
private value;
|
|
37
|
-
private computed;
|
|
38
|
-
static fromJSON(node: MethodDefinition, deserializer: NodeDeserializer<any>): MethodDefinition;
|
|
39
|
-
private 'static';
|
|
40
|
-
constructor(kind: MethodDefinitionKind, key: ExpressionNode | PrivateIdentifier, value: FunctionExpression, computed: boolean, isStatic: boolean);
|
|
41
|
-
getKind(): MethodDefinitionKind;
|
|
42
|
-
getKey(): ExpressionNode | PrivateIdentifier;
|
|
43
|
-
getValue(): FunctionExpression;
|
|
44
|
-
isComputed(): boolean;
|
|
45
|
-
isStatic(): boolean;
|
|
46
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
47
|
-
set(stack: Stack, value: any): void;
|
|
48
|
-
get(stack: Stack, thisContext?: any): void;
|
|
49
|
-
declareVariable(stack: Stack, scopeType: ScopeType, propertyValue?: any): void;
|
|
50
|
-
dependency(computed?: true): ExpressionNode[];
|
|
51
|
-
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
52
|
-
toString(): string;
|
|
53
|
-
toJson(): {
|
|
54
|
-
[key: string]: any;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export declare class PropertyDefinition extends AbstractExpressionNode implements CanDeclareExpression {
|
|
58
|
-
private key;
|
|
59
|
-
private computed;
|
|
60
|
-
private value?;
|
|
61
|
-
static fromJSON(node: PropertyDefinition, deserializer: NodeDeserializer<any>): PropertyDefinition;
|
|
62
|
-
private 'static';
|
|
63
|
-
constructor(key: ExpressionNode | PrivateIdentifier, computed: boolean, isStatic: boolean, value?: ExpressionNode | undefined);
|
|
64
|
-
getKey(): ExpressionNode | PrivateIdentifier;
|
|
65
|
-
getValue(): ExpressionNode | undefined;
|
|
66
|
-
isComputed(): boolean;
|
|
67
|
-
isStatic(): boolean;
|
|
68
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
69
|
-
set(stack: Stack, value: any): void;
|
|
70
|
-
get(stack: Stack, thisContext?: any): void;
|
|
71
|
-
declareVariable(stack: Stack, scopeType: ScopeType, propertyValue?: any): void;
|
|
72
|
-
dependency(computed?: true): ExpressionNode[];
|
|
73
|
-
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
74
|
-
toString(): string;
|
|
75
|
-
toJson(): {
|
|
76
|
-
[key: string]: any;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
export declare class ClassBody extends AbstractExpressionNode {
|
|
80
|
-
private body;
|
|
81
|
-
static fromJSON(node: ClassBody, deserializer: NodeDeserializer<any>): ClassBody;
|
|
82
|
-
constructor(body: (MethodDefinition | PropertyDefinition)[]);
|
|
83
|
-
getBody(): (MethodDefinition | PropertyDefinition)[];
|
|
84
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
85
|
-
set(stack: Stack, value: any): void;
|
|
86
|
-
get(stack: Stack, thisContext?: any): void;
|
|
87
|
-
dependency(computed?: true): ExpressionNode[];
|
|
88
|
-
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
89
|
-
toString(): string;
|
|
90
|
-
toJson(): {
|
|
91
|
-
[key: string]: any;
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
export declare class Class extends AbstractExpressionNode {
|
|
95
|
-
protected body: ClassBody;
|
|
96
|
-
protected id?: Identifier | undefined;
|
|
97
|
-
protected superClass?: ExpressionNode | undefined;
|
|
98
|
-
constructor(body: ClassBody, id?: Identifier | undefined, superClass?: ExpressionNode | undefined);
|
|
99
|
-
getBody(): ClassBody;
|
|
100
|
-
getId(): Identifier | undefined;
|
|
101
|
-
getSuperClass(): ExpressionNode | undefined;
|
|
102
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
103
|
-
set(stack: Stack): void;
|
|
104
|
-
get(stack: Stack): void;
|
|
105
|
-
dependency(computed?: true): ExpressionNode[];
|
|
106
|
-
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
107
|
-
toString(): string;
|
|
108
|
-
toJson(): object;
|
|
109
|
-
}
|
|
110
|
-
export declare class ClassDeclaration extends Class implements CanDeclareExpression {
|
|
111
|
-
static fromJSON(node: ClassDeclaration, deserializer: NodeDeserializer<any>): ClassDeclaration;
|
|
112
|
-
protected id: Identifier;
|
|
113
|
-
declareVariable(stack: Stack, scopeType: ScopeType, propertyValue?: any): void;
|
|
114
|
-
}
|
|
115
|
-
export declare class ClassExpression extends Class {
|
|
116
|
-
static fromJSON(node: ClassExpression, deserializer: NodeDeserializer<any>): ClassExpression;
|
|
117
|
-
}
|
package/api/app/class.js
DELETED
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
var MetaProperty_1, PrivateIdentifier_1, MethodDefinition_1, PropertyDefinition_1, ClassBody_1, ClassDeclaration_1, ClassExpression_1;
|
|
2
|
-
import { __decorate, __metadata } from "tslib";
|
|
3
|
-
import { AbstractExpressionNode } from '../abstract.js';
|
|
4
|
-
import { Deserializer } from '../deserialize/deserialize.js';
|
|
5
|
-
import { Identifier } from '../definition/values.js';
|
|
6
|
-
import { MemberExpression } from '../definition/member.js';
|
|
7
|
-
import { FunctionExpression } from '../definition/function.js';
|
|
8
|
-
let MetaProperty = MetaProperty_1 = class MetaProperty extends MemberExpression {
|
|
9
|
-
constructor(meta, property) {
|
|
10
|
-
super(meta, property, false);
|
|
11
|
-
this.meta = meta;
|
|
12
|
-
}
|
|
13
|
-
static getJsonName(identifier) {
|
|
14
|
-
return Reflect.get(identifier, 'name');
|
|
15
|
-
}
|
|
16
|
-
static fromJSON(node, deserializer) {
|
|
17
|
-
if (MetaProperty_1.getJsonName(node.meta) === 'new' && MetaProperty_1.getJsonName(node.property) === 'target') {
|
|
18
|
-
return MetaProperty_1.NewTarget;
|
|
19
|
-
}
|
|
20
|
-
else if (MetaProperty_1.getJsonName(node.meta) === 'new' && MetaProperty_1.getJsonName(node.property) === 'meta') {
|
|
21
|
-
return MetaProperty_1.ImportMeta;
|
|
22
|
-
}
|
|
23
|
-
return new MetaProperty_1(deserializer(node.meta), deserializer(node.property));
|
|
24
|
-
}
|
|
25
|
-
getMeta() {
|
|
26
|
-
return this.meta;
|
|
27
|
-
}
|
|
28
|
-
shareVariables(scopeList) { }
|
|
29
|
-
toString() {
|
|
30
|
-
return `${this.meta.toString()}.${this.property.toString()}`;
|
|
31
|
-
}
|
|
32
|
-
toJson() {
|
|
33
|
-
return {
|
|
34
|
-
meta: this.meta.toJSON(),
|
|
35
|
-
property: this.property.toJSON(),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
MetaProperty.NewTarget = new MetaProperty_1(new Identifier('new'), new Identifier('target'));
|
|
40
|
-
MetaProperty.ImportMeta = new MetaProperty_1(new Identifier('import'), new Identifier('meta'));
|
|
41
|
-
MetaProperty = MetaProperty_1 = __decorate([
|
|
42
|
-
Deserializer('MetaProperty'),
|
|
43
|
-
__metadata("design:paramtypes", [Identifier, Identifier])
|
|
44
|
-
], MetaProperty);
|
|
45
|
-
export { MetaProperty };
|
|
46
|
-
let PrivateIdentifier = PrivateIdentifier_1 = class PrivateIdentifier extends Identifier {
|
|
47
|
-
constructor(privateName) {
|
|
48
|
-
super('ɵ_' + privateName);
|
|
49
|
-
this.privateName = privateName;
|
|
50
|
-
}
|
|
51
|
-
static fromJSON(node) {
|
|
52
|
-
return new PrivateIdentifier_1(node.name);
|
|
53
|
-
}
|
|
54
|
-
shareVariables(scopeList) { }
|
|
55
|
-
toString() {
|
|
56
|
-
return `#${this.privateName}`;
|
|
57
|
-
}
|
|
58
|
-
toJson() {
|
|
59
|
-
return {
|
|
60
|
-
name: this.privateName
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
PrivateIdentifier = PrivateIdentifier_1 = __decorate([
|
|
65
|
-
Deserializer('PrivateIdentifier'),
|
|
66
|
-
__metadata("design:paramtypes", [String])
|
|
67
|
-
], PrivateIdentifier);
|
|
68
|
-
export { PrivateIdentifier };
|
|
69
|
-
let MethodDefinition = MethodDefinition_1 = class MethodDefinition extends AbstractExpressionNode {
|
|
70
|
-
constructor(kind, key, value, computed, isStatic) {
|
|
71
|
-
super();
|
|
72
|
-
this.kind = kind;
|
|
73
|
-
this.key = key;
|
|
74
|
-
this.value = value;
|
|
75
|
-
this.computed = computed;
|
|
76
|
-
this.static = isStatic;
|
|
77
|
-
}
|
|
78
|
-
static fromJSON(node, deserializer) {
|
|
79
|
-
return new MethodDefinition_1(node.kind, deserializer(node.key), deserializer(node.value), node.computed, node.static);
|
|
80
|
-
}
|
|
81
|
-
getKind() {
|
|
82
|
-
return this.kind;
|
|
83
|
-
}
|
|
84
|
-
getKey() {
|
|
85
|
-
return this.key;
|
|
86
|
-
}
|
|
87
|
-
getValue() {
|
|
88
|
-
return this.value;
|
|
89
|
-
}
|
|
90
|
-
isComputed() {
|
|
91
|
-
return this.computed;
|
|
92
|
-
}
|
|
93
|
-
isStatic() {
|
|
94
|
-
return this.static;
|
|
95
|
-
}
|
|
96
|
-
shareVariables(scopeList) { }
|
|
97
|
-
set(stack, value) {
|
|
98
|
-
throw new Error('Method not implemented.');
|
|
99
|
-
}
|
|
100
|
-
get(stack, thisContext) {
|
|
101
|
-
throw new Error('Method not implemented.');
|
|
102
|
-
}
|
|
103
|
-
declareVariable(stack, scopeType, propertyValue) {
|
|
104
|
-
throw new Error('Method not implemented.');
|
|
105
|
-
}
|
|
106
|
-
dependency(computed) {
|
|
107
|
-
throw new Error('Method not implemented.');
|
|
108
|
-
}
|
|
109
|
-
dependencyPath(computed) {
|
|
110
|
-
throw new Error('Method not implemented.');
|
|
111
|
-
}
|
|
112
|
-
toString() {
|
|
113
|
-
throw new Error('Method not implemented.');
|
|
114
|
-
}
|
|
115
|
-
toJson() {
|
|
116
|
-
return {
|
|
117
|
-
kind: this.kind,
|
|
118
|
-
key: this.key,
|
|
119
|
-
value: this.value,
|
|
120
|
-
computed: this.computed,
|
|
121
|
-
static: this.static,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
MethodDefinition = MethodDefinition_1 = __decorate([
|
|
126
|
-
Deserializer('MethodDefinition'),
|
|
127
|
-
__metadata("design:paramtypes", [String, Object, FunctionExpression, Boolean, Boolean])
|
|
128
|
-
], MethodDefinition);
|
|
129
|
-
export { MethodDefinition };
|
|
130
|
-
let PropertyDefinition = PropertyDefinition_1 = class PropertyDefinition extends AbstractExpressionNode {
|
|
131
|
-
constructor(key, computed, isStatic, value) {
|
|
132
|
-
super();
|
|
133
|
-
this.key = key;
|
|
134
|
-
this.computed = computed;
|
|
135
|
-
this.value = value;
|
|
136
|
-
this.static = isStatic;
|
|
137
|
-
}
|
|
138
|
-
static fromJSON(node, deserializer) {
|
|
139
|
-
return new PropertyDefinition_1(deserializer(node.key), node.computed, node.static, node.value && deserializer(node.value));
|
|
140
|
-
}
|
|
141
|
-
getKey() {
|
|
142
|
-
return this.key;
|
|
143
|
-
}
|
|
144
|
-
getValue() {
|
|
145
|
-
return this.value;
|
|
146
|
-
}
|
|
147
|
-
isComputed() {
|
|
148
|
-
return this.computed;
|
|
149
|
-
}
|
|
150
|
-
isStatic() {
|
|
151
|
-
return this.static;
|
|
152
|
-
}
|
|
153
|
-
shareVariables(scopeList) { }
|
|
154
|
-
set(stack, value) {
|
|
155
|
-
throw new Error('Method not implemented.');
|
|
156
|
-
}
|
|
157
|
-
get(stack, thisContext) {
|
|
158
|
-
throw new Error('Method not implemented.');
|
|
159
|
-
}
|
|
160
|
-
declareVariable(stack, scopeType, propertyValue) {
|
|
161
|
-
throw new Error('Method not implemented.');
|
|
162
|
-
}
|
|
163
|
-
dependency(computed) {
|
|
164
|
-
throw new Error('Method not implemented.');
|
|
165
|
-
}
|
|
166
|
-
dependencyPath(computed) {
|
|
167
|
-
throw new Error('Method not implemented.');
|
|
168
|
-
}
|
|
169
|
-
toString() {
|
|
170
|
-
throw new Error('Method not implemented.');
|
|
171
|
-
}
|
|
172
|
-
toJson() {
|
|
173
|
-
return {
|
|
174
|
-
key: this.key.toJSON(),
|
|
175
|
-
computed: this.computed,
|
|
176
|
-
static: this.static,
|
|
177
|
-
value: this.value?.toJSON()
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
PropertyDefinition = PropertyDefinition_1 = __decorate([
|
|
182
|
-
Deserializer('PropertyDefinition'),
|
|
183
|
-
__metadata("design:paramtypes", [Object, Boolean, Boolean, Object])
|
|
184
|
-
], PropertyDefinition);
|
|
185
|
-
export { PropertyDefinition };
|
|
186
|
-
let ClassBody = ClassBody_1 = class ClassBody extends AbstractExpressionNode {
|
|
187
|
-
constructor(body) {
|
|
188
|
-
super();
|
|
189
|
-
this.body = body;
|
|
190
|
-
}
|
|
191
|
-
static fromJSON(node, deserializer) {
|
|
192
|
-
return new ClassBody_1(node.body.map(deserializer));
|
|
193
|
-
}
|
|
194
|
-
getBody() {
|
|
195
|
-
return this.body;
|
|
196
|
-
}
|
|
197
|
-
shareVariables(scopeList) { }
|
|
198
|
-
set(stack, value) {
|
|
199
|
-
throw new Error('Method not implemented.');
|
|
200
|
-
}
|
|
201
|
-
get(stack, thisContext) {
|
|
202
|
-
throw new Error('Method not implemented.');
|
|
203
|
-
}
|
|
204
|
-
dependency(computed) {
|
|
205
|
-
throw new Error('Method not implemented.');
|
|
206
|
-
}
|
|
207
|
-
dependencyPath(computed) {
|
|
208
|
-
throw new Error('Method not implemented.');
|
|
209
|
-
}
|
|
210
|
-
toString() {
|
|
211
|
-
throw new Error('Method not implemented.');
|
|
212
|
-
}
|
|
213
|
-
toJson() {
|
|
214
|
-
return {
|
|
215
|
-
body: this.body.map(method => method.toJSON())
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
ClassBody = ClassBody_1 = __decorate([
|
|
220
|
-
Deserializer('ClassBody'),
|
|
221
|
-
__metadata("design:paramtypes", [Array])
|
|
222
|
-
], ClassBody);
|
|
223
|
-
export { ClassBody };
|
|
224
|
-
export class Class extends AbstractExpressionNode {
|
|
225
|
-
constructor(body, id, superClass) {
|
|
226
|
-
super();
|
|
227
|
-
this.body = body;
|
|
228
|
-
this.id = id;
|
|
229
|
-
this.superClass = superClass;
|
|
230
|
-
}
|
|
231
|
-
getBody() {
|
|
232
|
-
return this.body;
|
|
233
|
-
}
|
|
234
|
-
getId() {
|
|
235
|
-
return this.id;
|
|
236
|
-
}
|
|
237
|
-
getSuperClass() {
|
|
238
|
-
return this.superClass;
|
|
239
|
-
}
|
|
240
|
-
shareVariables(scopeList) { }
|
|
241
|
-
set(stack) {
|
|
242
|
-
throw new Error(`Class.#set() has no implementation.`);
|
|
243
|
-
}
|
|
244
|
-
get(stack) {
|
|
245
|
-
throw new Error(`Class.#get() has no implementation.`);
|
|
246
|
-
}
|
|
247
|
-
dependency(computed) {
|
|
248
|
-
throw new Error('Method not implemented.');
|
|
249
|
-
}
|
|
250
|
-
dependencyPath(computed) {
|
|
251
|
-
throw new Error('Method not implemented.');
|
|
252
|
-
}
|
|
253
|
-
toString() {
|
|
254
|
-
let classDeclaration = 'class ';
|
|
255
|
-
if (this.id) {
|
|
256
|
-
classDeclaration += this.id.toString();
|
|
257
|
-
}
|
|
258
|
-
if (this.superClass) {
|
|
259
|
-
classDeclaration += ' extends ' + this.superClass.toString();
|
|
260
|
-
}
|
|
261
|
-
return `${classDeclaration} {${this.body.toString()}\n`;
|
|
262
|
-
}
|
|
263
|
-
toJson() {
|
|
264
|
-
return {
|
|
265
|
-
body: this.body.toJSON(),
|
|
266
|
-
id: this.id?.toJSON(),
|
|
267
|
-
superClass: this.superClass?.toJSON(),
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
let ClassDeclaration = ClassDeclaration_1 = class ClassDeclaration extends Class {
|
|
272
|
-
static fromJSON(node, deserializer) {
|
|
273
|
-
return new ClassDeclaration_1(deserializer(node.body), deserializer(node.id), node.superClass && deserializer(node.superClass));
|
|
274
|
-
}
|
|
275
|
-
declareVariable(stack, scopeType, propertyValue) {
|
|
276
|
-
stack.declareVariable(scopeType, this.id.getName(), propertyValue);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
ClassDeclaration = ClassDeclaration_1 = __decorate([
|
|
280
|
-
Deserializer('ClassDeclaration')
|
|
281
|
-
], ClassDeclaration);
|
|
282
|
-
export { ClassDeclaration };
|
|
283
|
-
let ClassExpression = ClassExpression_1 = class ClassExpression extends Class {
|
|
284
|
-
static fromJSON(node, deserializer) {
|
|
285
|
-
return new ClassExpression_1(deserializer(node.body), node.id && deserializer(node.id), node.superClass && deserializer(node.superClass));
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
ClassExpression = ClassExpression_1 = __decorate([
|
|
289
|
-
Deserializer('ClassExpression')
|
|
290
|
-
], ClassExpression);
|
|
291
|
-
export { ClassExpression };
|
|
292
|
-
//# sourceMappingURL=class.js.map
|
package/api/app/class.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../src/expressions/api/app/class.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAW/D,IAAa,YAAY,oBAAzB,MAAa,YAAa,SAAQ,gBAAgB;IAsBjD,YAAoB,IAAgB,EAAE,QAAoB;QACzD,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QADV,SAAI,GAAJ,IAAI,CAAY;IAEpC,CAAC;IAlBO,MAAM,CAAC,WAAW,CAAC,UAA0B;QACpD,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAkB,EAAE,YAAmC;QACtE,IAAI,cAAY,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,cAAY,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAA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AiB,CAAC;GACnB,eAAe,CAQ3B;SARY,eAAe","sourcesContent":["import type {\n\tCanDeclareExpression, ExpressionEventPath,\n\tExpressionNode, NodeDeserializer\n} from '../expression.js';\nimport type { Stack } from '../../scope/stack.js';\nimport type { Scope, ScopeType } from '../../scope/scope.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { Identifier } from '../definition/values.js';\nimport { MemberExpression } from '../definition/member.js';\nimport { FunctionExpression } from '../definition/function.js';\n\n\n/**\n * MetaProperty node represents\n * - `new.target` meta property in ES2015.\n * - `import.meta` meta property in ES2030.\n * \n * In the future, it will represent other meta properties as well.\n */\n@Deserializer('MetaProperty')\nexport class MetaProperty extends MemberExpression {\n\n\tpublic static NewTarget = new MetaProperty(new Identifier('new'), new Identifier('target'));\n\n\tpublic static ImportMeta = new MetaProperty(new Identifier('import'), new Identifier('meta'));\n\n\tprivate static getJsonName(identifier: ExpressionNode): string {\n\t\treturn Reflect.get(identifier, 'name');\n\t}\n\n\tstatic fromJSON(node: MetaProperty, deserializer: NodeDeserializer<any>): MetaProperty {\n\t\tif (MetaProperty.getJsonName(node.meta) === 'new' && MetaProperty.getJsonName(node.property) === 'target') {\n\t\t\treturn MetaProperty.NewTarget;\n\t\t}\n\t\telse if (MetaProperty.getJsonName(node.meta) === 'new' && MetaProperty.getJsonName(node.property) === 'meta') {\n\t\t\treturn MetaProperty.ImportMeta;\n\t\t}\n\t\treturn new MetaProperty(\n\t\t\tdeserializer(node.meta),\n\t\t\tdeserializer(node.property)\n\t\t);\n\t}\n\tconstructor(private meta: Identifier, property: Identifier) {\n\t\tsuper(meta, property, false);\n\t}\n\tgetMeta() {\n\t\treturn this.meta;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\ttoString(): string {\n\t\treturn `${this.meta.toString()}.${this.property.toString()}`;\n\t}\n\ttoJson(): { [key: string]: any; } {\n\t\treturn {\n\t\t\tmeta: this.meta.toJSON(),\n\t\t\tproperty: this.property.toJSON(),\n\t\t};\n\t}\n}\n\n/**\n * A private identifier refers to private class elements. For a private name #a, its name is a.\n */\n@Deserializer('PrivateIdentifier')\nexport class PrivateIdentifier extends Identifier {\n\tstatic fromJSON(node: PrivateIdentifier): PrivateIdentifier {\n\t\treturn new PrivateIdentifier(\n\t\t\tnode.name as string\n\t\t);\n\t}\n\tconstructor(private privateName: string) {\n\t\tsuper('ɵ_' + privateName);\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\ttoString(): string {\n\t\treturn `#${this.privateName}`;\n\t}\n\ttoJson(): { [key: string]: any; } {\n\t\treturn {\n\t\t\tname: this.privateName\n\t\t};\n\t}\n}\n\nexport type MethodDefinitionKind = 'constructor' | 'method' | 'set' | 'get';\n\n/**\n * - When key is a PrivateIdentifier, computed must be false and kind can not be \"constructor\".\n */\n@Deserializer('MethodDefinition')\nexport class MethodDefinition extends AbstractExpressionNode implements CanDeclareExpression {\n\tstatic fromJSON(node: MethodDefinition, deserializer: NodeDeserializer<any>): MethodDefinition {\n\t\treturn new MethodDefinition(\n\t\t\tnode.kind,\n\t\t\tdeserializer(node.key),\n\t\t\tdeserializer(node.value),\n\t\t\tnode.computed,\n\t\t\tnode.static\n\t\t);\n\t}\n\tprivate 'static': boolean;\n\tconstructor(\n\t\tprivate kind: MethodDefinitionKind,\n\t\tprivate key: ExpressionNode | PrivateIdentifier,\n\t\tprivate value: FunctionExpression,\n\n\t\tprivate computed: boolean,\n\t\tisStatic: boolean) {\n\t\tsuper();\n\t\tthis.static = isStatic;\n\t}\n\tgetKind() {\n\t\treturn this.kind;\n\t}\n\tgetKey() {\n\t\treturn this.key;\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tisComputed() {\n\t\treturn this.computed;\n\t}\n\tisStatic() {\n\t\treturn this.static;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdeclareVariable(stack: Stack, scopeType: ScopeType, propertyValue?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoString(): string {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoJson(): { [key: string]: any; } {\n\t\treturn {\n\t\t\tkind: this.kind,\n\t\t\tkey: this.key,\n\t\t\tvalue: this.value,\n\t\t\tcomputed: this.computed,\n\t\t\tstatic: this.static,\n\t\t};\n\t}\n}\n\n\n\n/**\n * - When key is a PrivateIdentifier, computed must be false.\n */\n@Deserializer('PropertyDefinition')\nexport class PropertyDefinition extends AbstractExpressionNode implements CanDeclareExpression {\n\tstatic fromJSON(node: PropertyDefinition, deserializer: NodeDeserializer<any>): PropertyDefinition {\n\t\treturn new PropertyDefinition(\n\t\t\tdeserializer(node.key),\n\t\t\tnode.computed,\n\t\t\tnode.static,\n\t\t\tnode.value && deserializer(node.value)\n\t\t);\n\t}\n\tprivate 'static': boolean;\n\tconstructor(\n\t\tprivate key: ExpressionNode | PrivateIdentifier,\n\t\tprivate computed: boolean,\n\t\tisStatic: boolean,\n\t\tprivate value?: ExpressionNode) {\n\t\tsuper();\n\t\tthis.static = isStatic;\n\t}\n\tgetKey() {\n\t\treturn this.key;\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tisComputed() {\n\t\treturn this.computed;\n\t}\n\tisStatic() {\n\t\treturn this.static;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdeclareVariable(stack: Stack, scopeType: ScopeType, propertyValue?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoString(): string {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoJson(): { [key: string]: any; } {\n\t\treturn {\n\t\t\tkey: this.key.toJSON(),\n\t\t\tcomputed: this.computed,\n\t\t\tstatic: this.static,\n\t\t\tvalue: this.value?.toJSON()\n\t\t};\n\t}\n}\n\n@Deserializer('ClassBody')\nexport class ClassBody extends AbstractExpressionNode {\n\tstatic fromJSON(node: ClassBody, deserializer: NodeDeserializer<any>): ClassBody {\n\t\treturn new ClassBody(\n\t\t\tnode.body.map(deserializer)\n\t\t);\n\t}\n\tconstructor(private body: (MethodDefinition | PropertyDefinition)[]) {\n\t\tsuper();\n\t}\n\tgetBody() {\n\t\treturn this.body;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoString(): string {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoJson(): { [key: string]: any; } {\n\t\treturn {\n\t\t\tbody: this.body.map(method => method.toJSON())\n\t\t};\n\t}\n}\n\nexport class Class extends AbstractExpressionNode {\n\tconstructor(\n\t\tprotected body: ClassBody,\n\t\tprotected id?: Identifier,\n\t\tprotected superClass?: ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetBody() {\n\t\treturn this.body;\n\t}\n\tgetId() {\n\t\treturn this.id;\n\t}\n\tgetSuperClass() {\n\t\treturn this.superClass;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`Class.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tthrow new Error(`Class.#get() has no implementation.`);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoString() {\n\t\tlet classDeclaration = 'class ';\n\t\tif (this.id) {\n\t\t\tclassDeclaration += this.id.toString();\n\t\t}\n\t\tif (this.superClass) {\n\t\t\tclassDeclaration += ' extends ' + this.superClass.toString();\n\t\t}\n\t\treturn `${classDeclaration} {${this.body.toString()}\\n`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tbody: this.body.toJSON(),\n\t\t\tid: this.id?.toJSON(),\n\t\t\tsuperClass: this.superClass?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('ClassDeclaration')\nexport class ClassDeclaration extends Class implements CanDeclareExpression {\n\tstatic fromJSON(node: ClassDeclaration, deserializer: NodeDeserializer<any>): ClassDeclaration {\n\t\treturn new ClassDeclaration(\n\t\t\tdeserializer(node.body),\n\t\t\tdeserializer(node.id),\n\t\t\tnode.superClass && deserializer(node.superClass)\n\t\t);\n\t}\n\tprotected id: Identifier;\n\tdeclareVariable(stack: Stack, scopeType: ScopeType, propertyValue?: any) {\n\t\tstack.declareVariable(scopeType, this.id.getName(), propertyValue);\n\t}\n}\n\n@Deserializer('ClassExpression')\nexport class ClassExpression extends Class {\n\tstatic fromJSON(node: ClassExpression, deserializer: NodeDeserializer<any>): ClassExpression {\n\t\treturn new ClassExpression(\n\t\t\tdeserializer(node.body),\n\t\t\tnode.id && deserializer(node.id),\n\t\t\tnode.superClass && deserializer(node.superClass)\n\t\t);\n\t}\n}\n"]}
|
package/api/app/program.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var Program_1;
|
|
2
|
-
import { __decorate, __metadata } from "tslib";
|
|
3
|
-
import { AbstractExpressionNode } from '../abstract.js';
|
|
4
|
-
import { Deserializer } from '../deserialize/deserialize.js';
|
|
5
|
-
let Program = Program_1 = class Program extends AbstractExpressionNode {
|
|
6
|
-
constructor(sourceType, body) {
|
|
7
|
-
super();
|
|
8
|
-
this.sourceType = sourceType;
|
|
9
|
-
this.body = body;
|
|
10
|
-
}
|
|
11
|
-
static fromJSON(node, deserializer) {
|
|
12
|
-
return new Program_1(node.sourceType, node.body.map(deserializer));
|
|
13
|
-
}
|
|
14
|
-
shareVariables(scopeList) { }
|
|
15
|
-
set(stack, value) {
|
|
16
|
-
throw new Error(`${this.constructor.name}#set() has no implementation.`);
|
|
17
|
-
}
|
|
18
|
-
get(stack, thisContext) {
|
|
19
|
-
throw new Error(`${this.constructor.name}#set() has no implementation.`);
|
|
20
|
-
}
|
|
21
|
-
dependency(computed) {
|
|
22
|
-
throw new Error('Method not implemented.');
|
|
23
|
-
}
|
|
24
|
-
dependencyPath(computed) {
|
|
25
|
-
throw new Error('Method not implemented.');
|
|
26
|
-
}
|
|
27
|
-
toString() {
|
|
28
|
-
throw new Error(`${this.constructor.name}#set() has no implementation.`);
|
|
29
|
-
}
|
|
30
|
-
toJson() {
|
|
31
|
-
throw new Error(`${this.constructor.name}#set() has no implementation.`);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
Program = Program_1 = __decorate([
|
|
35
|
-
Deserializer('Program'),
|
|
36
|
-
__metadata("design:paramtypes", [String, Array])
|
|
37
|
-
], Program);
|
|
38
|
-
export { Program };
|
|
39
|
-
//# sourceMappingURL=program.js.map
|
package/api/app/program.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../../../src/expressions/api/app/program.ts"],"names":[],"mappings":";;AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAK7D,IAAa,OAAO,eAApB,MAAa,OAAQ,SAAQ,sBAAsB;IAKlD,YAAoB,UAA6B,EAAU,IAAsB;QAChF,KAAK,EAAE,CAAC;QADW,eAAU,GAAV,UAAU,CAAmB;QAAU,SAAI,GAAJ,IAAI,CAAkB;IAEjF,CAAC;IALD,MAAM,CAAC,QAAQ,CAAC,IAAa,EAAE,YAA8B;QAC5D,OAAO,IAAI,SAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IAClE,CAAC;IAID,cAAc,CAAC,SAAuB,IAAU,CAAC;IACjD,GAAG,CAAC,KAAY,EAAE,KAAU;QAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;IAC1E,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,WAAiB;QAClC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;IAC1E,CAAC;IAED,UAAU,CAAC,QAAe;QACzB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IACD,QAAQ;QACP,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM;QACL,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,+BAA+B,CAAC,CAAC;IAC1E,CAAC;CAED,CAAA;AA7BY,OAAO;IADnB,YAAY,CAAC,SAAS,CAAC;;GACX,OAAO,CA6BnB;SA7BY,OAAO","sourcesContent":["import type { ExpressionEventPath, ExpressionNode, NodeDeserializer } from '../expression.js';\nimport type { Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\nexport type ProgramSourceType = 'script' | 'module';\n\n@Deserializer('Program')\nexport class Program extends AbstractExpressionNode {\n\n\tstatic fromJSON(node: Program, deserializer: NodeDeserializer): Program {\n\t\treturn new Program(node.sourceType, node.body.map(deserializer));\n\t}\n\tconstructor(private sourceType: ProgramSourceType, private body: ExpressionNode[]) {\n\t\tsuper();\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack, value: any): any {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(stack: Stack, thisContext?: any): any {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\n\tdependency(computed?: true): ExpressionNode[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\ttoString(): string {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\ttoJson(): { [key: string]: any } {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\n}"]}
|
package/api/module/module.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ExpressionEventPath, ExpressionNode, NodeDeserializer, VisitNodeListType, VisitNodeType } from '../expression.js';
|
|
2
|
-
import type { Scope } from '../../scope/scope.js';
|
|
3
|
-
import type { Stack } from '../../scope/stack.js';
|
|
4
|
-
import { AbstractExpressionNode } from '../abstract.js';
|
|
5
|
-
export declare class ModuleNode extends AbstractExpressionNode {
|
|
6
|
-
private exportList;
|
|
7
|
-
private importList;
|
|
8
|
-
private body;
|
|
9
|
-
private meta;
|
|
10
|
-
static fromJSON(node: ModuleNode, deserializer: NodeDeserializer): ModuleNode;
|
|
11
|
-
static visit(node: ModuleNode, visitNode: VisitNodeType, visitNodeList: VisitNodeListType): void;
|
|
12
|
-
constructor(exportList: ExpressionNode[], importList: ExpressionNode[], body: ExpressionNode[], meta: {
|
|
13
|
-
name: string;
|
|
14
|
-
url: string;
|
|
15
|
-
});
|
|
16
|
-
getExportList(): ExpressionNode[];
|
|
17
|
-
getImportList(): ExpressionNode[];
|
|
18
|
-
getBody(): ExpressionNode[];
|
|
19
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
20
|
-
set(stack: Stack): void;
|
|
21
|
-
get(stack: Stack): void;
|
|
22
|
-
dependency(computed?: true): ExpressionNode[];
|
|
23
|
-
dependencyPath(computed?: true): ExpressionEventPath[];
|
|
24
|
-
toString(): string;
|
|
25
|
-
toJson(): object;
|
|
26
|
-
}
|
package/api/module/module.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var ModuleNode_1;
|
|
2
|
-
import { __decorate, __metadata } from "tslib";
|
|
3
|
-
import { AbstractExpressionNode } from '../abstract.js';
|
|
4
|
-
import { Deserializer } from '../deserialize/deserialize.js';
|
|
5
|
-
let ModuleNode = ModuleNode_1 = class ModuleNode extends AbstractExpressionNode {
|
|
6
|
-
constructor(exportList, importList, body, meta) {
|
|
7
|
-
super();
|
|
8
|
-
this.exportList = exportList;
|
|
9
|
-
this.importList = importList;
|
|
10
|
-
this.body = body;
|
|
11
|
-
this.meta = meta;
|
|
12
|
-
}
|
|
13
|
-
static fromJSON(node, deserializer) {
|
|
14
|
-
return new ModuleNode_1(node.exportList.map(deserializer), node.importList.map(deserializer), node.body.map(deserializer), node.meta);
|
|
15
|
-
}
|
|
16
|
-
static visit(node, visitNode, visitNodeList) {
|
|
17
|
-
visitNodeList(node.exportList);
|
|
18
|
-
visitNodeList(node.importList);
|
|
19
|
-
visitNodeList(node.body);
|
|
20
|
-
}
|
|
21
|
-
getExportList() {
|
|
22
|
-
return this.exportList;
|
|
23
|
-
}
|
|
24
|
-
getImportList() {
|
|
25
|
-
return this.importList;
|
|
26
|
-
}
|
|
27
|
-
getBody() {
|
|
28
|
-
return this.body;
|
|
29
|
-
}
|
|
30
|
-
shareVariables(scopeList) { }
|
|
31
|
-
set(stack) {
|
|
32
|
-
throw new Error(`ModuleNode.#set() has no implementation.`);
|
|
33
|
-
}
|
|
34
|
-
get(stack) {
|
|
35
|
-
throw new Error(`ModuleNode.#get() has no implementation.`);
|
|
36
|
-
}
|
|
37
|
-
dependency(computed) {
|
|
38
|
-
return this.body.flatMap(exp => exp.dependency(computed));
|
|
39
|
-
}
|
|
40
|
-
dependencyPath(computed) {
|
|
41
|
-
return this.body.flatMap(exp => exp.dependencyPath(computed));
|
|
42
|
-
}
|
|
43
|
-
toString() {
|
|
44
|
-
const importString = this.importList.map(imp => imp.toString()).join('\n');
|
|
45
|
-
const exportString = this.exportList.map(expo => expo.toString()).join('\n');
|
|
46
|
-
const bodyString = this.body.map(exp => exp.toString()).join('\n');
|
|
47
|
-
return `${importString}\n${exportString}\n${bodyString}\n`;
|
|
48
|
-
}
|
|
49
|
-
toJson() {
|
|
50
|
-
return {
|
|
51
|
-
exportList: this.exportList.map(expression => expression.toJSON()),
|
|
52
|
-
importList: this.importList.map(expression => expression.toJSON()),
|
|
53
|
-
body: this.body.map(expression => expression.toJSON()),
|
|
54
|
-
meta: JSON.parse(JSON.stringify(this.meta)),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
ModuleNode = ModuleNode_1 = __decorate([
|
|
59
|
-
Deserializer('module'),
|
|
60
|
-
__metadata("design:paramtypes", [Array, Array, Array, Object])
|
|
61
|
-
], ModuleNode);
|
|
62
|
-
export { ModuleNode };
|
|
63
|
-
//# sourceMappingURL=module.js.map
|
package/api/module/module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/module.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,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IAAI,CAAC,IAAI,CAAC,CAAC;SAC3C,CAAC;IACH,CAAC;CACD,CAAA;AAzDY,UAAU;IADtB,YAAY,CAAC,QAAQ,CAAC;;GACV,UAAU,CAyDtB;SAzDY,UAAU","sourcesContent":["import type {\n\tExpressionEventPath, ExpressionNode, NodeDeserializer,\n\tVisitNodeListType, VisitNodeType\n} from '../expression.js';\nimport type { Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\n@Deserializer('module')\nexport class ModuleNode extends AbstractExpressionNode {\n\tstatic fromJSON(node: ModuleNode, deserializer: NodeDeserializer): ModuleNode {\n\t\treturn new ModuleNode(\n\t\t\tnode.exportList.map(deserializer),\n\t\t\tnode.importList.map(deserializer),\n\t\t\tnode.body.map(deserializer),\n\t\t\tnode.meta\n\t\t);\n\t}\n\tstatic visit(node: ModuleNode, visitNode: VisitNodeType, visitNodeList: VisitNodeListType): void {\n\t\tvisitNodeList(node.exportList);\n\t\tvisitNodeList(node.importList);\n\t\tvisitNodeList(node.body);\n\t}\n\tconstructor(\n\t\tprivate exportList: ExpressionNode[],\n\t\tprivate importList: ExpressionNode[],\n\t\tprivate body: ExpressionNode[],\n\t\tprivate meta: { name: string, url: string, }) {\n\t\tsuper();\n\t}\n\tgetExportList() {\n\t\treturn this.exportList;\n\t}\n\tgetImportList() {\n\t\treturn this.importList;\n\t}\n\tgetBody() {\n\t\treturn this.body;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ModuleNode.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tthrow new Error(`ModuleNode.#get() has no implementation.`);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.body.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.body.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tconst importString = this.importList.map(imp => imp.toString()).join('\\n');\n\t\tconst exportString = this.exportList.map(expo => expo.toString()).join('\\n');\n\t\tconst bodyString = this.body.map(exp => exp.toString()).join('\\n');\n\t\treturn `${importString}\\n${exportString}\\n${bodyString}\\n`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\texportList: this.exportList.map(expression => expression.toJSON()),\n\t\t\timportList: this.importList.map(expression => expression.toJSON()),\n\t\t\tbody: this.body.map(expression => expression.toJSON()),\n\t\t\tmeta: JSON.parse(JSON.stringify(this.meta)),\n\t\t};\n\t}\n}\n"]}
|