@ibyar/expressions 1.0.0 → 1.2.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.
Files changed (141) hide show
  1. package/README.md +48 -1
  2. package/api/abstract.js.map +1 -1
  3. package/api/class/class.js +143 -93
  4. package/api/class/class.js.map +1 -1
  5. package/api/class/decorator.js +8 -3
  6. package/api/class/decorator.js.map +1 -1
  7. package/api/computing/call.js +8 -3
  8. package/api/computing/call.js.map +1 -1
  9. package/api/computing/debugger.js +8 -3
  10. package/api/computing/debugger.js.map +1 -1
  11. package/api/computing/new.js +8 -3
  12. package/api/computing/new.js.map +1 -1
  13. package/api/computing/rest.js +8 -3
  14. package/api/computing/rest.js.map +1 -1
  15. package/api/computing/return.js +8 -3
  16. package/api/computing/return.js.map +1 -1
  17. package/api/computing/spread.js +8 -3
  18. package/api/computing/spread.js.map +1 -1
  19. package/api/computing/throw.js +38 -23
  20. package/api/computing/throw.js.map +1 -1
  21. package/api/computing/yield.js +8 -3
  22. package/api/computing/yield.js.map +1 -1
  23. package/api/definition/array.js +23 -13
  24. package/api/definition/array.js.map +1 -1
  25. package/api/definition/bind.js +8 -3
  26. package/api/definition/bind.js.map +1 -1
  27. package/api/definition/comment.js +8 -3
  28. package/api/definition/comment.js.map +1 -1
  29. package/api/definition/function.js +53 -33
  30. package/api/definition/function.js.map +1 -1
  31. package/api/definition/member.js +8 -3
  32. package/api/definition/member.js.map +1 -1
  33. package/api/definition/object.js +38 -23
  34. package/api/definition/object.js.map +1 -1
  35. package/api/definition/statement.js +8 -3
  36. package/api/definition/statement.js.map +1 -1
  37. package/api/definition/values.js +68 -43
  38. package/api/definition/values.js.map +1 -1
  39. package/api/deserialize/deserialize.js.map +1 -1
  40. package/api/expression.d.ts +3 -0
  41. package/api/expression.d.ts.map +1 -1
  42. package/api/expression.js.map +1 -1
  43. package/api/module/common.js +8 -3
  44. package/api/module/common.js.map +1 -1
  45. package/api/module/export.js +53 -33
  46. package/api/module/export.js.map +1 -1
  47. package/api/module/import.js +68 -43
  48. package/api/module/import.js.map +1 -1
  49. package/api/operators/assignment.js +6 -2
  50. package/api/operators/assignment.js.map +1 -1
  51. package/api/operators/await.js +8 -3
  52. package/api/operators/await.js.map +1 -1
  53. package/api/operators/binary.js +6 -2
  54. package/api/operators/binary.js.map +1 -1
  55. package/api/operators/chaining.js +8 -3
  56. package/api/operators/chaining.js.map +1 -1
  57. package/api/operators/comma.js +8 -3
  58. package/api/operators/comma.js.map +1 -1
  59. package/api/operators/grouping.js +8 -3
  60. package/api/operators/grouping.js.map +1 -1
  61. package/api/operators/logical.js +6 -2
  62. package/api/operators/logical.js.map +1 -1
  63. package/api/operators/pipeline.js +8 -3
  64. package/api/operators/pipeline.js.map +1 -1
  65. package/api/operators/ternary.js +8 -3
  66. package/api/operators/ternary.js.map +1 -1
  67. package/api/operators/unary.js +6 -2
  68. package/api/operators/unary.js.map +1 -1
  69. package/api/operators/update.js +6 -2
  70. package/api/operators/update.js.map +1 -1
  71. package/api/program.js +8 -3
  72. package/api/program.js.map +1 -1
  73. package/api/statement/control/block.js +8 -3
  74. package/api/statement/control/block.js.map +1 -1
  75. package/api/statement/control/empty.js +8 -3
  76. package/api/statement/control/empty.js.map +1 -1
  77. package/api/statement/control/if.js +8 -3
  78. package/api/statement/control/if.js.map +1 -1
  79. package/api/statement/control/switch.js +38 -23
  80. package/api/statement/control/switch.js.map +1 -1
  81. package/api/statement/control/terminate.js +38 -23
  82. package/api/statement/control/terminate.js.map +1 -1
  83. package/api/statement/control/with.js +8 -3
  84. package/api/statement/control/with.js.map +1 -1
  85. package/api/statement/declarations/declares.js +23 -13
  86. package/api/statement/declarations/declares.js.map +1 -1
  87. package/api/statement/iterations/for.js +53 -33
  88. package/api/statement/iterations/for.js.map +1 -1
  89. package/api/statement/iterations/while.js +23 -13
  90. package/api/statement/iterations/while.js.map +1 -1
  91. package/bin/cli.d.ts +3 -0
  92. package/bin/cli.d.ts.map +1 -0
  93. package/bin/cli.js +73 -0
  94. package/bin/cli.js.map +1 -0
  95. package/package.json +8 -5
  96. package/scope/builder.d.ts +27 -0
  97. package/scope/builder.d.ts.map +1 -0
  98. package/scope/builder.js +73 -0
  99. package/scope/builder.js.map +1 -0
  100. package/scope/event.js.map +1 -1
  101. package/scope/finalizer.js.map +1 -1
  102. package/scope/index.d.ts +1 -0
  103. package/scope/index.d.ts.map +1 -1
  104. package/scope/index.js +1 -0
  105. package/scope/index.js.map +1 -1
  106. package/scope/pool.js.map +1 -1
  107. package/scope/proxy.js.map +1 -1
  108. package/scope/scope.d.ts.map +1 -1
  109. package/scope/scope.js +4 -3
  110. package/scope/scope.js.map +1 -1
  111. package/scope/signal.d.ts +75 -0
  112. package/scope/signal.d.ts.map +1 -0
  113. package/scope/signal.js +226 -0
  114. package/scope/signal.js.map +1 -0
  115. package/scope/stack.d.ts +1 -1
  116. package/scope/stack.d.ts.map +1 -1
  117. package/scope/stack.js +1 -1
  118. package/scope/stack.js.map +1 -1
  119. package/scope/variable.d.ts +1 -0
  120. package/scope/variable.d.ts.map +1 -0
  121. package/scope/variable.js +2 -0
  122. package/scope/variable.js.map +1 -0
  123. package/scope/variables.d.ts +66 -0
  124. package/scope/variables.d.ts.map +1 -0
  125. package/scope/variables.js +214 -0
  126. package/scope/variables.js.map +1 -0
  127. package/v8/enums.d.ts +5 -5
  128. package/v8/enums.d.ts.map +1 -1
  129. package/v8/enums.js +2 -4
  130. package/v8/enums.js.map +1 -1
  131. package/v8/factory.js.map +1 -1
  132. package/v8/inline.js.map +1 -1
  133. package/v8/parser.js.map +1 -1
  134. package/v8/stream.js +1 -2
  135. package/v8/stream.js.map +1 -1
  136. package/v8/token.js +1 -2
  137. package/v8/token.js.map +1 -1
  138. package/visit/visitor.js.map +1 -1
  139. package/v8/nodes.d.ts +0 -0
  140. package/v8/nodes.js +0 -2
  141. package/v8/nodes.js.map +0 -1
@@ -10,15 +10,19 @@ import { AbstractExpressionNode } from '../abstract.js';
10
10
  * there is no way to convert identifiers to strings,
11
11
  * but sometimes it is possible to parse strings into identifiers.
12
12
  */
13
- export let Identifier = (() => {
13
+ let Identifier = (() => {
14
14
  let _classDecorators = [Deserializer('Identifier')];
15
15
  let _classDescriptor;
16
16
  let _classExtraInitializers = [];
17
17
  let _classThis;
18
- var Identifier = class extends AbstractExpressionNode {
18
+ let _classSuper = AbstractExpressionNode;
19
+ var Identifier = class extends _classSuper {
20
+ static { _classThis = this; }
19
21
  static {
20
- __esDecorate(null, _classDescriptor = { value: this }, _classDecorators, { kind: "class", name: this.name }, null, _classExtraInitializers);
22
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
23
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
21
24
  Identifier = _classThis = _classDescriptor.value;
25
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
22
26
  __runInitializers(_classThis, _classExtraInitializers);
23
27
  }
24
28
  name;
@@ -70,16 +74,21 @@ export let Identifier = (() => {
70
74
  };
71
75
  return Identifier = _classThis;
72
76
  })();
73
- export let ThisExpression = (() => {
74
- let _classDecorators_1 = [Deserializer('ThisExpression')];
75
- let _classDescriptor_1;
76
- let _classExtraInitializers_1 = [];
77
- let _classThis_1;
78
- var ThisExpression = class extends Identifier {
77
+ export { Identifier };
78
+ let ThisExpression = (() => {
79
+ let _classDecorators = [Deserializer('ThisExpression')];
80
+ let _classDescriptor;
81
+ let _classExtraInitializers = [];
82
+ let _classThis;
83
+ let _classSuper = Identifier;
84
+ var ThisExpression = class extends _classSuper {
85
+ static { _classThis = this; }
79
86
  static {
80
- __esDecorate(null, _classDescriptor_1 = { value: this }, _classDecorators_1, { kind: "class", name: this.name }, null, _classExtraInitializers_1);
81
- ThisExpression = _classThis_1 = _classDescriptor_1.value;
82
- __runInitializers(_classThis_1, _classExtraInitializers_1);
87
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
88
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
89
+ ThisExpression = _classThis = _classDescriptor.value;
90
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
91
+ __runInitializers(_classThis, _classExtraInitializers);
83
92
  }
84
93
  static fromJSON(node) {
85
94
  return new ThisExpression(node.range, node.loc);
@@ -91,18 +100,23 @@ export let ThisExpression = (() => {
91
100
  return {};
92
101
  }
93
102
  };
94
- return ThisExpression = _classThis_1;
103
+ return ThisExpression = _classThis;
95
104
  })();
96
- export let Literal = (() => {
97
- let _classDecorators_2 = [Deserializer('Literal')];
98
- let _classDescriptor_2;
99
- let _classExtraInitializers_2 = [];
100
- let _classThis_2;
101
- var Literal = class extends AbstractExpressionNode {
105
+ export { ThisExpression };
106
+ let Literal = (() => {
107
+ let _classDecorators = [Deserializer('Literal')];
108
+ let _classDescriptor;
109
+ let _classExtraInitializers = [];
110
+ let _classThis;
111
+ let _classSuper = AbstractExpressionNode;
112
+ var Literal = class extends _classSuper {
113
+ static { _classThis = this; }
102
114
  static {
103
- __esDecorate(null, _classDescriptor_2 = { value: this }, _classDecorators_2, { kind: "class", name: this.name }, null, _classExtraInitializers_2);
104
- Literal = _classThis_2 = _classDescriptor_2.value;
105
- __runInitializers(_classThis_2, _classExtraInitializers_2);
115
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
116
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
117
+ Literal = _classThis = _classDescriptor.value;
118
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
119
+ __runInitializers(_classThis, _classExtraInitializers);
106
120
  }
107
121
  value;
108
122
  static fromJSON(node) {
@@ -177,8 +191,9 @@ export let Literal = (() => {
177
191
  };
178
192
  }
179
193
  };
180
- return Literal = _classThis_2;
194
+ return Literal = _classThis;
181
195
  })();
196
+ export { Literal };
182
197
  class TemplateArray extends Array {
183
198
  raw;
184
199
  constructor(strings) {
@@ -244,16 +259,20 @@ export class TemplateLiteralExpressionNode extends AbstractExpressionNode {
244
259
  };
245
260
  }
246
261
  }
247
- export let TemplateLiteral = (() => {
248
- let _classDecorators_3 = [Deserializer('TemplateLiteral')];
249
- let _classDescriptor_3;
250
- let _classExtraInitializers_3 = [];
251
- let _classThis_3;
252
- var TemplateLiteral = class extends TemplateLiteralExpressionNode {
262
+ let TemplateLiteral = (() => {
263
+ let _classDecorators = [Deserializer('TemplateLiteral')];
264
+ let _classDescriptor;
265
+ let _classExtraInitializers = [];
266
+ let _classThis;
267
+ let _classSuper = TemplateLiteralExpressionNode;
268
+ var TemplateLiteral = class extends _classSuper {
269
+ static { _classThis = this; }
253
270
  static {
254
- __esDecorate(null, _classDescriptor_3 = { value: this }, _classDecorators_3, { kind: "class", name: this.name }, null, _classExtraInitializers_3);
255
- TemplateLiteral = _classThis_3 = _classDescriptor_3.value;
256
- __runInitializers(_classThis_3, _classExtraInitializers_3);
271
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
272
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
273
+ TemplateLiteral = _classThis = _classDescriptor.value;
274
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
275
+ __runInitializers(_classThis, _classExtraInitializers);
257
276
  }
258
277
  static fromJSON(node, deserializer) {
259
278
  return new TemplateLiteral(node.quasis, node.expressions.map(deserializer), node.range, node.loc);
@@ -265,18 +284,23 @@ export let TemplateLiteral = (() => {
265
284
  return undefined;
266
285
  }
267
286
  };
268
- return TemplateLiteral = _classThis_3;
287
+ return TemplateLiteral = _classThis;
269
288
  })();
270
- export let TaggedTemplateExpression = (() => {
271
- let _classDecorators_4 = [Deserializer('TaggedTemplateExpression')];
272
- let _classDescriptor_4;
273
- let _classExtraInitializers_4 = [];
274
- let _classThis_4;
275
- var TaggedTemplateExpression = class extends TemplateLiteralExpressionNode {
289
+ export { TemplateLiteral };
290
+ let TaggedTemplateExpression = (() => {
291
+ let _classDecorators = [Deserializer('TaggedTemplateExpression')];
292
+ let _classDescriptor;
293
+ let _classExtraInitializers = [];
294
+ let _classThis;
295
+ let _classSuper = TemplateLiteralExpressionNode;
296
+ var TaggedTemplateExpression = class extends _classSuper {
297
+ static { _classThis = this; }
276
298
  static {
277
- __esDecorate(null, _classDescriptor_4 = { value: this }, _classDecorators_4, { kind: "class", name: this.name }, null, _classExtraInitializers_4);
278
- TaggedTemplateExpression = _classThis_4 = _classDescriptor_4.value;
279
- __runInitializers(_classThis_4, _classExtraInitializers_4);
299
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
300
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
301
+ TaggedTemplateExpression = _classThis = _classDescriptor.value;
302
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
303
+ __runInitializers(_classThis, _classExtraInitializers);
280
304
  }
281
305
  static fromJSON(node, deserializer) {
282
306
  return new TaggedTemplateExpression(deserializer(node.tag), node.quasis, node.expressions.map(deserializer), node.range, node.loc);
@@ -288,6 +312,7 @@ export let TaggedTemplateExpression = (() => {
288
312
  return super.getTag();
289
313
  }
290
314
  };
291
- return TaggedTemplateExpression = _classThis_4;
315
+ return TaggedTemplateExpression = _classThis;
292
316
  })();
317
+ export { TaggedTemplateExpression };
293
318
  //# sourceMappingURL=values.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/expressions/api/definition/values.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;AAEH,MAAM,KAAO,UAAU;4BADtB,YAAY,CAAC,YAAY,CAAC;;;;QACd,UAAU,QAAC,SAAQ,sBAAsB;;YAAtD,4IA+CC;YA/CY,UAAU;YAAV,uDAAU;;QAIA,IAAI;QAH1B,MAAM,CAAC,QAAQ,CAAC,IAAgB;YAC/B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;QACD,YAAsB,IAAqB,EAAE,KAAwB,EAAE,GAAoB;YAC1F,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YADG,SAAI,GAAJ,IAAI,CAAiB;QAE3C,CAAC;QACD,OAAO;YACN,OAAO,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,KAAU;YAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,WAAiB;YAClC,IAAI,WAAW,EAAE;gBAChB,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YACD,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAGD,SAAS,CAAmB,KAAY,EAAE,KAAkB;YAC3D,IAAI,KAAK,EAAE;gBACV,O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Y,CAAC,0BAA0B,CAAC;;;;QAC5B,wBAAwB,QAAC,SAAQ,6BAA6B;;YAA3E,kJAsBC;YAtBY,wBAAwB;YAAxB,2DAAwB;;QACpC,MAAM,CAAC,QAAQ,CAAC,IAA8B,EAAE,YAA8B;YAC7E,OAAO,IAAI,wBAAwB,CAClC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EACtB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAClC,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,GAAG,CACR,CAAC;QACH,CAAC;QAED,YACC,GAAmB,EACnB,MAAgB,EAChB,WAA6B,EAC7B,KAAwB,EACxB,GAAoB;YACpB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;QACQ,MAAM;YACd,OAAO,KAAK,CAAC,MAAM,EAAG,CAAC;QACxB,CAAC;;WArBW,wBAAwB","sourcesContent":["import type {\n\tDeclarationExpression, ExpressionNode, NodeDeserializer,\n\tCanFindScope, ExpressionEventPath, VisitNodeType, SourceLocation\n} from '../expression.js';\nimport type { Context, Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode } from '../abstract.js';\n\n/**\n * An identifier is a sequence of characters in the code that identifies a variable, function, or property.\n * In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9),\n * but may not start with a digit.\n * An identifier differs from a string in that a string is data,\n * while an identifier is part of the code. In JavaScript,\n * there is no way to convert identifiers to strings,\n * but sometimes it is possible to parse strings into identifiers.\n */\n@Deserializer('Identifier')\nexport class Identifier extends AbstractExpressionNode implements DeclarationExpression, CanFindScope {\n\tstatic fromJSON(node: Identifier): Identifier {\n\t\treturn new Identifier(node.name, node.range, node.loc);\n\t}\n\tconstructor(protected name: string | number, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetName() {\n\t\treturn this.name;\n\t}\n\tset(stack: Stack, value: any) {\n\t\treturn stack.set(this.name, value) ? value : void 0;\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tif (thisContext) {\n\t\t\treturn thisContext[this.name];\n\t\t}\n\t\treturn stack.get(this.name);\n\t}\n\tfindScope<T extends object>(stack: Stack): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope: Scope<any>): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope?: Scope<any>): Scope<T> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.name);\n\t\t}\n\t\tscope = stack.findScope(this.name);\n\t\treturn scope.getInnerScope(this.name);\n\t}\n\tdeclareVariable(stack: Stack, propertyValue: any): any {\n\t\treturn stack.declareVariable(this.name, propertyValue);\n\t}\n\tgetDeclarationName(): string {\n\t\treturn this.toString();\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [this];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tconst path: ExpressionEventPath[] = [{ computed: false, path: this.toString() }];\n\t\treturn computed ? [{ computed, path: this.toString(), computedPath: [path] }] : path;\n\t}\n\ttoString(): string {\n\t\treturn String(this.name);\n\t}\n\ttoJson(): object {\n\t\treturn { name: this.name };\n\t}\n}\n\n@Deserializer('ThisExpression')\nexport class ThisExpression extends Identifier {\n\tstatic fromJSON(node: ThisExpression): ThisExpression {\n\t\treturn new ThisExpression(node.range, node.loc);\n\t}\n\tconstructor(\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper('this', range, loc);\n\t}\n\ttoJson(): object {\n\t\treturn {};\n\t}\n}\n\n@Deserializer('Literal')\nexport class Literal<T> extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: Literal<any>):\n\t\tLiteral<string>\n\t\t| Literal<number>\n\t\t| Literal<boolean>\n\t\t| Literal<RegExp>\n\t\t| Literal<bigint>\n\t\t| Literal<null>\n\t\t| Literal<undefined> {\n\t\tif (node.bigint) {\n\t\t\treturn new Literal(BigInt(node.bigint), node.raw, undefined, node.bigint, node.range, node.loc);\n\t\t} else if (node.regex) {\n\t\t\treturn new Literal(RegExp(node.regex.pattern, node.regex.flags), node.raw, node.regex, undefined, node.range, node.loc);\n\t\t}\n\t\treturn new Literal(node.value, node.raw, undefined, undefined, node.range, node.loc);\n\t}\n\tdeclare type: 'Literal';\n\tregex?: { pattern: string, flags: string };\n\tbigint?: string;\n\traw?: string\n\tconstructor(\n\t\tpublic value: T,\n\t\traw?: string,\n\t\tregex?: { pattern: string, flags: string },\n\t\tbigint?: string,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t\traw && (this.raw = raw);\n\t\tregex && (this.regex = regex);\n\t\tbigint && (this.bigint = bigint);\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tgetRegex() {\n\t\treturn this.regex;\n\t}\n\tgetBigint() {\n\t\treturn this.bigint;\n\t}\n\tgeRaw() {\n\t\treturn this.raw;\n\t}\n\tset() {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(): T {\n\t\treturn this.value;\n\t}\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.value as any);\n\t\t}\n\t\tscope = stack.findScope(this.value as any);\n\t\treturn scope.getInnerScope(this.value as any);\n\t}\n\tdependency(computed: true): ExpressionNode[] {\n\t\treturn computed ? [this] : [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn computed ? [{ computed: false, path: this.toString() }] : [];\n\t}\n\ttoString(): string {\n\t\treturn this.raw ?? String(this.value);\n\t}\n\ttoJson(): object {\n\t\tif (this.bigint) {\n\t\t\treturn {\n\t\t\t\tbigint: this.bigint,\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t} else if (this.regex) {\n\t\t\treturn {\n\t\t\t\tregex: { pattern: this.regex?.pattern, flags: this.regex?.flags },\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalue: this.value,\n\t\t\traw: this.raw,\n\t\t};\n\t}\n}\n\nclass TemplateArray extends Array<string> implements TemplateStringsArray {\n\traw: readonly string[];\n\tconstructor(strings: string[]) {\n\t\tsuper(...strings);\n\t\tthis.raw = strings;\n\t}\n}\n\nexport class TemplateLiteralExpressionNode extends AbstractExpressionNode {\n\tstatic visit(node: TemplateLiteralExpressionNode, visitNode: VisitNodeType): void {\n\t\tnode.tag && visitNode(node.tag);\n\t\tnode.expressions.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprotected quasis: string[],\n\t\tprotected expressions: ExpressionNode[],\n\t\tprotected tag?: ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetTag() {\n\t\treturn this.tag;\n\t}\n\tgetExpressions() {\n\t\treturn this.expressions;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`TemplateLiteralExpressionNode#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst tagged: Function = this.tag?.get(stack) || String.raw;\n\t\tconst templateStringsArray = new TemplateArray(this.quasis);\n\t\ttemplateStringsArray.raw = templateStringsArray;\n\t\tconst values = this.expressions.map(expr => expr.get(stack));\n\t\treturn tagged(templateStringsArray, ...values);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tlet str = this.tag?.toString() || '';\n\t\tstr += '`';\n\t\tlet i = 0;\n\t\tfor (; i < this.quasis.length - 1; i++) {\n\t\t\tstr += this.quasis[i];\n\t\t\tstr += '${';\n\t\t\tstr += this.expressions[i].toString();\n\t\t\tstr += '}';\n\t\t}\n\t\tstr += this.quasis[i];\n\t\tstr += '`';\n\t\treturn str;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tquasis: this.quasis,\n\t\t\texpressions: this.expressions.map(expr => expr.toJSON()),\n\t\t\ttag: this.tag?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('TemplateLiteral')\nexport class TemplateLiteral extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TemplateLiteral, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TemplateLiteral(\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: undefined;\n\tconstructor(\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, undefined, range, loc);\n\t}\n\toverride getTag(): undefined {\n\t\treturn undefined;\n\t}\n}\n\n@Deserializer('TaggedTemplateExpression')\nexport class TaggedTemplateExpression extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TaggedTemplateExpression, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TaggedTemplateExpression(\n\t\t\tdeserializer(node.tag),\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: ExpressionNode;\n\tconstructor(\n\t\ttag: ExpressionNode,\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, tag, range, loc);\n\t}\n\toverride getTag(): ExpressionNode {\n\t\treturn super.getTag()!;\n\t}\n}\n"]}
1
+ {"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/expressions/api/definition/values.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;IAEU,UAAU;4BADtB,YAAY,CAAC,YAAY,CAAC;;;;sBACK,sBAAsB;0BAA9B,SAAQ,WAAsB;;;;YAAtD,6KA+CC;;;YA/CY,uDAAU;;QAIA,IAAI;QAH1B,MAAM,CAAC,QAAQ,CAAC,IAAgB;YAC/B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;QACD,YAAsB,IAAqB,EAAE,KAAwB,EAAE,GAAoB;YAC1F,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YADG,SAAI,GAAJ,IAAI,CAAiB;QAE3C,CAAC;QACD,OAAO;YACN,OAAO,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,KAAU;YAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,WAAiB;YAClC,IAAI,WAAW,EAAE,CAAC;gBACjB,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAGD,SAAS,CAAmB,KAAY,EAAE,KAAkB;YAC3D,IAAI,KAAK,EAAE,CAAC;gBACX,OAAO,KAAK,CAAC,aAAa,CAAC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,0BAA0B,CAAC;;;;sBACK,6BAA6B;wCAArC,SAAQ,WAA6B;;;;YAA3E,6KAsBC;;;YAtBY,uDAAwB;;QACpC,MAAM,CAAC,QAAQ,CAAC,IAA8B,EAAE,YAA8B;YAC7E,OAAO,IAAI,wBAAwB,CAClC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EACtB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAClC,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,GAAG,CACR,CAAC;QACH,CAAC;QAED,YACC,GAAmB,EACnB,MAAgB,EAChB,WAA6B,EAC7B,KAAwB,EACxB,GAAoB;YACpB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;QACQ,MAAM;YACd,OAAO,KAAK,CAAC,MAAM,EAAG,CAAC;QACxB,CAAC;;;;SArBW,wBAAwB","sourcesContent":["import type {\n\tDeclarationExpression, ExpressionNode, NodeDeserializer,\n\tCanFindScope, ExpressionEventPath, VisitNodeType, SourceLocation\n} from '../expression.js';\nimport type { Context, Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode } from '../abstract.js';\n\n/**\n * An identifier is a sequence of characters in the code that identifies a variable, function, or property.\n * In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9),\n * but may not start with a digit.\n * An identifier differs from a string in that a string is data,\n * while an identifier is part of the code. In JavaScript,\n * there is no way to convert identifiers to strings,\n * but sometimes it is possible to parse strings into identifiers.\n */\n@Deserializer('Identifier')\nexport class Identifier extends AbstractExpressionNode implements DeclarationExpression, CanFindScope {\n\tstatic fromJSON(node: Identifier): Identifier {\n\t\treturn new Identifier(node.name, node.range, node.loc);\n\t}\n\tconstructor(protected name: string | number, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetName() {\n\t\treturn this.name;\n\t}\n\tset(stack: Stack, value: any) {\n\t\treturn stack.set(this.name, value) ? value : void 0;\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tif (thisContext) {\n\t\t\treturn thisContext[this.name];\n\t\t}\n\t\treturn stack.get(this.name);\n\t}\n\tfindScope<T extends object>(stack: Stack): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope: Scope<any>): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope?: Scope<any>): Scope<T> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.name);\n\t\t}\n\t\tscope = stack.findScope(this.name);\n\t\treturn scope.getInnerScope(this.name);\n\t}\n\tdeclareVariable(stack: Stack, propertyValue: any): any {\n\t\treturn stack.declareVariable(this.name, propertyValue);\n\t}\n\tgetDeclarationName(): string {\n\t\treturn this.toString();\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [this];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tconst path: ExpressionEventPath[] = [{ computed: false, path: this.toString() }];\n\t\treturn computed ? [{ computed, path: this.toString(), computedPath: [path] }] : path;\n\t}\n\ttoString(): string {\n\t\treturn String(this.name);\n\t}\n\ttoJson(): object {\n\t\treturn { name: this.name };\n\t}\n}\n\n@Deserializer('ThisExpression')\nexport class ThisExpression extends Identifier {\n\tstatic fromJSON(node: ThisExpression): ThisExpression {\n\t\treturn new ThisExpression(node.range, node.loc);\n\t}\n\tconstructor(\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper('this', range, loc);\n\t}\n\ttoJson(): object {\n\t\treturn {};\n\t}\n}\n\n@Deserializer('Literal')\nexport class Literal<T> extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: Literal<any>):\n\t\tLiteral<string>\n\t\t| Literal<number>\n\t\t| Literal<boolean>\n\t\t| Literal<RegExp>\n\t\t| Literal<bigint>\n\t\t| Literal<null>\n\t\t| Literal<undefined> {\n\t\tif (node.bigint) {\n\t\t\treturn new Literal(BigInt(node.bigint), node.raw, undefined, node.bigint, node.range, node.loc);\n\t\t} else if (node.regex) {\n\t\t\treturn new Literal(RegExp(node.regex.pattern, node.regex.flags), node.raw, node.regex, undefined, node.range, node.loc);\n\t\t}\n\t\treturn new Literal(node.value, node.raw, undefined, undefined, node.range, node.loc);\n\t}\n\tdeclare type: 'Literal';\n\tregex?: { pattern: string, flags: string };\n\tbigint?: string;\n\traw?: string\n\tconstructor(\n\t\tpublic value: T,\n\t\traw?: string,\n\t\tregex?: { pattern: string, flags: string },\n\t\tbigint?: string,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t\traw && (this.raw = raw);\n\t\tregex && (this.regex = regex);\n\t\tbigint && (this.bigint = bigint);\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tgetRegex() {\n\t\treturn this.regex;\n\t}\n\tgetBigint() {\n\t\treturn this.bigint;\n\t}\n\tgeRaw() {\n\t\treturn this.raw;\n\t}\n\tset() {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(): T {\n\t\treturn this.value;\n\t}\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.value as any);\n\t\t}\n\t\tscope = stack.findScope(this.value as any);\n\t\treturn scope.getInnerScope(this.value as any);\n\t}\n\tdependency(computed: true): ExpressionNode[] {\n\t\treturn computed ? [this] : [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn computed ? [{ computed: false, path: this.toString() }] : [];\n\t}\n\ttoString(): string {\n\t\treturn this.raw ?? String(this.value);\n\t}\n\ttoJson(): object {\n\t\tif (this.bigint) {\n\t\t\treturn {\n\t\t\t\tbigint: this.bigint,\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t} else if (this.regex) {\n\t\t\treturn {\n\t\t\t\tregex: { pattern: this.regex?.pattern, flags: this.regex?.flags },\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalue: this.value,\n\t\t\traw: this.raw,\n\t\t};\n\t}\n}\n\nclass TemplateArray extends Array<string> implements TemplateStringsArray {\n\traw: readonly string[];\n\tconstructor(strings: string[]) {\n\t\tsuper(...strings);\n\t\tthis.raw = strings;\n\t}\n}\n\nexport class TemplateLiteralExpressionNode extends AbstractExpressionNode {\n\tstatic visit(node: TemplateLiteralExpressionNode, visitNode: VisitNodeType): void {\n\t\tnode.tag && visitNode(node.tag);\n\t\tnode.expressions.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprotected quasis: string[],\n\t\tprotected expressions: ExpressionNode[],\n\t\tprotected tag?: ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetTag() {\n\t\treturn this.tag;\n\t}\n\tgetExpressions() {\n\t\treturn this.expressions;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`TemplateLiteralExpressionNode#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst tagged: Function = this.tag?.get(stack) || String.raw;\n\t\tconst templateStringsArray = new TemplateArray(this.quasis);\n\t\ttemplateStringsArray.raw = templateStringsArray;\n\t\tconst values = this.expressions.map(expr => expr.get(stack));\n\t\treturn tagged(templateStringsArray, ...values);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tlet str = this.tag?.toString() || '';\n\t\tstr += '`';\n\t\tlet i = 0;\n\t\tfor (; i < this.quasis.length - 1; i++) {\n\t\t\tstr += this.quasis[i];\n\t\t\tstr += '${';\n\t\t\tstr += this.expressions[i].toString();\n\t\t\tstr += '}';\n\t\t}\n\t\tstr += this.quasis[i];\n\t\tstr += '`';\n\t\treturn str;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tquasis: this.quasis,\n\t\t\texpressions: this.expressions.map(expr => expr.toJSON()),\n\t\t\ttag: this.tag?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('TemplateLiteral')\nexport class TemplateLiteral extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TemplateLiteral, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TemplateLiteral(\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: undefined;\n\tconstructor(\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, undefined, range, loc);\n\t}\n\toverride getTag(): undefined {\n\t\treturn undefined;\n\t}\n}\n\n@Deserializer('TaggedTemplateExpression')\nexport class TaggedTemplateExpression extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TaggedTemplateExpression, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TaggedTemplateExpression(\n\t\t\tdeserializer(node.tag),\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: ExpressionNode;\n\tconstructor(\n\t\ttag: ExpressionNode,\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, tag, range, loc);\n\t}\n\toverride getTag(): ExpressionNode {\n\t\treturn super.getTag()!;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"deserialize.js","sourceRoot":"","sources":["../../../../src/expressions/api/deserialize/deserialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAC7C,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;IAChB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC,CACD,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,MAAgD;IACnF,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAoB;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAGD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAoB;IAC/C,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAO,IAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IACjE,IAAI,QAAQ,EAAE;QACb,OAAO,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;KACnC;SAAM;QACN,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACrF;AACF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import type { ExpressionNode, ExpressionNodConstructor } from '../expression.js';\nimport { makeClassDecorator } from '@ibyar/decorators';\nimport { expressionTypes } from './type-store.js';\n\nexport const Deserializer = makeClassDecorator<string, ExpressionNodConstructor<ExpressionNode>>(\n\t(type, target) => {\n\t\ttarget.type = type;\n\t\texpressionTypes.set(type, target);\n\t}\n);\n\nexport function getDeserializerType(target: ExpressionNodConstructor<ExpressionNode>) {\n\treturn target.type;\n}\n\nexport function serializeNode(node: ExpressionNode) {\n\treturn JSON.stringify(node);\n}\n\n\n/**\n * convert from json expression `JSON.stringify(node)` or `serializeNode` to `ExpressionNode`\n * @param node as type `NodeJsonType`\n * @returns ExpressionNode\n */\nexport function deserialize(node: ExpressionNode) {\n\tconst fromJSON = expressionTypes.get((<any>node).type)?.fromJSON;\n\tif (fromJSON) {\n\t\treturn fromJSON(node, deserialize);\n\t} else {\n\t\tthrow new Error(`Couldn't find Expression class for name: ${JSON.stringify(node)}.`);\n\t}\n}\n\nexport function deserializeNode(node: string) {\n\tconst exp = JSON.parse(node);\n\treturn deserialize(exp);\n}\n"]}
1
+ {"version":3,"file":"deserialize.js","sourceRoot":"","sources":["../../../../src/expressions/api/deserialize/deserialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAC7C,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;IAChB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC,CACD,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,MAAgD;IACnF,OAAO,MAAM,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAoB;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAGD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAoB;IAC/C,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAO,IAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IACjE,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpC,CAAC;SAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtF,CAAC;AACF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import type { ExpressionNode, ExpressionNodConstructor } from '../expression.js';\nimport { makeClassDecorator } from '@ibyar/decorators';\nimport { expressionTypes } from './type-store.js';\n\nexport const Deserializer = makeClassDecorator<string, ExpressionNodConstructor<ExpressionNode>>(\n\t(type, target) => {\n\t\ttarget.type = type;\n\t\texpressionTypes.set(type, target);\n\t}\n);\n\nexport function getDeserializerType(target: ExpressionNodConstructor<ExpressionNode>) {\n\treturn target.type;\n}\n\nexport function serializeNode(node: ExpressionNode) {\n\treturn JSON.stringify(node);\n}\n\n\n/**\n * convert from json expression `JSON.stringify(node)` or `serializeNode` to `ExpressionNode`\n * @param node as type `NodeJsonType`\n * @returns ExpressionNode\n */\nexport function deserialize(node: ExpressionNode) {\n\tconst fromJSON = expressionTypes.get((<any>node).type)?.fromJSON;\n\tif (fromJSON) {\n\t\treturn fromJSON(node, deserialize);\n\t} else {\n\t\tthrow new Error(`Couldn't find Expression class for name: ${JSON.stringify(node)}.`);\n\t}\n}\n\nexport function deserializeNode(node: string) {\n\tconst exp = JSON.parse(node);\n\treturn deserialize(exp);\n}\n"]}
@@ -34,6 +34,9 @@ export type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEve
34
34
  export type ExpressionEventMap = {
35
35
  [key: string]: ExpressionEventMap;
36
36
  };
37
+ export type DeclarationType = 'HoistableDeclaration' | 'ClassDeclaration' | 'LexicalDeclaration';
38
+ export type HoistableDeclaration = 'FunctionDeclaration' | 'GeneratorDeclaration' | 'AsyncFunctionDeclaration' | 'AsyncGeneratorDeclaration';
39
+ export type LexicalDeclaration = 'Let' | 'Const';
37
40
  export interface ExpressionNode {
38
41
  /**
39
42
  * The `type` field is a string representing the AST variant type.
@@ -1 +1 @@
1
- {"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../src/expressions/api/expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,QAAQ,CAAC;CACd;AAED,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,8BAA8B,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/E,MAAM,MAAM,kCAAkC,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,mBAAmB,EAAE,EAAE,CAAA;CAAE,CAAC;AAC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IAC5D;;;;;;;OAOG;IACH,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IAExD;;OAEG;IACH,kBAAkB,CAAC,IAAI,MAAM,CAAC;CAC9B;AAGD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B;;;OAGG;IACH,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACrD,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3F,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACxG"}
@@ -1 +1 @@
1
- {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../src/expressions/api/expression.ts"],"names":[],"mappings":"","sourcesContent":["import type { Scope, Context } from '../scope/scope.js';\nimport type { Stack } from '../scope/stack.js';\nimport { TypeOf } from './utils.js';\n\n\n/**\n * Each Position object consists of \n * a line number (1-indexed) \n * and a column number (0-indexed)\n */\nexport interface Position {\n\tline: number; // >= 1\n\tcolumn: number; // >= 0\n}\n\nexport interface SourceLocation {\n\tsource?: string | null;\n\tstart: Position;\n\tend: Position;\n}\n\nexport type NodeType = { type: string };\nexport type NodeJsonType = { [key: string]: any } & NodeType;\n\nexport type ExpressionEventPathDotNotation = { computed: false, path: string };\nexport type ExpressionEventPathBracketNotation = { computed: true, path: string, computedPath: ExpressionEventPath[][] };\nexport type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEventPathBracketNotation;\nexport type ExpressionEventMap = { [key: string]: ExpressionEventMap };\n\nexport interface ExpressionNode {\n\n\t/**\n\t * The `type` field is a string representing the AST variant type.\n\t * Each subtype of `Node` is documented below with the specific string of its type field.\n\t * You can use this field to determine which interface a node implements.\n\t */\n\ttype: string;\n\n\t/**\n\t * The `loc` field represents the source location information of the node.\n\t * If the node contains no information about the source location,\n\t * the field is `null` or `undefined`;\n\t * otherwise it is an object consisting of \n\t * a start position (the position of the first character of the parsed source region)\n\t * and an end position (the position of the first character after the parsed source region):\n\t * and offset index (the position of the first character) \n\t */\n\tloc?: SourceLocation;\n\n\t/**\n\t * start and end position offset\n\t */\n\trange?: [number, number];\n\n\t/**\n\t * assign the value to this expression in stack.\n\t * \n\t * most ExpressionNode will not implement this method, and will throw an exception.\n\t * @param stack \n\t * @param value \n\t */\n\tset(stack: Stack, value: any): any;\n\n\t/**\n\t * execute/get the code for this expression and return the result value.\n\t * @param stack \n\t * @param thisContext \n\t */\n\tget(stack: Stack, thisContext?: any): any;\n\n\t/**\n\t * get all dependencies form an expression node\n\t *\n\t * the return from this method, is represent an answer for what identifiers this expression depends-on.\n\t * \n\t *\n\t * ex:\n\t * ```js\n\t * x + y;\n\t * ```\n\t *\n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier:\tthe answer should be node `x`,\n\t * - for `y` identifier:\tthe answer should be node `y`.\n\t *\n\t * so, the return from `+` will be `[ node 'x', node 'y']`\n\t *\n\t * and:\n\t * - `x.y.z * a` ==> `[ member node `x.y.z`, identifier 'a']`\n\t * @param computed\n\t */\n\tdependency(computed?: true): ExpressionNode[];\n\n\t/**\n\t * ex:\n\t * ```js\n\t * x + y;\n\t * ```\n\t *\n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier:\tthe answer should be node `x`,\n\t * - for `y` identifier:\tthe answer should be node `y`.\n\t *\n\t * so, the return from `+` will be `['x', 'y']`\n\t *\n\t * and:\n\t * - `x.y.z` ==> `['x', 'y', 'z']`\n\t * - `x[y].z` ==> ['x', ]\n\t * @param computed required for member and chaining operators\n\t */\n\tdependencyPath(computed?: true): ExpressionEventPath[];\n\n\t/**\n\t * get all the events form this expression\n\t * \n\t * the return from this method, is represent an answer for what is this expression depends-on as identifier name\n\t * \n\t * ex: \n\t * ```js\n\t * x + y;\n\t * ```\n\t * \n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier: the answer should be `x`\n\t * - for `y` identifier: the answer should be `y`\n\t * the final output will be \n\t * \n\t * so, the return from `+` will be `{ x: undefined, y: undefined }`\n\t * \n\t * and:\n\t * - `x.y.z * a` ==> `{ x: { y: { z: undefined }, a: undefined } }`\n\t * - `x.y.z > x.y.h.g` ==> `{ x: { y: { z: undefined, h: { g: undefined} } } }`\n\t * - `x[Symbol.toStringTag] + 'Class' + classType + array[3]` ==> `{ x: { 'Symbol.toStringTag': undefined }, classType: undefined, array: { 3: undefined } }`\n\t * - `'name'` ==> {}\n\t * - ```js\n\t * user[firstName + `son of ${fatherName}`]\n\t * ``` ==> `{ user: { 'firstName:fatherName': undefined }, firstName: undefined, fatherName: undefined }`\n\t * @param parent \n\t */\n\tevents(): ExpressionEventMap;\n\n\n\t/**\n\t * re-write this expression as a javascript source \n\t */\n\ttoString(): string;\n\n\t/**\n\t * used to map this object to represent an [ESTree](https://github.com/estree/estree) json object\n\t * @param key \n\t */\n\ttoJSON(): NodeJsonType;\n\n\t/**\n\t * just a helper method to force class that implement this interface to\n\t * have a static method `fromJSON` to help reconstruct this ExpressionNode\n\t * from an [ESTree](https://github.com/estree/estree) json object,\n\t * with all necessary implementation to execute the code\n\t */\n\tgetClass(): ExpressionNodConstructor<ExpressionNode>;\n}\n\nexport type NodeDeserializer<N = ExpressionNode> = (node: N) => N;\n\nexport type VisitNodeType = (expression: ExpressionNode) => void;\n\n/**\n * this is how to:\n * describe a class with it's static functions and properties\n * in the interface add getClass method\n */\nexport interface ExpressionNodConstructor<N extends ExpressionNode> extends TypeOf<N> {\n\n\t/**\n\t * the type of an expression\n\t */\n\ttype: string;\n\n\t/**\n\t * build expression node from [ESTree](https://github.com/estree/estree) json object\n\t * @param node \n\t * @param deserializer \n\t */\n\tfromJSON(node: N, deserializer: NodeDeserializer): N;\n\n\t/**\n\t * visit nodes inside expression\n\t * @param expression \n\t * @param callback \n\t */\n\tvisit?(node: N, visitNode: Object): void;\n}\n\nexport interface DeclarationExpression extends ExpressionNode {\n\t/**\n\t * declare variable in the current local scope (block),\n\t * or closest function scope (global) scop,\n\t * the propertyName will be calculated at runtime\n\t * @param stack the stack which an identifier will be declared\n\t * @param propertyValue the initial value of identifier\n\t * @param scope which scop to declare this identifier\n\t */\n\tdeclareVariable(stack: Stack, propertyValue?: any): any;\n\n\t/**\n\t * get the variable declaration name\n\t */\n\tgetDeclarationName?(): string;\n}\n\n\n/**\n * An interface meant to be implemented by MemberExpression,\n * Identifier and ChainExpression and all Literal expressions\n */\nexport interface CanFindScope {\n\t/**\n\t * try to search for scope of this expression\n\t * @param stack \n\t */\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined;\n}\n"]}
1
+ {"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../src/expressions/api/expression.ts"],"names":[],"mappings":"","sourcesContent":["import type { Scope, Context } from '../scope/scope.js';\nimport type { Stack } from '../scope/stack.js';\nimport { TypeOf } from './utils.js';\n\n\n/**\n * Each Position object consists of \n * a line number (1-indexed) \n * and a column number (0-indexed)\n */\nexport interface Position {\n\tline: number; // >= 1\n\tcolumn: number; // >= 0\n}\n\nexport interface SourceLocation {\n\tsource?: string | null;\n\tstart: Position;\n\tend: Position;\n}\n\nexport type NodeType = { type: string };\nexport type NodeJsonType = { [key: string]: any } & NodeType;\n\nexport type ExpressionEventPathDotNotation = { computed: false, path: string };\nexport type ExpressionEventPathBracketNotation = { computed: true, path: string, computedPath: ExpressionEventPath[][] };\nexport type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEventPathBracketNotation;\nexport type ExpressionEventMap = { [key: string]: ExpressionEventMap };\n\nexport type DeclarationType = 'HoistableDeclaration' | 'ClassDeclaration' | 'LexicalDeclaration';\nexport type HoistableDeclaration =\n\t| 'FunctionDeclaration'\n\t| 'GeneratorDeclaration'\n\t| 'AsyncFunctionDeclaration'\n\t| 'AsyncGeneratorDeclaration';\n\nexport type LexicalDeclaration = 'Let' | 'Const';\n\n\nexport interface ExpressionNode {\n\n\t/**\n\t * The `type` field is a string representing the AST variant type.\n\t * Each subtype of `Node` is documented below with the specific string of its type field.\n\t * You can use this field to determine which interface a node implements.\n\t */\n\ttype: string;\n\n\t/**\n\t * The `loc` field represents the source location information of the node.\n\t * If the node contains no information about the source location,\n\t * the field is `null` or `undefined`;\n\t * otherwise it is an object consisting of \n\t * a start position (the position of the first character of the parsed source region)\n\t * and an end position (the position of the first character after the parsed source region):\n\t * and offset index (the position of the first character) \n\t */\n\tloc?: SourceLocation;\n\n\t/**\n\t * start and end position offset\n\t */\n\trange?: [number, number];\n\n\t/**\n\t * assign the value to this expression in stack.\n\t * \n\t * most ExpressionNode will not implement this method, and will throw an exception.\n\t * @param stack \n\t * @param value \n\t */\n\tset(stack: Stack, value: any): any;\n\n\t/**\n\t * execute/get the code for this expression and return the result value.\n\t * @param stack \n\t * @param thisContext \n\t */\n\tget(stack: Stack, thisContext?: any): any;\n\n\t/**\n\t * get all dependencies form an expression node\n\t *\n\t * the return from this method, is represent an answer for what identifiers this expression depends-on.\n\t * \n\t *\n\t * ex:\n\t * ```js\n\t * x + y;\n\t * ```\n\t *\n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier:\tthe answer should be node `x`,\n\t * - for `y` identifier:\tthe answer should be node `y`.\n\t *\n\t * so, the return from `+` will be `[ node 'x', node 'y']`\n\t *\n\t * and:\n\t * - `x.y.z * a` ==> `[ member node `x.y.z`, identifier 'a']`\n\t * @param computed\n\t */\n\tdependency(computed?: true): ExpressionNode[];\n\n\t/**\n\t * ex:\n\t * ```js\n\t * x + y;\n\t * ```\n\t *\n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier:\tthe answer should be node `x`,\n\t * - for `y` identifier:\tthe answer should be node `y`.\n\t *\n\t * so, the return from `+` will be `['x', 'y']`\n\t *\n\t * and:\n\t * - `x.y.z` ==> `['x', 'y', 'z']`\n\t * - `x[y].z` ==> ['x', ]\n\t * @param computed required for member and chaining operators\n\t */\n\tdependencyPath(computed?: true): ExpressionEventPath[];\n\n\t/**\n\t * get all the events form this expression\n\t * \n\t * the return from this method, is represent an answer for what is this expression depends-on as identifier name\n\t * \n\t * ex: \n\t * ```js\n\t * x + y;\n\t * ```\n\t * \n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier: the answer should be `x`\n\t * - for `y` identifier: the answer should be `y`\n\t * the final output will be \n\t * \n\t * so, the return from `+` will be `{ x: undefined, y: undefined }`\n\t * \n\t * and:\n\t * - `x.y.z * a` ==> `{ x: { y: { z: undefined }, a: undefined } }`\n\t * - `x.y.z > x.y.h.g` ==> `{ x: { y: { z: undefined, h: { g: undefined} } } }`\n\t * - `x[Symbol.toStringTag] + 'Class' + classType + array[3]` ==> `{ x: { 'Symbol.toStringTag': undefined }, classType: undefined, array: { 3: undefined } }`\n\t * - `'name'` ==> {}\n\t * - ```js\n\t * user[firstName + `son of ${fatherName}`]\n\t * ``` ==> `{ user: { 'firstName:fatherName': undefined }, firstName: undefined, fatherName: undefined }`\n\t * @param parent \n\t */\n\tevents(): ExpressionEventMap;\n\n\n\t/**\n\t * re-write this expression as a javascript source \n\t */\n\ttoString(): string;\n\n\t/**\n\t * used to map this object to represent an [ESTree](https://github.com/estree/estree) json object\n\t * @param key \n\t */\n\ttoJSON(): NodeJsonType;\n\n\t/**\n\t * just a helper method to force class that implement this interface to\n\t * have a static method `fromJSON` to help reconstruct this ExpressionNode\n\t * from an [ESTree](https://github.com/estree/estree) json object,\n\t * with all necessary implementation to execute the code\n\t */\n\tgetClass(): ExpressionNodConstructor<ExpressionNode>;\n}\n\nexport type NodeDeserializer<N = ExpressionNode> = (node: N) => N;\n\nexport type VisitNodeType = (expression: ExpressionNode) => void;\n\n/**\n * this is how to:\n * describe a class with it's static functions and properties\n * in the interface add getClass method\n */\nexport interface ExpressionNodConstructor<N extends ExpressionNode> extends TypeOf<N> {\n\n\t/**\n\t * the type of an expression\n\t */\n\ttype: string;\n\n\t/**\n\t * build expression node from [ESTree](https://github.com/estree/estree) json object\n\t * @param node \n\t * @param deserializer \n\t */\n\tfromJSON(node: N, deserializer: NodeDeserializer): N;\n\n\t/**\n\t * visit nodes inside expression\n\t * @param expression \n\t * @param callback \n\t */\n\tvisit?(node: N, visitNode: Object): void;\n}\n\nexport interface DeclarationExpression extends ExpressionNode {\n\t/**\n\t * declare variable in the current local scope (block),\n\t * or closest function scope (global) scop,\n\t * the propertyName will be calculated at runtime\n\t * @param stack the stack which an identifier will be declared\n\t * @param propertyValue the initial value of identifier\n\t * @param scope which scop to declare this identifier\n\t */\n\tdeclareVariable(stack: Stack, propertyValue?: any): any;\n\n\t/**\n\t * get the variable declaration name\n\t */\n\tgetDeclarationName?(): string;\n}\n\n\n/**\n * An interface meant to be implemented by MemberExpression,\n * Identifier and ChainExpression and all Literal expressions\n */\nexport interface CanFindScope {\n\t/**\n\t * try to search for scope of this expression\n\t * @param stack \n\t */\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined;\n}\n"]}
@@ -19,15 +19,19 @@ export class ModuleSpecifier extends AbstractExpressionNode {
19
19
  };
20
20
  }
21
21
  }
22
- export let ImportAttribute = (() => {
22
+ let ImportAttribute = (() => {
23
23
  let _classDecorators = [Deserializer('ImportAttribute')];
24
24
  let _classDescriptor;
25
25
  let _classExtraInitializers = [];
26
26
  let _classThis;
27
- var ImportAttribute = class extends AbstractExpressionNode {
27
+ let _classSuper = AbstractExpressionNode;
28
+ var ImportAttribute = class extends _classSuper {
29
+ static { _classThis = this; }
28
30
  static {
29
- __esDecorate(null, _classDescriptor = { value: this }, _classDecorators, { kind: "class", name: this.name }, null, _classExtraInitializers);
31
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
32
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
30
33
  ImportAttribute = _classThis = _classDescriptor.value;
34
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
31
35
  __runInitializers(_classThis, _classExtraInitializers);
32
36
  }
33
37
  key;
@@ -76,4 +80,5 @@ export let ImportAttribute = (() => {
76
80
  };
77
81
  return ImportAttribute = _classThis;
78
82
  })();
83
+ export { ImportAttribute };
79
84
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/common.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,OAAgB,eAAgB,SAAQ,sBAAsB;IAC7C;IAAtB,YAAsB,KAAiB,EAAE,KAAwB,EAAE,GAAoB;QACtF,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QADG,UAAK,GAAL,KAAK,CAAY;IAEvC,CAAC;IACD,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,YAAY;QACX,OAAO,IAAI,CAAC,K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AG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAC/B,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;QACzB,CAAC;QACD,UAAU,CAAC,QAAe;YACzB,OAAO,EAAE,CAAC;QACX,CAAC;QACD,cAAc,CAAC,QAAe;YAC7B,OAAO,EAAE,CAAC;QACX,CAAC;QACD,QAAQ;YACP,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC3D,CAAC;QACD,MAAM;YACL,OAAO;gBACN,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;gBACtB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;aAC1B,CAAC;QACH,CAAC;;WAjDW,eAAe","sourcesContent":["import type {\n\tExpressionEventPath, ExpressionNode, NodeDeserializer,\n\tSourceLocation, VisitNodeType\n} from '../expression.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\nexport abstract class ModuleSpecifier extends AbstractExpressionNode {\n\tconstructor(protected local: Identifier, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetLocal() {\n\t\treturn this.local;\n\t}\n\tgetLocalName() {\n\t\treturn this.local.getName();\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON()\n\t\t};\n\t}\n}\n\n\n\n@Deserializer('ImportAttribute')\nexport class ImportAttribute extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportAttribute, deserializer: NodeDeserializer): ImportAttribute {\n\t\treturn new ImportAttribute(\n\t\t\tdeserializer(node.key) as Identifier,\n\t\t\tdeserializer(node.value) as Literal<string>,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ImportAttribute, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.key);\n\t\tvisitNode(node.value);\n\t}\n\n\tconstructor(\n\t\tprivate key: Identifier | Literal<string>,\n\t\tprivate value: Literal<string>,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetKey() {\n\t\treturn this.key;\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any): { [key: string]: string } {\n\t\tconst key = this.key.get(stack);\n\t\tconst value = this.value.get();\n\t\treturn { [key]: value };\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\treturn `${this.key.toString()}: ${this.value.toString()}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tkey: this.key.toJSON(),\n\t\t\tvalue: this.value.toJSON(),\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/common.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,OAAgB,eAAgB,SAAQ,sBAAsB;IAC7C;IAAtB,YAAsB,KAAiB,EAAE,KAAwB,EAAE,GAAoB;QACtF,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QADG,UAAK,GAAL,KAAK,CAAY;IAEvC,CAAC;IACD,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,YAAY;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM;QACL,OAAO;YACN,KAAK,EAAE,IAA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,CAAC;QACzB,CAAC;QACD,UAAU,CAAC,QAAe;YACzB,OAAO,EAAE,CAAC;QACX,CAAC;QACD,cAAc,CAAC,QAAe;YAC7B,OAAO,EAAE,CAAC;QACX,CAAC;QACD,QAAQ;YACP,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC3D,CAAC;QACD,MAAM;YACL,OAAO;gBACN,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;gBACtB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;aAC1B,CAAC;QACH,CAAC;;;;SAjDW,eAAe","sourcesContent":["import type {\n\tExpressionEventPath, ExpressionNode, NodeDeserializer,\n\tSourceLocation, VisitNodeType\n} from '../expression.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\nexport abstract class ModuleSpecifier extends AbstractExpressionNode {\n\tconstructor(protected local: Identifier, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetLocal() {\n\t\treturn this.local;\n\t}\n\tgetLocalName() {\n\t\treturn this.local.getName();\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON()\n\t\t};\n\t}\n}\n\n\n\n@Deserializer('ImportAttribute')\nexport class ImportAttribute extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportAttribute, deserializer: NodeDeserializer): ImportAttribute {\n\t\treturn new ImportAttribute(\n\t\t\tdeserializer(node.key) as Identifier,\n\t\t\tdeserializer(node.value) as Literal<string>,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ImportAttribute, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.key);\n\t\tvisitNode(node.value);\n\t}\n\n\tconstructor(\n\t\tprivate key: Identifier | Literal<string>,\n\t\tprivate value: Literal<string>,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetKey() {\n\t\treturn this.key;\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any): { [key: string]: string } {\n\t\tconst key = this.key.get(stack);\n\t\tconst value = this.value.get();\n\t\treturn { [key]: value };\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\treturn `${this.key.toString()}: ${this.value.toString()}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tkey: this.key.toJSON(),\n\t\t\tvalue: this.value.toJSON(),\n\t\t};\n\t}\n}\n"]}
@@ -50,15 +50,19 @@ import { ModuleSpecifier } from './common.js';
50
50
  * such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`,
51
51
  * and the `local` field is an `Identifier` node representing `bar`.
52
52
  */
53
- export let ExportSpecifier = (() => {
53
+ let ExportSpecifier = (() => {
54
54
  let _classDecorators = [Deserializer('ExportSpecifier')];
55
55
  let _classDescriptor;
56
56
  let _classExtraInitializers = [];
57
57
  let _classThis;
58
- var ExportSpecifier = class extends ModuleSpecifier {
58
+ let _classSuper = ModuleSpecifier;
59
+ var ExportSpecifier = class extends _classSuper {
60
+ static { _classThis = this; }
59
61
  static {
60
- __esDecorate(null, _classDescriptor = { value: this }, _classDecorators, { kind: "class", name: this.name }, null, _classExtraInitializers);
62
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
63
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
61
64
  ExportSpecifier = _classThis = _classDescriptor.value;
65
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
62
66
  __runInitializers(_classThis, _classExtraInitializers);
63
67
  }
64
68
  exported;
@@ -105,6 +109,7 @@ export let ExportSpecifier = (() => {
105
109
  };
106
110
  return ExportSpecifier = _classThis;
107
111
  })();
112
+ export { ExportSpecifier };
108
113
  /**
109
114
  * An export named declaration, e.g.,
110
115
  * `export {foo, bar};`,
@@ -113,16 +118,20 @@ export let ExportSpecifier = (() => {
113
118
  *
114
119
  * Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.
115
120
  */
116
- export let ExportNamedDeclaration = (() => {
117
- let _classDecorators_1 = [Deserializer('ExportNamedDeclaration')];
118
- let _classDescriptor_1;
119
- let _classExtraInitializers_1 = [];
120
- let _classThis_1;
121
- var ExportNamedDeclaration = class extends AbstractExpressionNode {
121
+ let ExportNamedDeclaration = (() => {
122
+ let _classDecorators = [Deserializer('ExportNamedDeclaration')];
123
+ let _classDescriptor;
124
+ let _classExtraInitializers = [];
125
+ let _classThis;
126
+ let _classSuper = AbstractExpressionNode;
127
+ var ExportNamedDeclaration = class extends _classSuper {
128
+ static { _classThis = this; }
122
129
  static {
123
- __esDecorate(null, _classDescriptor_1 = { value: this }, _classDecorators_1, { kind: "class", name: this.name }, null, _classExtraInitializers_1);
124
- ExportNamedDeclaration = _classThis_1 = _classDescriptor_1.value;
125
- __runInitializers(_classThis_1, _classExtraInitializers_1);
130
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
131
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
132
+ ExportNamedDeclaration = _classThis = _classDescriptor.value;
133
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
134
+ __runInitializers(_classThis, _classExtraInitializers);
126
135
  }
127
136
  specifiers;
128
137
  declaration;
@@ -256,23 +265,28 @@ export let ExportNamedDeclaration = (() => {
256
265
  };
257
266
  }
258
267
  };
259
- return ExportNamedDeclaration = _classThis_1;
268
+ return ExportNamedDeclaration = _classThis;
260
269
  })();
270
+ export { ExportNamedDeclaration };
261
271
  /**
262
272
  * An export default declaration, e.g.,
263
273
  * `export default function () {};`
264
274
  * or `export default 1;`.
265
275
  */
266
- export let ExportDefaultDeclaration = (() => {
267
- let _classDecorators_2 = [Deserializer('ExportDefaultDeclaration')];
268
- let _classDescriptor_2;
269
- let _classExtraInitializers_2 = [];
270
- let _classThis_2;
271
- var ExportDefaultDeclaration = class extends AbstractExpressionNode {
276
+ let ExportDefaultDeclaration = (() => {
277
+ let _classDecorators = [Deserializer('ExportDefaultDeclaration')];
278
+ let _classDescriptor;
279
+ let _classExtraInitializers = [];
280
+ let _classThis;
281
+ let _classSuper = AbstractExpressionNode;
282
+ var ExportDefaultDeclaration = class extends _classSuper {
283
+ static { _classThis = this; }
272
284
  static {
273
- __esDecorate(null, _classDescriptor_2 = { value: this }, _classDecorators_2, { kind: "class", name: this.name }, null, _classExtraInitializers_2);
274
- ExportDefaultDeclaration = _classThis_2 = _classDescriptor_2.value;
275
- __runInitializers(_classThis_2, _classExtraInitializers_2);
285
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
286
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
287
+ ExportDefaultDeclaration = _classThis = _classDescriptor.value;
288
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
289
+ __runInitializers(_classThis, _classExtraInitializers);
276
290
  }
277
291
  declaration;
278
292
  static fromJSON(node, deserializer) {
@@ -311,21 +325,26 @@ export let ExportDefaultDeclaration = (() => {
311
325
  };
312
326
  }
313
327
  };
314
- return ExportDefaultDeclaration = _classThis_2;
328
+ return ExportDefaultDeclaration = _classThis;
315
329
  })();
330
+ export { ExportDefaultDeclaration };
316
331
  /**
317
332
  * An export batch declaration, e.g., `export * from "mod";`.
318
333
  */
319
- export let ExportAllDeclaration = (() => {
320
- let _classDecorators_3 = [Deserializer('ExportAllDeclaration')];
321
- let _classDescriptor_3;
322
- let _classExtraInitializers_3 = [];
323
- let _classThis_3;
324
- var ExportAllDeclaration = class extends AbstractExpressionNode {
334
+ let ExportAllDeclaration = (() => {
335
+ let _classDecorators = [Deserializer('ExportAllDeclaration')];
336
+ let _classDescriptor;
337
+ let _classExtraInitializers = [];
338
+ let _classThis;
339
+ let _classSuper = AbstractExpressionNode;
340
+ var ExportAllDeclaration = class extends _classSuper {
341
+ static { _classThis = this; }
325
342
  static {
326
- __esDecorate(null, _classDescriptor_3 = { value: this }, _classDecorators_3, { kind: "class", name: this.name }, null, _classExtraInitializers_3);
327
- ExportAllDeclaration = _classThis_3 = _classDescriptor_3.value;
328
- __runInitializers(_classThis_3, _classExtraInitializers_3);
343
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
344
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
345
+ ExportAllDeclaration = _classThis = _classDescriptor.value;
346
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
347
+ __runInitializers(_classThis, _classExtraInitializers);
329
348
  }
330
349
  source;
331
350
  exported;
@@ -402,6 +421,7 @@ export let ExportAllDeclaration = (() => {
402
421
  };
403
422
  }
404
423
  };
405
- return ExportAllDeclaration = _classThis_3;
424
+ return ExportAllDeclaration = _classThis;
406
425
  })();
426
+ export { ExportAllDeclaration };
407
427
  //# sourceMappingURL=export.js.map