@ibyar/expressions 0.5.1 → 0.5.6

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 (187) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -4
  3. package/api/abstract.d.ts +5 -6
  4. package/api/abstract.js +3 -3
  5. package/api/abstract.js.map +1 -1
  6. package/api/class/class.d.ts +202 -0
  7. package/api/class/class.js +635 -0
  8. package/api/class/class.js.map +1 -0
  9. package/api/class/decorator.d.ts +20 -0
  10. package/api/class/decorator.js +48 -0
  11. package/api/class/decorator.js.map +1 -0
  12. package/api/computing/call.d.ts +3 -1
  13. package/api/computing/call.js +16 -4
  14. package/api/computing/call.js.map +1 -1
  15. package/api/computing/debugger.d.ts +15 -0
  16. package/api/computing/debugger.js +35 -0
  17. package/api/computing/debugger.js.map +1 -0
  18. package/api/computing/new.d.ts +2 -1
  19. package/api/computing/new.js +4 -0
  20. package/api/computing/new.js.map +1 -1
  21. package/api/computing/rest.d.ts +6 -6
  22. package/api/computing/rest.js +5 -2
  23. package/api/computing/rest.js.map +1 -1
  24. package/api/computing/return.d.ts +2 -1
  25. package/api/computing/return.js +3 -0
  26. package/api/computing/return.js.map +1 -1
  27. package/api/computing/spread.d.ts +2 -1
  28. package/api/computing/spread.js +5 -2
  29. package/api/computing/spread.js.map +1 -1
  30. package/api/computing/throw.d.ts +2 -1
  31. package/api/computing/throw.js +3 -0
  32. package/api/computing/throw.js.map +1 -1
  33. package/api/computing/yield.d.ts +2 -1
  34. package/api/computing/yield.js +3 -0
  35. package/api/computing/yield.js.map +1 -1
  36. package/api/definition/array.d.ts +12 -12
  37. package/api/definition/array.js +31 -25
  38. package/api/definition/array.js.map +1 -1
  39. package/api/definition/bind.d.ts +2 -2
  40. package/api/definition/bind.js +1 -1
  41. package/api/definition/bind.js.map +1 -1
  42. package/api/definition/function.d.ts +40 -51
  43. package/api/definition/function.js +291 -309
  44. package/api/definition/function.js.map +1 -1
  45. package/api/definition/member.d.ts +2 -2
  46. package/api/definition/member.js +1 -1
  47. package/api/definition/member.js.map +1 -1
  48. package/api/definition/object.d.ts +15 -12
  49. package/api/definition/object.js +43 -13
  50. package/api/definition/object.js.map +1 -1
  51. package/api/definition/statement.d.ts +2 -2
  52. package/api/definition/statement.js +7 -3
  53. package/api/definition/statement.js.map +1 -1
  54. package/api/definition/values.d.ts +35 -50
  55. package/api/definition/values.js +66 -149
  56. package/api/definition/values.js.map +1 -1
  57. package/api/deserialize/deserialize.d.ts +2 -1
  58. package/api/deserialize/deserialize.js +4 -1
  59. package/api/deserialize/deserialize.js.map +1 -1
  60. package/api/deserialize/type-store.d.ts +2 -2
  61. package/api/deserialize/type-store.js.map +1 -1
  62. package/api/expression.d.ts +13 -18
  63. package/api/expression.js.map +1 -1
  64. package/api/index.d.ts +2 -0
  65. package/api/index.js +2 -0
  66. package/api/index.js.map +1 -1
  67. package/api/module/common.d.ts +29 -0
  68. package/api/module/common.js +71 -0
  69. package/api/module/common.js.map +1 -0
  70. package/api/module/export.d.ts +66 -25
  71. package/api/module/export.js +270 -58
  72. package/api/module/export.js.map +1 -1
  73. package/api/module/import.d.ts +61 -25
  74. package/api/module/import.js +226 -68
  75. package/api/module/import.js.map +1 -1
  76. package/api/operators/assignment.d.ts +2 -2
  77. package/api/operators/assignment.js +1 -1
  78. package/api/operators/assignment.js.map +1 -1
  79. package/api/operators/await.d.ts +2 -2
  80. package/api/operators/await.js +1 -1
  81. package/api/operators/await.js.map +1 -1
  82. package/api/operators/binary.d.ts +2 -2
  83. package/api/operators/binary.js +1 -1
  84. package/api/operators/binary.js.map +1 -1
  85. package/api/operators/chaining.d.ts +2 -2
  86. package/api/operators/chaining.js +1 -1
  87. package/api/operators/chaining.js.map +1 -1
  88. package/api/operators/comma.d.ts +2 -2
  89. package/api/operators/comma.js +2 -2
  90. package/api/operators/comma.js.map +1 -1
  91. package/api/operators/grouping.d.ts +2 -2
  92. package/api/operators/grouping.js +1 -1
  93. package/api/operators/grouping.js.map +1 -1
  94. package/api/operators/logical.d.ts +2 -2
  95. package/api/operators/logical.js +1 -1
  96. package/api/operators/logical.js.map +1 -1
  97. package/api/operators/pipeline.d.ts +2 -2
  98. package/api/operators/pipeline.js +1 -1
  99. package/api/operators/pipeline.js.map +1 -1
  100. package/api/operators/ternary.d.ts +2 -2
  101. package/api/operators/ternary.js +1 -1
  102. package/api/operators/ternary.js.map +1 -1
  103. package/api/operators/unary.d.ts +3 -3
  104. package/api/operators/unary.js +4 -3
  105. package/api/operators/unary.js.map +1 -1
  106. package/api/operators/update.d.ts +2 -2
  107. package/api/operators/update.js +1 -1
  108. package/api/operators/update.js.map +1 -1
  109. package/api/{app/program.d.ts → program.d.ts} +8 -9
  110. package/api/program.js +45 -0
  111. package/api/program.js.map +1 -0
  112. package/api/statement/control/block.d.ts +4 -5
  113. package/api/statement/control/block.js +22 -23
  114. package/api/statement/control/block.js.map +1 -1
  115. package/api/statement/control/empty.d.ts +1 -1
  116. package/api/statement/control/empty.js.map +1 -1
  117. package/api/statement/control/if.d.ts +2 -2
  118. package/api/statement/control/if.js +1 -1
  119. package/api/statement/control/if.js.map +1 -1
  120. package/api/statement/control/switch.d.ts +4 -5
  121. package/api/statement/control/switch.js +13 -9
  122. package/api/statement/control/switch.js.map +1 -1
  123. package/api/statement/control/terminate.d.ts +38 -13
  124. package/api/statement/control/terminate.js +81 -20
  125. package/api/statement/control/terminate.js.map +1 -1
  126. package/api/statement/declarations/declares.d.ts +17 -16
  127. package/api/statement/declarations/declares.js +24 -19
  128. package/api/statement/declarations/declares.js.map +1 -1
  129. package/api/statement/iterations/for.d.ts +5 -5
  130. package/api/statement/iterations/for.js +29 -23
  131. package/api/statement/iterations/for.js.map +1 -1
  132. package/api/statement/iterations/while.d.ts +3 -3
  133. package/api/statement/iterations/while.js +17 -13
  134. package/api/statement/iterations/while.js.map +1 -1
  135. package/api/utils.d.ts +5 -0
  136. package/api/utils.js +4 -0
  137. package/api/utils.js.map +1 -0
  138. package/package.json +5 -5
  139. package/scope/event.d.ts +2 -2
  140. package/scope/event.js +8 -14
  141. package/scope/event.js.map +1 -1
  142. package/scope/finalizer.d.ts +4 -0
  143. package/scope/finalizer.js +11 -0
  144. package/scope/finalizer.js.map +1 -0
  145. package/scope/proxy.d.ts +2 -3
  146. package/scope/proxy.js +22 -26
  147. package/scope/proxy.js.map +1 -1
  148. package/scope/scope.d.ts +42 -53
  149. package/scope/scope.js +73 -143
  150. package/scope/scope.js.map +1 -1
  151. package/scope/stack.d.ts +43 -26
  152. package/scope/stack.js +148 -102
  153. package/scope/stack.js.map +1 -1
  154. package/v8/enums.d.ts +204 -0
  155. package/v8/enums.js +375 -0
  156. package/v8/enums.js.map +1 -0
  157. package/v8/index.d.ts +2 -1
  158. package/v8/index.js +2 -1
  159. package/v8/index.js.map +1 -1
  160. package/v8/inline.d.ts +177 -0
  161. package/v8/inline.js +1973 -0
  162. package/v8/inline.js.map +1 -0
  163. package/v8/nodes.d.ts +8 -7
  164. package/v8/nodes.js +37 -63
  165. package/v8/nodes.js.map +1 -1
  166. package/v8/parser.d.ts +41 -151
  167. package/v8/parser.js +507 -1578
  168. package/v8/parser.js.map +1 -1
  169. package/v8/stream.d.ts +35 -3
  170. package/v8/stream.js +616 -164
  171. package/v8/stream.js.map +1 -1
  172. package/v8/token.d.ts +15 -9
  173. package/v8/token.js +79 -46
  174. package/v8/token.js.map +1 -1
  175. package/visit/visitor.js +4 -7
  176. package/visit/visitor.js.map +1 -1
  177. package/api/app/class.d.ts +0 -117
  178. package/api/app/class.js +0 -292
  179. package/api/app/class.js.map +0 -1
  180. package/api/app/program.js +0 -39
  181. package/api/app/program.js.map +0 -1
  182. package/api/module/module.d.ts +0 -26
  183. package/api/module/module.js +0 -63
  184. package/api/module/module.js.map +0 -1
  185. package/v8/app.d.ts +0 -0
  186. package/v8/app.js +0 -2
  187. package/v8/app.js.map +0 -1
package/v8/enums.js ADDED
@@ -0,0 +1,375 @@
1
+ import { Token } from './token.js';
2
+ export function isInRange(num, start, end) {
3
+ return num >= start && num <= end;
4
+ }
5
+ export var ParsingArrowHeadFlag;
6
+ (function (ParsingArrowHeadFlag) {
7
+ ParsingArrowHeadFlag[ParsingArrowHeadFlag["CertainlyNotArrowHead"] = 0] = "CertainlyNotArrowHead";
8
+ ParsingArrowHeadFlag[ParsingArrowHeadFlag["MaybeArrowHead"] = 1] = "MaybeArrowHead";
9
+ ParsingArrowHeadFlag[ParsingArrowHeadFlag["AsyncArrowFunction"] = 2] = "AsyncArrowFunction";
10
+ })(ParsingArrowHeadFlag || (ParsingArrowHeadFlag = {}));
11
+ export var PropertyKind;
12
+ (function (PropertyKind) {
13
+ PropertyKind[PropertyKind["Value"] = 0] = "Value";
14
+ PropertyKind[PropertyKind["Shorthand"] = 1] = "Shorthand";
15
+ PropertyKind[PropertyKind["ShorthandOrClassField"] = 2] = "ShorthandOrClassField";
16
+ PropertyKind[PropertyKind["Assign"] = 3] = "Assign";
17
+ PropertyKind[PropertyKind["Method"] = 4] = "Method";
18
+ PropertyKind[PropertyKind["ClassField"] = 5] = "ClassField";
19
+ PropertyKind[PropertyKind["AccessorGetter"] = 6] = "AccessorGetter";
20
+ PropertyKind[PropertyKind["AccessorSetter"] = 7] = "AccessorSetter";
21
+ PropertyKind[PropertyKind["Spread"] = 8] = "Spread";
22
+ PropertyKind[PropertyKind["NotSet"] = 9] = "NotSet";
23
+ })(PropertyKind || (PropertyKind = {}));
24
+ export function isAccessor(kind) {
25
+ return kind === PropertyKind.AccessorGetter || kind === PropertyKind.AccessorSetter;
26
+ }
27
+ export var PropertyPosition;
28
+ (function (PropertyPosition) {
29
+ PropertyPosition[PropertyPosition["ObjectLiteral"] = 0] = "ObjectLiteral";
30
+ PropertyPosition[PropertyPosition["ClassLiteral"] = 1] = "ClassLiteral";
31
+ })(PropertyPosition || (PropertyPosition = {}));
32
+ export class PropertyKindInfo {
33
+ constructor() {
34
+ this.position = PropertyPosition.ClassLiteral;
35
+ this.funcFlag = ParseFunctionFlag.IsNormal;
36
+ this.kind = PropertyKind.NotSet;
37
+ this.isComputedName = false;
38
+ this.isPrivate = false;
39
+ this.isStatic = false;
40
+ this.isRest = false;
41
+ }
42
+ parsePropertyKindFromToken(token) {
43
+ switch (token) {
44
+ case Token.COLON:
45
+ this.kind = PropertyKind.Value;
46
+ return true;
47
+ case Token.COMMA:
48
+ this.kind = PropertyKind.Shorthand;
49
+ return true;
50
+ case Token.RBRACE:
51
+ this.kind = PropertyKind.ShorthandOrClassField;
52
+ return true;
53
+ case Token.ASSIGN:
54
+ this.kind = PropertyKind.Assign;
55
+ return true;
56
+ case Token.LPAREN:
57
+ this.kind = PropertyKind.Method;
58
+ return true;
59
+ case Token.MUL:
60
+ case Token.SEMICOLON:
61
+ this.kind = PropertyKind.ClassField;
62
+ return true;
63
+ default:
64
+ break;
65
+ }
66
+ return false;
67
+ }
68
+ }
69
+ export var PreParserIdentifierType;
70
+ (function (PreParserIdentifierType) {
71
+ PreParserIdentifierType[PreParserIdentifierType["NullIdentifier"] = 0] = "NullIdentifier";
72
+ PreParserIdentifierType[PreParserIdentifierType["UnknownIdentifier"] = 1] = "UnknownIdentifier";
73
+ PreParserIdentifierType[PreParserIdentifierType["EvalIdentifier"] = 2] = "EvalIdentifier";
74
+ PreParserIdentifierType[PreParserIdentifierType["ArgumentsIdentifier"] = 3] = "ArgumentsIdentifier";
75
+ PreParserIdentifierType[PreParserIdentifierType["ConstructorIdentifier"] = 4] = "ConstructorIdentifier";
76
+ PreParserIdentifierType[PreParserIdentifierType["AwaitIdentifier"] = 5] = "AwaitIdentifier";
77
+ PreParserIdentifierType[PreParserIdentifierType["AsyncIdentifier"] = 6] = "AsyncIdentifier";
78
+ PreParserIdentifierType[PreParserIdentifierType["NameIdentifier"] = 7] = "NameIdentifier";
79
+ PreParserIdentifierType[PreParserIdentifierType["PrivateNameIdentifier"] = 8] = "PrivateNameIdentifier";
80
+ })(PreParserIdentifierType || (PreParserIdentifierType = {}));
81
+ export var FunctionBodyType;
82
+ (function (FunctionBodyType) {
83
+ FunctionBodyType[FunctionBodyType["EXPRESSION"] = 0] = "EXPRESSION";
84
+ FunctionBodyType[FunctionBodyType["BLOCK"] = 1] = "BLOCK";
85
+ })(FunctionBodyType || (FunctionBodyType = {}));
86
+ export var ParseFunctionFlag;
87
+ (function (ParseFunctionFlag) {
88
+ ParseFunctionFlag[ParseFunctionFlag["IsNormal"] = 0] = "IsNormal";
89
+ ParseFunctionFlag[ParseFunctionFlag["IsGenerator"] = 1] = "IsGenerator";
90
+ ParseFunctionFlag[ParseFunctionFlag["IsAsync"] = 2] = "IsAsync";
91
+ })(ParseFunctionFlag || (ParseFunctionFlag = {}));
92
+ export var FunctionKind;
93
+ (function (FunctionKind) {
94
+ FunctionKind[FunctionKind["NormalFunction"] = 0] = "NormalFunction";
95
+ FunctionKind[FunctionKind["Module"] = 1] = "Module";
96
+ FunctionKind[FunctionKind["AsyncModule"] = 2] = "AsyncModule";
97
+ FunctionKind[FunctionKind["BaseConstructor"] = 3] = "BaseConstructor";
98
+ FunctionKind[FunctionKind["DefaultBaseConstructor"] = 4] = "DefaultBaseConstructor";
99
+ FunctionKind[FunctionKind["DefaultDerivedConstructor"] = 5] = "DefaultDerivedConstructor";
100
+ FunctionKind[FunctionKind["DerivedConstructor"] = 6] = "DerivedConstructor";
101
+ FunctionKind[FunctionKind["GetterFunction"] = 7] = "GetterFunction";
102
+ FunctionKind[FunctionKind["StaticGetterFunction"] = 8] = "StaticGetterFunction";
103
+ FunctionKind[FunctionKind["SetterFunction"] = 9] = "SetterFunction";
104
+ FunctionKind[FunctionKind["StaticSetterFunction"] = 10] = "StaticSetterFunction";
105
+ FunctionKind[FunctionKind["ArrowFunction"] = 11] = "ArrowFunction";
106
+ FunctionKind[FunctionKind["AsyncArrowFunction"] = 12] = "AsyncArrowFunction";
107
+ FunctionKind[FunctionKind["AsyncFunction"] = 13] = "AsyncFunction";
108
+ FunctionKind[FunctionKind["AsyncConciseMethod"] = 14] = "AsyncConciseMethod";
109
+ FunctionKind[FunctionKind["StaticAsyncConciseMethod"] = 15] = "StaticAsyncConciseMethod";
110
+ FunctionKind[FunctionKind["AsyncConciseGeneratorMethod"] = 16] = "AsyncConciseGeneratorMethod";
111
+ FunctionKind[FunctionKind["StaticAsyncConciseGeneratorMethod"] = 17] = "StaticAsyncConciseGeneratorMethod";
112
+ FunctionKind[FunctionKind["AsyncGeneratorFunction"] = 18] = "AsyncGeneratorFunction";
113
+ FunctionKind[FunctionKind["GeneratorFunction"] = 19] = "GeneratorFunction";
114
+ FunctionKind[FunctionKind["ConciseGeneratorMethod"] = 20] = "ConciseGeneratorMethod";
115
+ FunctionKind[FunctionKind["StaticConciseGeneratorMethod"] = 21] = "StaticConciseGeneratorMethod";
116
+ FunctionKind[FunctionKind["ConciseMethod"] = 22] = "ConciseMethod";
117
+ FunctionKind[FunctionKind["StaticConciseMethod"] = 23] = "StaticConciseMethod";
118
+ FunctionKind[FunctionKind["ClassMembersInitializerFunction"] = 24] = "ClassMembersInitializerFunction";
119
+ FunctionKind[FunctionKind["ClassStaticInitializerFunction"] = 25] = "ClassStaticInitializerFunction";
120
+ FunctionKind[FunctionKind["Invalid"] = 26] = "Invalid";
121
+ FunctionKind[FunctionKind["LastFunctionKind"] = 25] = "LastFunctionKind";
122
+ })(FunctionKind || (FunctionKind = {}));
123
+ const FUNCTIONS_TYPES = [
124
+ [
125
+ [
126
+ FunctionKind.NormalFunction,
127
+ FunctionKind.AsyncFunction
128
+ ],
129
+ [
130
+ FunctionKind.GeneratorFunction,
131
+ FunctionKind.AsyncGeneratorFunction
132
+ ],
133
+ ],
134
+ [
135
+ [
136
+ FunctionKind.ConciseMethod,
137
+ FunctionKind.AsyncConciseMethod
138
+ ],
139
+ [
140
+ FunctionKind.ConciseGeneratorMethod,
141
+ FunctionKind.AsyncConciseGeneratorMethod
142
+ ],
143
+ ],
144
+ [
145
+ [
146
+ FunctionKind.StaticConciseMethod,
147
+ FunctionKind.StaticAsyncConciseMethod
148
+ ],
149
+ [
150
+ FunctionKind.StaticConciseGeneratorMethod,
151
+ FunctionKind.StaticAsyncConciseGeneratorMethod
152
+ ],
153
+ ]
154
+ ];
155
+ export var SubFunctionKind;
156
+ (function (SubFunctionKind) {
157
+ SubFunctionKind[SubFunctionKind["NormalFunction"] = 0] = "NormalFunction";
158
+ SubFunctionKind[SubFunctionKind["NonStaticMethod"] = 1] = "NonStaticMethod";
159
+ SubFunctionKind[SubFunctionKind["StaticMethod"] = 2] = "StaticMethod";
160
+ })(SubFunctionKind || (SubFunctionKind = {}));
161
+ export var StaticFlag;
162
+ (function (StaticFlag) {
163
+ StaticFlag[StaticFlag["NotStatic"] = 0] = "NotStatic";
164
+ StaticFlag[StaticFlag["Static"] = 1] = "Static";
165
+ })(StaticFlag || (StaticFlag = {}));
166
+ ;
167
+ export function functionKindForImpl(subFunctionKind, flags) {
168
+ return FUNCTIONS_TYPES[subFunctionKind][(flags & ParseFunctionFlag.IsGenerator) != 0 ? 1 : 0][(flags & ParseFunctionFlag.IsAsync) != 0 ? 1 : 0];
169
+ }
170
+ export function functionKindFor(isGenerator, isAsync) {
171
+ return FUNCTIONS_TYPES[SubFunctionKind.NormalFunction][isGenerator ? 1 : 0][isAsync ? 1 : 0];
172
+ }
173
+ export function methodKindFor(isStatic, isGenerator, isAsync) {
174
+ return FUNCTIONS_TYPES[isStatic ? SubFunctionKind.StaticMethod : SubFunctionKind.NonStaticMethod][isGenerator ? 1 : 0][isAsync ? 1 : 0];
175
+ }
176
+ export var FunctionSyntaxKind;
177
+ (function (FunctionSyntaxKind) {
178
+ FunctionSyntaxKind[FunctionSyntaxKind["AnonymousExpression"] = 0] = "AnonymousExpression";
179
+ FunctionSyntaxKind[FunctionSyntaxKind["NamedExpression"] = 1] = "NamedExpression";
180
+ FunctionSyntaxKind[FunctionSyntaxKind["Declaration"] = 2] = "Declaration";
181
+ FunctionSyntaxKind[FunctionSyntaxKind["AccessorOrMethod"] = 3] = "AccessorOrMethod";
182
+ FunctionSyntaxKind[FunctionSyntaxKind["Wrapped"] = 4] = "Wrapped";
183
+ FunctionSyntaxKind[FunctionSyntaxKind["LastFunctionSyntaxKind"] = 4] = "LastFunctionSyntaxKind";
184
+ })(FunctionSyntaxKind || (FunctionSyntaxKind = {}));
185
+ ;
186
+ export function isArrowFunction(kind) {
187
+ return isInRange(kind, FunctionKind.ArrowFunction, FunctionKind.AsyncArrowFunction);
188
+ }
189
+ export function isModule(kind) {
190
+ return isInRange(kind, FunctionKind.Module, FunctionKind.AsyncModule);
191
+ }
192
+ export function isAsyncModule(kind) {
193
+ return kind == FunctionKind.AsyncModule;
194
+ }
195
+ export function isAsyncGeneratorFunction(kind) {
196
+ return isInRange(kind, FunctionKind.AsyncConciseGeneratorMethod, FunctionKind.AsyncGeneratorFunction);
197
+ }
198
+ export function isGeneratorFunction(kind) {
199
+ return isInRange(kind, FunctionKind.AsyncConciseGeneratorMethod, FunctionKind.StaticConciseGeneratorMethod);
200
+ }
201
+ export function isAsyncFunction(kind) {
202
+ return isInRange(kind, FunctionKind.AsyncArrowFunction, FunctionKind.AsyncGeneratorFunction);
203
+ }
204
+ export function isResumableFunction(kind) {
205
+ return isGeneratorFunction(kind) || isAsyncFunction(kind) || isModule(kind);
206
+ }
207
+ export function isConciseMethod(kind) {
208
+ return isInRange(kind, FunctionKind.AsyncConciseMethod, FunctionKind.StaticAsyncConciseGeneratorMethod)
209
+ || isInRange(kind, FunctionKind.ConciseGeneratorMethod, FunctionKind.ClassStaticInitializerFunction);
210
+ }
211
+ export function isStrictFunctionWithoutPrototype(kind) {
212
+ return isInRange(kind, FunctionKind.GetterFunction, FunctionKind.AsyncArrowFunction)
213
+ || isInRange(kind, FunctionKind.AsyncConciseMethod, FunctionKind.StaticAsyncConciseGeneratorMethod)
214
+ || isInRange(kind, FunctionKind.ConciseGeneratorMethod, FunctionKind.ClassStaticInitializerFunction);
215
+ }
216
+ export function isGetterFunction(kind) {
217
+ return isInRange(kind, FunctionKind.GetterFunction, FunctionKind.StaticGetterFunction);
218
+ }
219
+ export function isSetterFunction(kind) {
220
+ return isInRange(kind, FunctionKind.SetterFunction, FunctionKind.StaticSetterFunction);
221
+ }
222
+ export function isAccessorFunction(kind) {
223
+ return isInRange(kind, FunctionKind.GetterFunction, FunctionKind.StaticSetterFunction);
224
+ }
225
+ export function isDefaultConstructor(kind) {
226
+ return isInRange(kind, FunctionKind.DefaultBaseConstructor, FunctionKind.DefaultDerivedConstructor);
227
+ }
228
+ export function isBaseConstructor(kind) {
229
+ return isInRange(kind, FunctionKind.BaseConstructor, FunctionKind.DefaultBaseConstructor);
230
+ }
231
+ export function isDerivedConstructor(kind) {
232
+ return isInRange(kind, FunctionKind.DefaultDerivedConstructor, FunctionKind.DerivedConstructor);
233
+ }
234
+ export function isClassConstructor(kind) {
235
+ return isInRange(kind, FunctionKind.BaseConstructor, FunctionKind.DerivedConstructor);
236
+ }
237
+ export function isClassMembersInitializerFunction(kind) {
238
+ return isInRange(kind, FunctionKind.ClassMembersInitializerFunction, FunctionKind.ClassStaticInitializerFunction);
239
+ }
240
+ export function isConstructable(kind) {
241
+ return isInRange(kind, FunctionKind.NormalFunction, FunctionKind.DerivedConstructor);
242
+ }
243
+ export function isStatic(kind) {
244
+ switch (kind) {
245
+ case FunctionKind.StaticGetterFunction:
246
+ case FunctionKind.StaticSetterFunction:
247
+ case FunctionKind.StaticConciseMethod:
248
+ case FunctionKind.StaticConciseGeneratorMethod:
249
+ case FunctionKind.StaticAsyncConciseMethod:
250
+ case FunctionKind.StaticAsyncConciseGeneratorMethod:
251
+ case FunctionKind.ClassStaticInitializerFunction:
252
+ return true;
253
+ default:
254
+ return false;
255
+ }
256
+ }
257
+ export function bindsSuper(kind) {
258
+ return isConciseMethod(kind) || isAccessorFunction(kind) || isClassConstructor(kind);
259
+ }
260
+ export function isAwaitAsIdentifierDisallowed(kind) {
261
+ return !isModule(kind) && (isAsyncFunction(kind) || kind == FunctionKind.ClassStaticInitializerFunction);
262
+ }
263
+ export function functionKind2String(kind) {
264
+ return FunctionKind[kind];
265
+ }
266
+ export function createClassInfo() {
267
+ return {
268
+ publicMembers: [],
269
+ privateMembers: [],
270
+ staticElements: [],
271
+ instanceFields: [],
272
+ 'constructor': undefined,
273
+ hasSeenConstructor: false,
274
+ hasStaticComputedNames: false,
275
+ hasStaticElements: false,
276
+ hasStaticPrivateMethods: false,
277
+ hasStaticBlocks: false,
278
+ hasInstanceMembers: false,
279
+ requiresBrand: false,
280
+ isAnonymous: false,
281
+ hasPrivateMethods: false,
282
+ computedFieldCount: 0,
283
+ };
284
+ }
285
+ export var FunctionNameValidity;
286
+ (function (FunctionNameValidity) {
287
+ FunctionNameValidity["FunctionNameIsStrictReserved"] = "FunctionNameIsStrictReserved";
288
+ FunctionNameValidity["SkipFunctionNameCheck"] = "SkipFunctionNameCheck";
289
+ FunctionNameValidity["FunctionNameValidityUnknown"] = "FunctionNameValidityUnknown";
290
+ })(FunctionNameValidity || (FunctionNameValidity = {}));
291
+ ;
292
+ export var ObjectLiteralPropertyKind;
293
+ (function (ObjectLiteralPropertyKind) {
294
+ ObjectLiteralPropertyKind["CONSTANT"] = "CONSTANT";
295
+ ObjectLiteralPropertyKind["COMPUTED"] = "COMPUTED";
296
+ ObjectLiteralPropertyKind["MATERIALIZED_LITERAL"] = "MATERIALIZED_LITERAL";
297
+ ObjectLiteralPropertyKind["GETTER"] = "GETTER";
298
+ ObjectLiteralPropertyKind["SETTER"] = "SETTER";
299
+ ObjectLiteralPropertyKind["PROTOTYPE"] = "PROTOTYPE";
300
+ ObjectLiteralPropertyKind["SPREAD"] = "SPREAD";
301
+ })(ObjectLiteralPropertyKind || (ObjectLiteralPropertyKind = {}));
302
+ export class ObjectLiteralProperty {
303
+ }
304
+ ObjectLiteralProperty.Kind = ObjectLiteralPropertyKind;
305
+ export var ClassLiteralPropertyKind;
306
+ (function (ClassLiteralPropertyKind) {
307
+ ClassLiteralPropertyKind["METHOD"] = "METHOD";
308
+ ClassLiteralPropertyKind["GETTER"] = "GETTER";
309
+ ClassLiteralPropertyKind["SETTER"] = "SETTER";
310
+ ClassLiteralPropertyKind["FIELD"] = "FIELD";
311
+ })(ClassLiteralPropertyKind || (ClassLiteralPropertyKind = {}));
312
+ export class ClassLiteralProperty {
313
+ }
314
+ ClassLiteralProperty.Kind = ClassLiteralPropertyKind;
315
+ export function classPropertyKindFor(kind) {
316
+ switch (kind) {
317
+ case PropertyKind.AccessorGetter:
318
+ return ClassLiteralPropertyKind.GETTER;
319
+ case PropertyKind.AccessorSetter:
320
+ return ClassLiteralPropertyKind.SETTER;
321
+ case PropertyKind.Method:
322
+ return ClassLiteralPropertyKind.METHOD;
323
+ case PropertyKind.ClassField:
324
+ return ClassLiteralPropertyKind.FIELD;
325
+ }
326
+ throw new Error(`unexpected property kind: ${kind}`);
327
+ }
328
+ export var VariableMode;
329
+ (function (VariableMode) {
330
+ VariableMode["Const"] = "Const";
331
+ VariableMode["PrivateMethod"] = "PrivateMethod";
332
+ VariableMode["PrivateGetterOnly"] = "PrivateGetterOnly";
333
+ VariableMode["PrivateSetterOnly"] = "PrivateSetterOnly";
334
+ })(VariableMode || (VariableMode = {}));
335
+ export function getVariableMode(kind) {
336
+ switch (kind) {
337
+ case ClassLiteralPropertyKind.FIELD:
338
+ return VariableMode.Const;
339
+ case ClassLiteralPropertyKind.METHOD:
340
+ return VariableMode.PrivateMethod;
341
+ case ClassLiteralPropertyKind.GETTER:
342
+ return VariableMode.PrivateGetterOnly;
343
+ case ClassLiteralPropertyKind.SETTER:
344
+ return VariableMode.PrivateSetterOnly;
345
+ }
346
+ }
347
+ export var LanguageMode;
348
+ (function (LanguageMode) {
349
+ LanguageMode[LanguageMode["Sloppy"] = 0] = "Sloppy";
350
+ LanguageMode[LanguageMode["Strict"] = 1] = "Strict";
351
+ })(LanguageMode || (LanguageMode = {}));
352
+ ;
353
+ export function isSloppy(mode) {
354
+ return LanguageMode.Sloppy === mode;
355
+ }
356
+ export function isStrict(mode) {
357
+ return LanguageMode.Strict === mode;
358
+ }
359
+ export function getLanguageMode(isModule) {
360
+ return !!isModule ? LanguageMode.Strict : LanguageMode.Sloppy;
361
+ }
362
+ export var VariableDeclarationContext;
363
+ (function (VariableDeclarationContext) {
364
+ VariableDeclarationContext[VariableDeclarationContext["StatementListItem"] = 0] = "StatementListItem";
365
+ VariableDeclarationContext[VariableDeclarationContext["Statement"] = 1] = "Statement";
366
+ VariableDeclarationContext[VariableDeclarationContext["ForStatement"] = 2] = "ForStatement";
367
+ })(VariableDeclarationContext || (VariableDeclarationContext = {}));
368
+ ;
369
+ export var AllowLabelledFunctionStatement;
370
+ (function (AllowLabelledFunctionStatement) {
371
+ AllowLabelledFunctionStatement[AllowLabelledFunctionStatement["AllowLabelledFunctionStatement"] = 0] = "AllowLabelledFunctionStatement";
372
+ AllowLabelledFunctionStatement[AllowLabelledFunctionStatement["DisallowLabelledFunctionStatement"] = 1] = "DisallowLabelledFunctionStatement";
373
+ })(AllowLabelledFunctionStatement || (AllowLabelledFunctionStatement = {}));
374
+ ;
375
+ //# sourceMappingURL=enums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/expressions/v8/enums.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,KAAa,EAAE,GAAW;IAChE,OAAO,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,CAAC;AACnC,CAAC;AAED,MAAM,CAAN,IAAY,oBAAkF;AAA9F,WAAY,oBAAoB;IAAG,iGAAqB,CAAA;IAAE,mFAAc,CAAA;IAAE,2FAAkB,CAAA;AAAC,CAAC,EAAlF,oBAAoB,KAApB,oBAAoB,QAA8D;AAC9F,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,iDAAK,CAAA;IAAE,yDAAS,CAAA;IAAE,iFAAqB,CAAA;IACvC,mDAAM,CAAA;IAAE,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AAHD,WAAY,8BAA8B;IACzC,uIAA8B,CAAA;IAC9B,6IAAiC,CAAA;AAClC,CAAC,EAHW,8BAA8B,KAA9B,8BAA8B,QAGzC;AAAA,CAAC","sourcesContent":["import { AccessorProperty, MethodDefinition, PropertyDefinition, StaticBlock } from '../api/class/class.js';\nimport { ExpressionNode } from '../api/expression.js';\nimport { VariableDeclarator } from '../api/statement/declarations/declares.js';\nimport { Token } from './token.js';\n\nexport function isInRange(num: number, start: number, end: number) {\n\treturn num >= start && num <= end;\n}\n\nexport enum ParsingArrowHeadFlag { CertainlyNotArrowHead, MaybeArrowHead, AsyncArrowFunction }\nexport enum PropertyKind {\n\tValue, Shorthand, ShorthandOrClassField,\n\tAssign, Method, ClassField, AccessorGetter, AccessorSetter,\n\tSpread, NotSet\n}\nexport function isAccessor(kind: PropertyKind) {\n\treturn kind === PropertyKind.AccessorGetter || kind === PropertyKind.AccessorSetter;\n}\n\nexport enum PropertyPosition {\n\tObjectLiteral,\n\tClassLiteral\n}\n\nexport class PropertyKindInfo {\n\tname: string;\n\tposition = PropertyPosition.ClassLiteral;\n\tfuncFlag = ParseFunctionFlag.IsNormal;\n\tkind = PropertyKind.NotSet;\n\tisComputedName = false;\n\tisPrivate = false;\n\tisStatic = false;\n\tisRest = false;\n\n\tparsePropertyKindFromToken(token: Token): boolean {\n\t\t// This returns true, setting the property kind, iff the given token is\n\t\t// one which must occur after a property name, indicating that the\n\t\t// previous token was in fact a name and not a modifier (like the \"get\" in\n\t\t// \"get x\").\n\t\tswitch (token) {\n\t\t\tcase Token.COLON:\n\t\t\t\tthis.kind = PropertyKind.Value;\n\t\t\t\treturn true;\n\t\t\tcase Token.COMMA:\n\t\t\t\tthis.kind = PropertyKind.Shorthand;\n\t\t\t\treturn true;\n\t\t\tcase Token.RBRACE:\n\t\t\t\tthis.kind = PropertyKind.ShorthandOrClassField;\n\t\t\t\treturn true;\n\t\t\tcase Token.ASSIGN:\n\t\t\t\tthis.kind = PropertyKind.Assign;\n\t\t\t\treturn true;\n\t\t\tcase Token.LPAREN:\n\t\t\t\tthis.kind = PropertyKind.Method;\n\t\t\t\treturn true;\n\t\t\tcase Token.MUL:\n\t\t\tcase Token.SEMICOLON:\n\t\t\t\tthis.kind = PropertyKind.ClassField;\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn false;\n\t}\n\n}\n\nexport type FunctionInfo = { rest?: boolean };\n\nexport enum PreParserIdentifierType {\n\tNullIdentifier,\n\tUnknownIdentifier,\n\tEvalIdentifier,\n\tArgumentsIdentifier,\n\tConstructorIdentifier,\n\tAwaitIdentifier,\n\tAsyncIdentifier,\n\tNameIdentifier,\n\tPrivateNameIdentifier\n}\n\nexport enum FunctionBodyType {\n\tEXPRESSION,\n\tBLOCK,\n}\n\nexport enum ParseFunctionFlag {\n\tIsNormal = 0,\n\tIsGenerator = 1 << 0,\n\tIsAsync = 1 << 1\n}\n\nexport enum FunctionKind {\n\n\t// BEGIN constructable functions\n\tNormalFunction,\n\tModule,\n\tAsyncModule,\n\t// BEGIN class constructors\n\t// BEGIN base constructors\n\tBaseConstructor,\n\t// BEGIN default constructors\n\tDefaultBaseConstructor,\n\t// END base constructors\n\t// BEGIN derived constructors\n\tDefaultDerivedConstructor,\n\t// END default constructors\n\tDerivedConstructor,\n\t// END derived constructors\n\t// END class constructors\n\t// END constructable functions.\n\t// BEGIN accessors\n\tGetterFunction,\n\tStaticGetterFunction,\n\tSetterFunction,\n\tStaticSetterFunction,\n\t// END accessors\n\t// BEGIN arrow functions\n\tArrowFunction,\n\t// BEGIN async functions\n\tAsyncArrowFunction,\n\t// END arrow functions\n\tAsyncFunction,\n\t// BEGIN concise methods 1\n\tAsyncConciseMethod,\n\tStaticAsyncConciseMethod,\n\t// BEGIN generators\n\tAsyncConciseGeneratorMethod,\n\tStaticAsyncConciseGeneratorMethod,\n\t// END concise methods 1\n\tAsyncGeneratorFunction,\n\t// END async functions\n\tGeneratorFunction,\n\t// BEGIN concise methods 2\n\tConciseGeneratorMethod,\n\tStaticConciseGeneratorMethod,\n\t// END generators\n\tConciseMethod,\n\tStaticConciseMethod,\n\tClassMembersInitializerFunction,\n\tClassStaticInitializerFunction,\n\t// END concise methods 2\n\tInvalid,\n\n\tLastFunctionKind = ClassStaticInitializerFunction,\n}\n\nconst FUNCTIONS_TYPES: FunctionKind[][][] = [\n\t[\n\t\t// SubFunctionKind::kNormalFunction\n\t\t[// is_generator=false\n\t\t\tFunctionKind.NormalFunction,\n\t\t\tFunctionKind.AsyncFunction\n\t\t],\n\t\t[// is_generator=true\n\t\t\tFunctionKind.GeneratorFunction,\n\t\t\tFunctionKind.AsyncGeneratorFunction\n\t\t],\n\t],\n\t[\n\t\t// SubFunctionKind::kNonStaticMethod\n\t\t[// is_generator=false\n\t\t\tFunctionKind.ConciseMethod,\n\t\t\tFunctionKind.AsyncConciseMethod\n\t\t],\n\t\t[// is_generator=true\n\t\t\tFunctionKind.ConciseGeneratorMethod,\n\t\t\tFunctionKind.AsyncConciseGeneratorMethod\n\t\t],\n\t],\n\t[\n\t\t// SubFunctionKind::kStaticMethod\n\t\t[// is_generator=false\n\t\t\tFunctionKind.StaticConciseMethod,\n\t\t\tFunctionKind.StaticAsyncConciseMethod\n\t\t],\n\t\t[// is_generator=true\n\t\t\tFunctionKind.StaticConciseGeneratorMethod,\n\t\t\tFunctionKind.StaticAsyncConciseGeneratorMethod\n\t\t],\n\t]\n];\n\nexport enum SubFunctionKind {\n\tNormalFunction,\n\tNonStaticMethod,\n\tStaticMethod,\n}\n\nexport enum StaticFlag {\n\tNotStatic,\n\tStatic\n};\n\n\nexport function functionKindForImpl(subFunctionKind: SubFunctionKind, flags: ParseFunctionFlag): FunctionKind {\n\treturn FUNCTIONS_TYPES[subFunctionKind]\n\t[(flags & ParseFunctionFlag.IsGenerator) != 0 ? 1 : 0]\n\t[(flags & ParseFunctionFlag.IsAsync) != 0 ? 1 : 0];\n}\n\nexport function functionKindFor(isGenerator: boolean, isAsync: boolean): FunctionKind {\n\treturn FUNCTIONS_TYPES[SubFunctionKind.NormalFunction][isGenerator ? 1 : 0][isAsync ? 1 : 0];\n}\n\nexport function methodKindFor(isStatic: boolean, isGenerator: boolean, isAsync: boolean): FunctionKind {\n\treturn FUNCTIONS_TYPES[isStatic ? SubFunctionKind.StaticMethod : SubFunctionKind.NonStaticMethod][isGenerator ? 1 : 0][isAsync ? 1 : 0];\n}\n\nexport enum FunctionSyntaxKind {\n\tAnonymousExpression,\n\tNamedExpression,\n\tDeclaration,\n\tAccessorOrMethod,\n\tWrapped,\n\n\tLastFunctionSyntaxKind = Wrapped,\n};\n\n\n\nexport function isArrowFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.ArrowFunction, FunctionKind.AsyncArrowFunction);\n}\n\nexport function isModule(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.Module, FunctionKind.AsyncModule);\n}\n\nexport function isAsyncModule(kind: FunctionKind) {\n\treturn kind == FunctionKind.AsyncModule;\n}\n\nexport function isAsyncGeneratorFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.AsyncConciseGeneratorMethod, FunctionKind.AsyncGeneratorFunction);\n}\n\nexport function isGeneratorFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.AsyncConciseGeneratorMethod, FunctionKind.StaticConciseGeneratorMethod);\n}\n\nexport function isAsyncFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.AsyncArrowFunction, FunctionKind.AsyncGeneratorFunction);\n}\n\nexport function isResumableFunction(kind: FunctionKind) {\n\treturn isGeneratorFunction(kind) || isAsyncFunction(kind) || isModule(kind);\n}\n\nexport function isConciseMethod(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.AsyncConciseMethod, FunctionKind.StaticAsyncConciseGeneratorMethod)\n\t\t|| isInRange(kind, FunctionKind.ConciseGeneratorMethod, FunctionKind.ClassStaticInitializerFunction);\n}\n\nexport function isStrictFunctionWithoutPrototype(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.GetterFunction, FunctionKind.AsyncArrowFunction)\n\t\t|| isInRange(kind, FunctionKind.AsyncConciseMethod, FunctionKind.StaticAsyncConciseGeneratorMethod)\n\t\t|| isInRange(kind, FunctionKind.ConciseGeneratorMethod, FunctionKind.ClassStaticInitializerFunction);\n}\n\nexport function isGetterFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.GetterFunction, FunctionKind.StaticGetterFunction);\n}\n\nexport function isSetterFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.SetterFunction, FunctionKind.StaticSetterFunction);\n}\n\nexport function isAccessorFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.GetterFunction, FunctionKind.StaticSetterFunction);\n}\n\nexport function isDefaultConstructor(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.DefaultBaseConstructor, FunctionKind.DefaultDerivedConstructor);\n}\n\nexport function isBaseConstructor(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.BaseConstructor, FunctionKind.DefaultBaseConstructor);\n}\n\nexport function isDerivedConstructor(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.DefaultDerivedConstructor, FunctionKind.DerivedConstructor);\n}\n\nexport function isClassConstructor(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.BaseConstructor, FunctionKind.DerivedConstructor);\n}\n\nexport function isClassMembersInitializerFunction(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.ClassMembersInitializerFunction, FunctionKind.ClassStaticInitializerFunction);\n}\n\nexport function isConstructable(kind: FunctionKind) {\n\treturn isInRange(kind, FunctionKind.NormalFunction, FunctionKind.DerivedConstructor);\n}\n\nexport function isStatic(kind: FunctionKind) {\n\tswitch (kind) {\n\t\tcase FunctionKind.StaticGetterFunction:\n\t\tcase FunctionKind.StaticSetterFunction:\n\t\tcase FunctionKind.StaticConciseMethod:\n\t\tcase FunctionKind.StaticConciseGeneratorMethod:\n\t\tcase FunctionKind.StaticAsyncConciseMethod:\n\t\tcase FunctionKind.StaticAsyncConciseGeneratorMethod:\n\t\tcase FunctionKind.ClassStaticInitializerFunction:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function bindsSuper(kind: FunctionKind) {\n\treturn isConciseMethod(kind) || isAccessorFunction(kind) || isClassConstructor(kind);\n}\n\nexport function isAwaitAsIdentifierDisallowed(kind: FunctionKind) {\n\t// 'await' is always disallowed as an identifier in module contexts. Callers\n\t// should short-circuit the module case instead of calling this.\n\treturn !isModule(kind) && (isAsyncFunction(kind) || kind == FunctionKind.ClassStaticInitializerFunction);\n}\n\nexport function functionKind2String(kind: FunctionKind): string {\n\treturn FunctionKind[kind];\n}\n\nexport type ClassInfo = {\n\textends?: ExpressionNode;\n\tpublicMembers: (MethodDefinition | PropertyDefinition)[],\n\tprivateMembers: (MethodDefinition | PropertyDefinition)[],\n\tstaticElements: (MethodDefinition | PropertyDefinition | AccessorProperty | StaticBlock)[],\n\tinstanceFields: (MethodDefinition | PropertyDefinition | AccessorProperty)[],\n\tconstructor: MethodDefinition | undefined,\n\n\thasSeenConstructor: boolean;\n\thasStaticComputedNames: boolean;\n\thasStaticElements: boolean;\n\thasStaticPrivateMethods: boolean;\n\thasStaticBlocks: boolean;\n\thasInstanceMembers: boolean;\n\trequiresBrand: boolean;\n\tisAnonymous: boolean;\n\thasPrivateMethods: boolean,\n\n\tcomputedFieldCount: number;\n\n\thomeObjectVariable?: VariableDeclarator;\n\tstaticHomeObjectVariable?: VariableDeclarator;\n};\n\nexport function createClassInfo(): ClassInfo {\n\treturn {\n\t\tpublicMembers: [],\n\t\tprivateMembers: [],\n\t\tstaticElements: [],\n\t\tinstanceFields: [],\n\t\t'constructor': undefined,\n\n\t\thasSeenConstructor: false,\n\t\thasStaticComputedNames: false,\n\t\thasStaticElements: false,\n\t\thasStaticPrivateMethods: false,\n\t\thasStaticBlocks: false,\n\t\thasInstanceMembers: false,\n\t\trequiresBrand: false,\n\t\tisAnonymous: false,\n\t\thasPrivateMethods: false,\n\n\t\tcomputedFieldCount: 0,\n\t};\n}\n\nexport enum FunctionNameValidity {\n\tFunctionNameIsStrictReserved = 'FunctionNameIsStrictReserved',\n\tSkipFunctionNameCheck = 'SkipFunctionNameCheck',\n\tFunctionNameValidityUnknown = 'FunctionNameValidityUnknown'\n};\n\nexport enum ObjectLiteralPropertyKind {\n\tCONSTANT = 'CONSTANT',\t// Property with constant value (compile time).\n\tCOMPUTED = 'COMPUTED',\t// Property with computed value (execution time).\n\tMATERIALIZED_LITERAL = 'MATERIALIZED_LITERAL', // Property value is a materialized literal.\n\tGETTER = 'GETTER',\n\tSETTER = 'SETTER',\t\t// Property is an accessor function.\n\tPROTOTYPE = 'PROTOTYPE',\t// Property is __proto__.\n\tSPREAD = 'SPREAD'\n}\nexport class ObjectLiteralProperty {\n\tstatic Kind = ObjectLiteralPropertyKind;\n}\n\nexport enum ClassLiteralPropertyKind {\n\tMETHOD = 'METHOD',\n\tGETTER = 'GETTER',\n\tSETTER = 'SETTER',\n\tFIELD = 'FIELD'\n}\n\nexport class ClassLiteralProperty {\n\tstatic Kind = ClassLiteralPropertyKind;\n}\n\nexport function classPropertyKindFor(kind: PropertyKind): ClassLiteralPropertyKind {\n\tswitch (kind) {\n\t\tcase PropertyKind.AccessorGetter:\n\t\t\treturn ClassLiteralPropertyKind.GETTER;\n\t\tcase PropertyKind.AccessorSetter:\n\t\t\treturn ClassLiteralPropertyKind.SETTER;\n\t\tcase PropertyKind.Method:\n\t\t\treturn ClassLiteralPropertyKind.METHOD;\n\t\tcase PropertyKind.ClassField:\n\t\t\treturn ClassLiteralPropertyKind.FIELD;\n\t}\n\tthrow new Error(`unexpected property kind: ${kind}`);\n}\n\nexport enum VariableMode {\n\tConst = 'Const',\n\tPrivateMethod = 'PrivateMethod',\n\tPrivateGetterOnly = 'PrivateGetterOnly',\n\tPrivateSetterOnly = 'PrivateSetterOnly'\n}\n\nexport function getVariableMode(kind: ClassLiteralPropertyKind): VariableMode {\n\tswitch (kind) {\n\t\tcase ClassLiteralPropertyKind.FIELD:\n\t\t\treturn VariableMode.Const;\n\t\tcase ClassLiteralPropertyKind.METHOD:\n\t\t\treturn VariableMode.PrivateMethod;\n\t\tcase ClassLiteralPropertyKind.GETTER:\n\t\t\treturn VariableMode.PrivateGetterOnly;\n\t\tcase ClassLiteralPropertyKind.SETTER:\n\t\t\treturn VariableMode.PrivateSetterOnly;\n\t}\n}\n\nexport enum LanguageMode {\n\tSloppy,\n\tStrict,\n};\n\nexport function isSloppy(mode: LanguageMode) {\n\treturn LanguageMode.Sloppy === mode;\n}\n\nexport function isStrict(mode: LanguageMode) {\n\treturn LanguageMode.Strict === mode;\n}\n\nexport function getLanguageMode(isModule: boolean) {\n\treturn !!isModule ? LanguageMode.Strict : LanguageMode.Sloppy;\n}\n\nexport enum VariableDeclarationContext {\n\tStatementListItem,\n\tStatement,\n\tForStatement\n};\n\nexport enum AllowLabelledFunctionStatement {\n\tAllowLabelledFunctionStatement,\n\tDisallowLabelledFunctionStatement,\n};\n"]}
package/v8/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './token.js';
2
2
  export * from './stream.js';
3
- export * from './parser.js';
3
+ export * from './enums.js';
4
+ export * from './inline.js';
4
5
  export * from './parser.js';
package/v8/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './token.js';
2
2
  export * from './stream.js';
3
- export * from './parser.js';
3
+ export * from './enums.js';
4
+ export * from './inline.js';
4
5
  export * from './parser.js';
5
6
  //# sourceMappingURL=index.js.map
package/v8/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/expressions/v8/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC","sourcesContent":["export * from './token.js';\nexport * from './stream.js';\nexport * from './parser.js';\nexport * from './parser.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/expressions/v8/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC","sourcesContent":["export * from './token.js';\nexport * from './stream.js';\nexport * from './enums.js';\nexport * from './inline.js';\nexport * from './parser.js';"]}
package/v8/inline.d.ts ADDED
@@ -0,0 +1,177 @@
1
+ import type { ExpressionNode } from '../api/expression.js';
2
+ import { Token, TokenExpression } from './token.js';
3
+ import { TokenStream } from './stream.js';
4
+ import { Identifier, TaggedTemplateExpression, TemplateLiteral } from '../api/definition/values.js';
5
+ import { EmptyStatement } from '../api/statement/control/empty.js';
6
+ import { BlockStatement } from '../api/statement/control/block.js';
7
+ import { Param, FunctionExpression, FunctionDeclaration } from '../api/definition/function.js';
8
+ import { NewExpression } from '../api/computing/new.js';
9
+ import { MemberExpression } from '../api/definition/member.js';
10
+ import { ObjectExpression, Property } from '../api/definition/object.js';
11
+ import { ArrayExpression, ArrayPattern } from '../api/definition/array.js';
12
+ import { CallExpression } from '../api/computing/call.js';
13
+ import { VariableDeclarationNode } from '../api/statement/declarations/declares.js';
14
+ import { ForNode, ForOfNode, ForInNode, ForAwaitOfNode } from '../api/statement/iterations/for.js';
15
+ import { ClassDeclaration, ClassExpression } from '../api/class/class.js';
16
+ import { AllowLabelledFunctionStatement, FunctionBodyType, FunctionInfo, FunctionKind, FunctionSyntaxKind, LanguageMode, ParseFunctionFlag, ParsingArrowHeadFlag, PropertyKindInfo, VariableDeclarationContext } from './enums.js';
17
+ import { DebuggerStatement } from '../api/computing/debugger.js';
18
+ export declare type InlineParserOptions = {
19
+ mode?: LanguageMode;
20
+ acceptIN?: boolean;
21
+ };
22
+ export declare abstract class AbstractParser {
23
+ protected scanner: TokenStream;
24
+ protected acceptIN: boolean;
25
+ protected previousAcceptIN: boolean[];
26
+ protected functionKind: FunctionKind;
27
+ protected previousFunctionKind: FunctionKind[];
28
+ get languageMode(): LanguageMode;
29
+ set languageMode(mode: LanguageMode);
30
+ constructor(scanner: TokenStream, acceptIN?: boolean);
31
+ abstract scan(): ExpressionNode;
32
+ protected position(): number;
33
+ protected setAcceptIN(acceptIN: boolean): void;
34
+ protected restoreAcceptIN(): void;
35
+ protected getLastFunctionKind(): FunctionKind;
36
+ protected setFunctionKind(functionKind: FunctionKind): void;
37
+ protected restoreFunctionKind(): void;
38
+ protected setStatue(acceptIN: boolean, functionKind: FunctionKind): void;
39
+ protected restoreStatue(): void;
40
+ protected current(): TokenExpression;
41
+ protected next(): TokenExpression;
42
+ protected peek(): TokenExpression;
43
+ protected peekAhead(): TokenExpression;
44
+ protected peekAheadPosition(): number;
45
+ protected peekPosition(): number;
46
+ protected consume(token: Token): void;
47
+ protected check(token: Token): boolean;
48
+ protected checkAndGetValue(token: Token): ExpressionNode | undefined;
49
+ protected checkValue(value: ExpressionNode): boolean;
50
+ protected expect(token: Token): void;
51
+ protected expectAndGetValue(token: Token): ExpressionNode;
52
+ protected checkInOrOf(): 'IN' | 'OF' | false;
53
+ protected peekInOrOf(): 'IN' | 'OF' | false;
54
+ protected isArguments(name: ExpressionNode): boolean;
55
+ protected isEval(name: ExpressionNode): boolean;
56
+ protected isEvalOrArguments(name: ExpressionNode): boolean;
57
+ protected isNextLetKeyword(): boolean;
58
+ protected isIdentifier(expression: ExpressionNode): expression is Identifier;
59
+ protected markParenthesized(expression: ExpressionNode): void;
60
+ protected clearParenthesized(expression: ExpressionNode): void;
61
+ protected isParenthesized(expression: ExpressionNode): boolean;
62
+ protected isAssignableIdentifier(expression: ExpressionNode): boolean;
63
+ protected isPattern(expression: ExpressionNode): expression is (ObjectExpression | ArrayExpression);
64
+ protected isProperty(expression: ExpressionNode): expression is Property | MemberExpression;
65
+ protected isCallNew(expression: ExpressionNode): expression is NewExpression;
66
+ protected isCall(expression: ExpressionNode): expression is CallExpression;
67
+ protected isEmptyStatement(expression: ExpressionNode): expression is EmptyStatement;
68
+ protected isValidReferenceExpression(expression: ExpressionNode): boolean;
69
+ protected expectSemicolon(): void;
70
+ protected peekAnyIdentifier(): boolean;
71
+ protected expectContextualKeyword(keyword: string): boolean;
72
+ protected checkContextualKeyword(keyword: string): boolean;
73
+ protected peekContextualKeyword(keyword: string): boolean;
74
+ protected methodKindFor(isStatic: boolean, flag: ParseFunctionFlag): FunctionKind;
75
+ protected isGenerator(): boolean;
76
+ protected isAsyncFunction(): boolean;
77
+ protected is_async_function(): boolean;
78
+ protected is_async_generator(): boolean;
79
+ protected is_resumable(): boolean;
80
+ protected isAwaitAllowed(): boolean;
81
+ protected isAwaitAsIdentifierDisallowed(): boolean;
82
+ protected shouldBanArguments(): boolean;
83
+ protected errorMessage(message: string): string;
84
+ protected reportErrorMessage(message: string): void;
85
+ }
86
+ export declare class JavaScriptInlineParser extends AbstractParser {
87
+ static parse(source: string | TokenExpression[] | TokenStream, { mode, acceptIN }?: InlineParserOptions): ExpressionNode;
88
+ constructor(scanner: TokenStream, acceptIN?: boolean);
89
+ scan(): ExpressionNode;
90
+ protected parseStatement(allowFunction?: AllowLabelledFunctionStatement): ExpressionNode;
91
+ protected parseDebuggerStatement(): DebuggerStatement;
92
+ protected parseTryStatement(): ExpressionNode;
93
+ protected parseNonRestrictedIdentifier(): Identifier;
94
+ protected parseBlock(): BlockStatement;
95
+ protected parseStatementListItem(): ExpressionNode | undefined;
96
+ protected parseFunctionExpression(): FunctionExpression | FunctionDeclaration;
97
+ protected parseAsyncFunctionDeclaration(names: string[] | undefined, defaultExport: boolean): FunctionDeclaration;
98
+ protected parseIfStatement(): ExpressionNode;
99
+ protected parseScopedStatement(): ExpressionNode;
100
+ protected parseDoWhileStatement(): ExpressionNode;
101
+ protected parseWhileStatement(): ExpressionNode;
102
+ protected parseThrowStatement(): ExpressionNode;
103
+ protected parseSwitchStatement(): ExpressionNode;
104
+ protected parseForStatement(): ForNode | ForOfNode | ForInNode;
105
+ protected parseStandardForLoopWithLexicalDeclarations(initializer: VariableDeclarationNode): ForNode;
106
+ protected parseForEachStatementWithDeclarations(initializer: VariableDeclarationNode, forMode: 'IN' | 'OF'): ForOfNode | ForInNode;
107
+ protected parseForEachStatementWithoutDeclarations(initializer: ExpressionNode, forMode: 'IN' | 'OF'): ForOfNode | ForInNode;
108
+ protected parseStandardForLoop(initializer: ExpressionNode): ForNode;
109
+ protected parseForAwaitStatement(): ForAwaitOfNode;
110
+ protected parseVariableDeclarations(varContext: VariableDeclarationContext): VariableDeclarationNode;
111
+ protected parseBindingPattern(isPattern: boolean): ExpressionNode;
112
+ protected parseAndClassifyIdentifier(next: TokenExpression): ExpressionNode;
113
+ protected parseContinueStatement(): ExpressionNode;
114
+ protected parseBreakStatement(): ExpressionNode;
115
+ protected parseReturnStatement(): ExpressionNode;
116
+ protected parseExpressionOrLabelledStatement(allowFunction: AllowLabelledFunctionStatement): ExpressionNode;
117
+ protected parseExpression(): ExpressionNode;
118
+ protected parseFunctionDeclaration(): FunctionDeclaration;
119
+ protected parseAsyncFunctionLiteral(): FunctionExpression | FunctionDeclaration;
120
+ protected parseHoistableDeclaration(names: string[] | undefined, defaultExport: boolean): FunctionExpression | FunctionDeclaration;
121
+ protected parseHoistableDeclaration01(flag: FunctionKind, names: string[] | undefined, defaultExport: boolean): FunctionExpression | FunctionDeclaration;
122
+ protected parseIdentifier(kind?: FunctionKind): Identifier;
123
+ protected getIdentifier(): Identifier;
124
+ protected parseFunctionLiteral(flag: FunctionKind, functionSyntaxKind: FunctionSyntaxKind, name?: Identifier): FunctionDeclaration | FunctionExpression;
125
+ protected parseFunctionBody(kind: FunctionKind, bodyType: FunctionBodyType.BLOCK, functionSyntaxKind: FunctionSyntaxKind): ExpressionNode[];
126
+ protected parseFunctionBody(kind: FunctionKind, bodyType: FunctionBodyType.EXPRESSION, functionSyntaxKind: FunctionSyntaxKind): ExpressionNode;
127
+ protected parseAndRewriteAsyncGeneratorFunctionBody(kind: FunctionKind): ExpressionNode[];
128
+ protected parseAndRewriteGeneratorFunctionBody(kind: FunctionKind): ExpressionNode[];
129
+ protected parseAsyncFunctionBody(): ExpressionNode[];
130
+ protected parseStatementList(endToken: Token): ExpressionNode[];
131
+ protected parseFormalParameterList(functionInfo: FunctionInfo): ExpressionNode[];
132
+ protected parseFormalParameter(functionInfo: FunctionInfo): ExpressionNode;
133
+ protected parseExpressionCoverGrammar(): ExpressionNode;
134
+ protected parseArrowParametersWithRest(list: ExpressionNode[]): ExpressionNode;
135
+ protected expressionListToExpression(list: ExpressionNode[]): ExpressionNode;
136
+ protected parseMemberExpression(): ExpressionNode;
137
+ protected toParamNode(expression: ExpressionNode): Param;
138
+ protected parsePrimaryExpression(): ExpressionNode;
139
+ protected parseTemplateLiteral(tag?: ExpressionNode): ExpressionNode;
140
+ protected createTemplateLiteralExpressionNode(strings: string[], expressions: ExpressionNode[], tag?: ExpressionNode): TaggedTemplateExpression | TemplateLiteral;
141
+ protected parseMemberWithPresentNewPrefixesExpression(): ExpressionNode;
142
+ protected parseArguments(maybeArrow?: ParsingArrowHeadFlag): ExpressionNode[];
143
+ protected parseAssignmentExpressionCoverGrammar(): ExpressionNode;
144
+ protected parseAssignmentExpression(): ExpressionNode;
145
+ protected parseArrowFunctionLiteral(parameters: ExpressionNode[], kind: FunctionKind): ExpressionNode;
146
+ protected parseRegExpLiteral(): ExpressionNode;
147
+ protected parseArrayLiteral(isPattern: boolean): ArrayExpression | ArrayPattern;
148
+ protected parsePossibleDestructuringSubPattern(): ExpressionNode;
149
+ protected parseObjectLiteral(isPattern: boolean): ExpressionNode;
150
+ protected parseObjectPropertyDefinition(isPattern: boolean): ExpressionNode;
151
+ protected parseProperty(propInfo: PropertyKindInfo): ExpressionNode;
152
+ protected parseMemberExpressionContinuation(expression: ExpressionNode): ExpressionNode;
153
+ protected doParseMemberExpressionContinuation(expression: ExpressionNode): ExpressionNode;
154
+ protected parsePropertyOrPrivatePropertyName(): ExpressionNode;
155
+ protected parsePipelineExpression(expression: ExpressionNode): ExpressionNode;
156
+ protected parsePipelineBody(lhs: ExpressionNode): ExpressionNode;
157
+ protected parseConditionalExpression(): ExpressionNode;
158
+ protected parseLogicalExpression(): ExpressionNode;
159
+ protected parseBinaryContinuation(x: ExpressionNode, prec: number, prec1: number): ExpressionNode;
160
+ protected parseBinaryExpression(precedence: number): ExpressionNode;
161
+ protected parseUnaryExpression(): ExpressionNode;
162
+ protected parseUnaryOrPrefixExpression(): ExpressionNode;
163
+ protected parsePostfixExpression(): ExpressionNode;
164
+ protected parsePostfixContinuation(expression: ExpressionNode): ExpressionNode;
165
+ protected parseLeftHandSideExpression(): ExpressionNode;
166
+ protected parseLeftHandSideContinuation(result: ExpressionNode): ExpressionNode;
167
+ protected parseAwaitExpression(): ExpressionNode;
168
+ protected parseNullishExpression(expression: ExpressionNode): ExpressionNode;
169
+ protected parseConditionalContinuation(expression: ExpressionNode): ExpressionNode;
170
+ protected parseYieldExpression(): ExpressionNode;
171
+ protected parseNewTargetExpression(): ExpressionNode;
172
+ protected parseClassExpression(): ClassExpression;
173
+ protected parseClassDeclaration(names: string[] | undefined, defaultExport: boolean): ClassDeclaration;
174
+ protected parseClassLiteral(name: ExpressionNode | undefined, isStrictReserved: boolean): ExpressionNode;
175
+ protected parseSuperExpression(): ExpressionNode;
176
+ protected parseImportExpressions(): ExpressionNode;
177
+ }