ether-code 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/ether.js +1 -1
- package/generators/css-generator.js +42 -55
- package/generators/graphql-generator.js +19 -22
- package/generators/html-generator.js +51 -182
- package/generators/js-generator.js +76 -157
- package/generators/node-generator.js +49 -93
- package/generators/php-generator.js +46 -68
- package/generators/python-generator.js +35 -54
- package/generators/react-generator.js +37 -47
- package/generators/ruby-generator.js +59 -119
- package/generators/sql-generator.js +42 -63
- package/generators/ts-generator.js +59 -133
- package/i18n/i18n-css.json +147 -147
- package/i18n/i18n-graphql.json +6 -6
- package/i18n/i18n-html.json +135 -135
- package/i18n/i18n-js.json +107 -107
- package/i18n/i18n-node.json +14 -14
- package/i18n/i18n-php.json +177 -177
- package/i18n/i18n-python.json +16 -16
- package/i18n/i18n-react.json +97 -97
- package/i18n/i18n-ruby.json +22 -22
- package/i18n/i18n-sql.json +153 -153
- package/i18n/i18n-ts.json +10 -10
- package/lexer/ether-lexer.js +175 -34
- package/lexer/tokens.js +6 -6
- package/package.json +1 -1
- package/parsers/ast-css.js +0 -545
- package/parsers/ast-graphql.js +0 -424
- package/parsers/ast-html.js +0 -886
- package/parsers/ast-js.js +0 -750
- package/parsers/ast-node.js +0 -2440
- package/parsers/ast-php.js +0 -957
- package/parsers/ast-react.js +0 -580
- package/parsers/ast-ruby.js +0 -895
- package/parsers/ast-ts.js +0 -1352
- package/parsers/css-parser.js +0 -1981
- package/parsers/graphql-parser.js +0 -2011
- package/parsers/html-parser.js +0 -1182
- package/parsers/js-parser.js +0 -2564
- package/parsers/node-parser.js +0 -2644
- package/parsers/php-parser.js +0 -3037
- package/parsers/react-parser.js +0 -1035
- package/parsers/ruby-parser.js +0 -2680
- package/parsers/ts-parser.js +0 -3881
package/parsers/ast-php.js
DELETED
|
@@ -1,957 +0,0 @@
|
|
|
1
|
-
class ASTNode {
|
|
2
|
-
constructor(type, loc = null) {
|
|
3
|
-
this.type = type
|
|
4
|
-
this.loc = loc
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
class Program extends ASTNode {
|
|
9
|
-
constructor(body = [], loc = null) {
|
|
10
|
-
super('Program', loc)
|
|
11
|
-
this.body = body
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
class PHPBlock extends ASTNode {
|
|
16
|
-
constructor(body = [], loc = null) {
|
|
17
|
-
super('PHPBlock', loc)
|
|
18
|
-
this.body = body
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
class HTMLBlock extends ASTNode {
|
|
23
|
-
constructor(content, loc = null) {
|
|
24
|
-
super('HTMLBlock', loc)
|
|
25
|
-
this.content = content
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
class EchoStatement extends ASTNode {
|
|
30
|
-
constructor(expressions = [], loc = null) {
|
|
31
|
-
super('EchoStatement', loc)
|
|
32
|
-
this.expressions = expressions
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
class PrintStatement extends ASTNode {
|
|
37
|
-
constructor(expression, loc = null) {
|
|
38
|
-
super('PrintStatement', loc)
|
|
39
|
-
this.expression = expression
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
class Identifier extends ASTNode {
|
|
44
|
-
constructor(name, loc = null) {
|
|
45
|
-
super('Identifier', loc)
|
|
46
|
-
this.name = name
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
class Variable extends ASTNode {
|
|
51
|
-
constructor(name, loc = null) {
|
|
52
|
-
super('Variable', loc)
|
|
53
|
-
this.name = name
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
class VariableVariable extends ASTNode {
|
|
58
|
-
constructor(expr, loc = null) {
|
|
59
|
-
super('VariableVariable', loc)
|
|
60
|
-
this.expression = expr
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
class ConstantDeclaration extends ASTNode {
|
|
65
|
-
constructor(name, value, loc = null) {
|
|
66
|
-
super('ConstantDeclaration', loc)
|
|
67
|
-
this.name = name
|
|
68
|
-
this.value = value
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
class DefineCall extends ASTNode {
|
|
73
|
-
constructor(name, value, caseInsensitive = false, loc = null) {
|
|
74
|
-
super('DefineCall', loc)
|
|
75
|
-
this.name = name
|
|
76
|
-
this.value = value
|
|
77
|
-
this.caseInsensitive = caseInsensitive
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
class StringLiteral extends ASTNode {
|
|
82
|
-
constructor(value, raw = null, loc = null) {
|
|
83
|
-
super('StringLiteral', loc)
|
|
84
|
-
this.value = value
|
|
85
|
-
this.raw = raw || `"${value}"`
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
class NumericLiteral extends ASTNode {
|
|
90
|
-
constructor(value, raw = null, loc = null) {
|
|
91
|
-
super('NumericLiteral', loc)
|
|
92
|
-
this.value = value
|
|
93
|
-
this.raw = raw || String(value)
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
class BooleanLiteral extends ASTNode {
|
|
98
|
-
constructor(value, loc = null) {
|
|
99
|
-
super('BooleanLiteral', loc)
|
|
100
|
-
this.value = value
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
class NullLiteral extends ASTNode {
|
|
105
|
-
constructor(loc = null) {
|
|
106
|
-
super('NullLiteral', loc)
|
|
107
|
-
this.value = null
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
class ArrayExpression extends ASTNode {
|
|
112
|
-
constructor(elements = [], shortSyntax = true, loc = null) {
|
|
113
|
-
super('ArrayExpression', loc)
|
|
114
|
-
this.elements = elements
|
|
115
|
-
this.shortSyntax = shortSyntax
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
class ArrayElement extends ASTNode {
|
|
120
|
-
constructor(value, key = null, byRef = false, unpack = false, loc = null) {
|
|
121
|
-
super('ArrayElement', loc)
|
|
122
|
-
this.key = key
|
|
123
|
-
this.value = value
|
|
124
|
-
this.byRef = byRef
|
|
125
|
-
this.unpack = unpack
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
class HeredocLiteral extends ASTNode {
|
|
130
|
-
constructor(label, value, nowdoc = false, loc = null) {
|
|
131
|
-
super('HeredocLiteral', loc)
|
|
132
|
-
this.label = label
|
|
133
|
-
this.value = value
|
|
134
|
-
this.nowdoc = nowdoc
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
class InterpolatedString extends ASTNode {
|
|
139
|
-
constructor(parts = [], loc = null) {
|
|
140
|
-
super('InterpolatedString', loc)
|
|
141
|
-
this.parts = parts
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
class BinaryExpression extends ASTNode {
|
|
146
|
-
constructor(operator, left, right, loc = null) {
|
|
147
|
-
super('BinaryExpression', loc)
|
|
148
|
-
this.operator = operator
|
|
149
|
-
this.left = left
|
|
150
|
-
this.right = right
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
class UnaryExpression extends ASTNode {
|
|
155
|
-
constructor(operator, argument, prefix = true, loc = null) {
|
|
156
|
-
super('UnaryExpression', loc)
|
|
157
|
-
this.operator = operator
|
|
158
|
-
this.argument = argument
|
|
159
|
-
this.prefix = prefix
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
class UpdateExpression extends ASTNode {
|
|
164
|
-
constructor(operator, argument, prefix = true, loc = null) {
|
|
165
|
-
super('UpdateExpression', loc)
|
|
166
|
-
this.operator = operator
|
|
167
|
-
this.argument = argument
|
|
168
|
-
this.prefix = prefix
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
class AssignmentExpression extends ASTNode {
|
|
173
|
-
constructor(operator, left, right, loc = null) {
|
|
174
|
-
super('AssignmentExpression', loc)
|
|
175
|
-
this.operator = operator
|
|
176
|
-
this.left = left
|
|
177
|
-
this.right = right
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
class ConditionalExpression extends ASTNode {
|
|
182
|
-
constructor(test, consequent, alternate, loc = null) {
|
|
183
|
-
super('ConditionalExpression', loc)
|
|
184
|
-
this.test = test
|
|
185
|
-
this.consequent = consequent
|
|
186
|
-
this.alternate = alternate
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
class NullCoalescingExpression extends ASTNode {
|
|
191
|
-
constructor(left, right, loc = null) {
|
|
192
|
-
super('NullCoalescingExpression', loc)
|
|
193
|
-
this.left = left
|
|
194
|
-
this.right = right
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
class SpaceshipExpression extends ASTNode {
|
|
199
|
-
constructor(left, right, loc = null) {
|
|
200
|
-
super('SpaceshipExpression', loc)
|
|
201
|
-
this.left = left
|
|
202
|
-
this.right = right
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
class InstanceofExpression extends ASTNode {
|
|
207
|
-
constructor(left, right, loc = null) {
|
|
208
|
-
super('InstanceofExpression', loc)
|
|
209
|
-
this.left = left
|
|
210
|
-
this.right = right
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
class CastExpression extends ASTNode {
|
|
215
|
-
constructor(castType, expression, loc = null) {
|
|
216
|
-
super('CastExpression', loc)
|
|
217
|
-
this.castType = castType
|
|
218
|
-
this.expression = expression
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
class CloneExpression extends ASTNode {
|
|
223
|
-
constructor(expression, loc = null) {
|
|
224
|
-
super('CloneExpression', loc)
|
|
225
|
-
this.expression = expression
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
class ErrorSuppressExpression extends ASTNode {
|
|
230
|
-
constructor(expression, loc = null) {
|
|
231
|
-
super('ErrorSuppressExpression', loc)
|
|
232
|
-
this.expression = expression
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
class IfStatement extends ASTNode {
|
|
237
|
-
constructor(test, consequent, alternate = null, loc = null) {
|
|
238
|
-
super('IfStatement', loc)
|
|
239
|
-
this.test = test
|
|
240
|
-
this.consequent = consequent
|
|
241
|
-
this.alternate = alternate
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
class SwitchStatement extends ASTNode {
|
|
246
|
-
constructor(discriminant, cases = [], loc = null) {
|
|
247
|
-
super('SwitchStatement', loc)
|
|
248
|
-
this.discriminant = discriminant
|
|
249
|
-
this.cases = cases
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
class SwitchCase extends ASTNode {
|
|
254
|
-
constructor(test, consequent = [], loc = null) {
|
|
255
|
-
super('SwitchCase', loc)
|
|
256
|
-
this.test = test
|
|
257
|
-
this.consequent = consequent
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
class MatchExpression extends ASTNode {
|
|
262
|
-
constructor(condition, arms = [], loc = null) {
|
|
263
|
-
super('MatchExpression', loc)
|
|
264
|
-
this.condition = condition
|
|
265
|
-
this.arms = arms
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
class MatchArm extends ASTNode {
|
|
270
|
-
constructor(conditions, body, isDefault = false, loc = null) {
|
|
271
|
-
super('MatchArm', loc)
|
|
272
|
-
this.conditions = conditions
|
|
273
|
-
this.body = body
|
|
274
|
-
this.isDefault = isDefault
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
class ForStatement extends ASTNode {
|
|
279
|
-
constructor(init, test, update, body, loc = null) {
|
|
280
|
-
super('ForStatement', loc)
|
|
281
|
-
this.init = init
|
|
282
|
-
this.test = test
|
|
283
|
-
this.update = update
|
|
284
|
-
this.body = body
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
class ForeachStatement extends ASTNode {
|
|
289
|
-
constructor(source, key, value, body, byRef = false, loc = null) {
|
|
290
|
-
super('ForeachStatement', loc)
|
|
291
|
-
this.source = source
|
|
292
|
-
this.key = key
|
|
293
|
-
this.value = value
|
|
294
|
-
this.body = body
|
|
295
|
-
this.byRef = byRef
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
class WhileStatement extends ASTNode {
|
|
300
|
-
constructor(test, body, loc = null) {
|
|
301
|
-
super('WhileStatement', loc)
|
|
302
|
-
this.test = test
|
|
303
|
-
this.body = body
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
class DoWhileStatement extends ASTNode {
|
|
308
|
-
constructor(body, test, loc = null) {
|
|
309
|
-
super('DoWhileStatement', loc)
|
|
310
|
-
this.body = body
|
|
311
|
-
this.test = test
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
class BreakStatement extends ASTNode {
|
|
316
|
-
constructor(level = null, loc = null) {
|
|
317
|
-
super('BreakStatement', loc)
|
|
318
|
-
this.level = level
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
class ContinueStatement extends ASTNode {
|
|
323
|
-
constructor(level = null, loc = null) {
|
|
324
|
-
super('ContinueStatement', loc)
|
|
325
|
-
this.level = level
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
class ReturnStatement extends ASTNode {
|
|
330
|
-
constructor(argument = null, loc = null) {
|
|
331
|
-
super('ReturnStatement', loc)
|
|
332
|
-
this.argument = argument
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
class ThrowStatement extends ASTNode {
|
|
337
|
-
constructor(argument, loc = null) {
|
|
338
|
-
super('ThrowStatement', loc)
|
|
339
|
-
this.argument = argument
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
class TryStatement extends ASTNode {
|
|
344
|
-
constructor(block, catches = [], finalizer = null, loc = null) {
|
|
345
|
-
super('TryStatement', loc)
|
|
346
|
-
this.block = block
|
|
347
|
-
this.catches = catches
|
|
348
|
-
this.finalizer = finalizer
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
class CatchClause extends ASTNode {
|
|
353
|
-
constructor(types, param, body, loc = null) {
|
|
354
|
-
super('CatchClause', loc)
|
|
355
|
-
this.types = types
|
|
356
|
-
this.param = param
|
|
357
|
-
this.body = body
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
class FinallyClause extends ASTNode {
|
|
362
|
-
constructor(body, loc = null) {
|
|
363
|
-
super('FinallyClause', loc)
|
|
364
|
-
this.body = body
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
class FunctionDeclaration extends ASTNode {
|
|
369
|
-
constructor(name, params = [], body, returnType = null, byRef = false, loc = null) {
|
|
370
|
-
super('FunctionDeclaration', loc)
|
|
371
|
-
this.name = name
|
|
372
|
-
this.params = params
|
|
373
|
-
this.body = body
|
|
374
|
-
this.returnType = returnType
|
|
375
|
-
this.byRef = byRef
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
class ArrowFunction extends ASTNode {
|
|
380
|
-
constructor(params = [], body, returnType = null, isStatic = false, loc = null) {
|
|
381
|
-
super('ArrowFunction', loc)
|
|
382
|
-
this.params = params
|
|
383
|
-
this.body = body
|
|
384
|
-
this.returnType = returnType
|
|
385
|
-
this.static = isStatic
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
class ClosureExpression extends ASTNode {
|
|
390
|
-
constructor(params = [], uses = [], body, returnType = null, isStatic = false, loc = null) {
|
|
391
|
-
super('ClosureExpression', loc)
|
|
392
|
-
this.params = params
|
|
393
|
-
this.uses = uses
|
|
394
|
-
this.body = body
|
|
395
|
-
this.returnType = returnType
|
|
396
|
-
this.static = isStatic
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
class ClosureUse extends ASTNode {
|
|
401
|
-
constructor(variable, byRef = false, loc = null) {
|
|
402
|
-
super('ClosureUse', loc)
|
|
403
|
-
this.variable = variable
|
|
404
|
-
this.byRef = byRef
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
class Parameter extends ASTNode {
|
|
409
|
-
constructor(name, type = null, defaultValue = null, byRef = false, variadic = false, visibility = null, readonly = false, loc = null) {
|
|
410
|
-
super('Parameter', loc)
|
|
411
|
-
this.name = name
|
|
412
|
-
this.paramType = type
|
|
413
|
-
this.default = defaultValue
|
|
414
|
-
this.byRef = byRef
|
|
415
|
-
this.variadic = variadic
|
|
416
|
-
this.visibility = visibility
|
|
417
|
-
this.readonly = readonly
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
class TypeReference extends ASTNode {
|
|
422
|
-
constructor(name, nullable = false, loc = null) {
|
|
423
|
-
super('TypeReference', loc)
|
|
424
|
-
this.name = name
|
|
425
|
-
this.nullable = nullable
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
class UnionType extends ASTNode {
|
|
430
|
-
constructor(types = [], loc = null) {
|
|
431
|
-
super('UnionType', loc)
|
|
432
|
-
this.types = types
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
class IntersectionType extends ASTNode {
|
|
437
|
-
constructor(types = [], loc = null) {
|
|
438
|
-
super('IntersectionType', loc)
|
|
439
|
-
this.types = types
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
class CallExpression extends ASTNode {
|
|
444
|
-
constructor(callee, arguments_ = [], loc = null) {
|
|
445
|
-
super('CallExpression', loc)
|
|
446
|
-
this.callee = callee
|
|
447
|
-
this.arguments = arguments_
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
class NamedArgument extends ASTNode {
|
|
452
|
-
constructor(name, value, loc = null) {
|
|
453
|
-
super('NamedArgument', loc)
|
|
454
|
-
this.name = name
|
|
455
|
-
this.value = value
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
class NewExpression extends ASTNode {
|
|
460
|
-
constructor(callee, arguments_ = [], loc = null) {
|
|
461
|
-
super('NewExpression', loc)
|
|
462
|
-
this.callee = callee
|
|
463
|
-
this.arguments = arguments_
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
class MemberExpression extends ASTNode {
|
|
468
|
-
constructor(object, property, nullsafe = false, loc = null) {
|
|
469
|
-
super('MemberExpression', loc)
|
|
470
|
-
this.object = object
|
|
471
|
-
this.property = property
|
|
472
|
-
this.nullsafe = nullsafe
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
class StaticMemberExpression extends ASTNode {
|
|
477
|
-
constructor(object, property, loc = null) {
|
|
478
|
-
super('StaticMemberExpression', loc)
|
|
479
|
-
this.object = object
|
|
480
|
-
this.property = property
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
class ArrayAccess extends ASTNode {
|
|
485
|
-
constructor(array, index, loc = null) {
|
|
486
|
-
super('ArrayAccess', loc)
|
|
487
|
-
this.array = array
|
|
488
|
-
this.index = index
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
class ClassDeclaration extends ASTNode {
|
|
493
|
-
constructor(name, body, superClass = null, interfaces = [], modifiers = [], attributes = [], loc = null) {
|
|
494
|
-
super('ClassDeclaration', loc)
|
|
495
|
-
this.name = name
|
|
496
|
-
this.body = body
|
|
497
|
-
this.superClass = superClass
|
|
498
|
-
this.interfaces = interfaces
|
|
499
|
-
this.modifiers = modifiers
|
|
500
|
-
this.attributes = attributes
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
class ClassBody extends ASTNode {
|
|
505
|
-
constructor(members = [], loc = null) {
|
|
506
|
-
super('ClassBody', loc)
|
|
507
|
-
this.members = members
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
class MethodDefinition extends ASTNode {
|
|
512
|
-
constructor(name, params = [], body, returnType = null, modifiers = [], byRef = false, attributes = [], loc = null) {
|
|
513
|
-
super('MethodDefinition', loc)
|
|
514
|
-
this.name = name
|
|
515
|
-
this.params = params
|
|
516
|
-
this.body = body
|
|
517
|
-
this.returnType = returnType
|
|
518
|
-
this.modifiers = modifiers
|
|
519
|
-
this.byRef = byRef
|
|
520
|
-
this.attributes = attributes
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
class PropertyDeclaration extends ASTNode {
|
|
525
|
-
constructor(name, value = null, type = null, modifiers = [], attributes = [], loc = null) {
|
|
526
|
-
super('PropertyDeclaration', loc)
|
|
527
|
-
this.name = name
|
|
528
|
-
this.value = value
|
|
529
|
-
this.propertyType = type
|
|
530
|
-
this.modifiers = modifiers
|
|
531
|
-
this.attributes = attributes
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
class ClassConstant extends ASTNode {
|
|
536
|
-
constructor(name, value, modifiers = [], type = null, loc = null) {
|
|
537
|
-
super('ClassConstant', loc)
|
|
538
|
-
this.name = name
|
|
539
|
-
this.value = value
|
|
540
|
-
this.modifiers = modifiers
|
|
541
|
-
this.constType = type
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
class InterfaceDeclaration extends ASTNode {
|
|
546
|
-
constructor(name, body, extends_ = [], attributes = [], loc = null) {
|
|
547
|
-
super('InterfaceDeclaration', loc)
|
|
548
|
-
this.name = name
|
|
549
|
-
this.body = body
|
|
550
|
-
this.extends = extends_
|
|
551
|
-
this.attributes = attributes
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
class TraitDeclaration extends ASTNode {
|
|
556
|
-
constructor(name, body, attributes = [], loc = null) {
|
|
557
|
-
super('TraitDeclaration', loc)
|
|
558
|
-
this.name = name
|
|
559
|
-
this.body = body
|
|
560
|
-
this.attributes = attributes
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
class TraitUse extends ASTNode {
|
|
565
|
-
constructor(traits = [], adaptations = [], loc = null) {
|
|
566
|
-
super('TraitUse', loc)
|
|
567
|
-
this.traits = traits
|
|
568
|
-
this.adaptations = adaptations
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
class TraitAlias extends ASTNode {
|
|
573
|
-
constructor(trait, method, newName, visibility = null, loc = null) {
|
|
574
|
-
super('TraitAlias', loc)
|
|
575
|
-
this.trait = trait
|
|
576
|
-
this.method = method
|
|
577
|
-
this.newName = newName
|
|
578
|
-
this.visibility = visibility
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
class TraitInsteadof extends ASTNode {
|
|
583
|
-
constructor(trait, method, insteadof = [], loc = null) {
|
|
584
|
-
super('TraitInsteadof', loc)
|
|
585
|
-
this.trait = trait
|
|
586
|
-
this.method = method
|
|
587
|
-
this.insteadof = insteadof
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
class EnumDeclaration extends ASTNode {
|
|
592
|
-
constructor(name, body, backingType = null, interfaces = [], attributes = [], loc = null) {
|
|
593
|
-
super('EnumDeclaration', loc)
|
|
594
|
-
this.name = name
|
|
595
|
-
this.body = body
|
|
596
|
-
this.backingType = backingType
|
|
597
|
-
this.interfaces = interfaces
|
|
598
|
-
this.attributes = attributes
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
class EnumCase extends ASTNode {
|
|
603
|
-
constructor(name, value = null, attributes = [], loc = null) {
|
|
604
|
-
super('EnumCase', loc)
|
|
605
|
-
this.name = name
|
|
606
|
-
this.value = value
|
|
607
|
-
this.attributes = attributes
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
class Attribute extends ASTNode {
|
|
612
|
-
constructor(name, arguments_ = [], loc = null) {
|
|
613
|
-
super('Attribute', loc)
|
|
614
|
-
this.name = name
|
|
615
|
-
this.arguments = arguments_
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
class AttributeGroup extends ASTNode {
|
|
620
|
-
constructor(attributes = [], loc = null) {
|
|
621
|
-
super('AttributeGroup', loc)
|
|
622
|
-
this.attributes = attributes
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
class NamespaceDeclaration extends ASTNode {
|
|
627
|
-
constructor(name, body = null, loc = null) {
|
|
628
|
-
super('NamespaceDeclaration', loc)
|
|
629
|
-
this.name = name
|
|
630
|
-
this.body = body
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
class UseDeclaration extends ASTNode {
|
|
635
|
-
constructor(declarations = [], type = null, loc = null) {
|
|
636
|
-
super('UseDeclaration', loc)
|
|
637
|
-
this.declarations = declarations
|
|
638
|
-
this.useType = type
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
class UseClause extends ASTNode {
|
|
643
|
-
constructor(name, alias = null, loc = null) {
|
|
644
|
-
super('UseClause', loc)
|
|
645
|
-
this.name = name
|
|
646
|
-
this.alias = alias
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
class GroupUse extends ASTNode {
|
|
651
|
-
constructor(prefix, uses = [], type = null, loc = null) {
|
|
652
|
-
super('GroupUse', loc)
|
|
653
|
-
this.prefix = prefix
|
|
654
|
-
this.uses = uses
|
|
655
|
-
this.useType = type
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
class IncludeExpression extends ASTNode {
|
|
660
|
-
constructor(path, once = false, require = false, loc = null) {
|
|
661
|
-
super('IncludeExpression', loc)
|
|
662
|
-
this.path = path
|
|
663
|
-
this.once = once
|
|
664
|
-
this.require = require
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
class ExpressionStatement extends ASTNode {
|
|
669
|
-
constructor(expression, loc = null) {
|
|
670
|
-
super('ExpressionStatement', loc)
|
|
671
|
-
this.expression = expression
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
class BlockStatement extends ASTNode {
|
|
676
|
-
constructor(body = [], loc = null) {
|
|
677
|
-
super('BlockStatement', loc)
|
|
678
|
-
this.body = body
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
class EmptyStatement extends ASTNode {
|
|
683
|
-
constructor(loc = null) {
|
|
684
|
-
super('EmptyStatement', loc)
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
class GlobalStatement extends ASTNode {
|
|
689
|
-
constructor(variables = [], loc = null) {
|
|
690
|
-
super('GlobalStatement', loc)
|
|
691
|
-
this.variables = variables
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
class StaticStatement extends ASTNode {
|
|
696
|
-
constructor(declarations = [], loc = null) {
|
|
697
|
-
super('StaticStatement', loc)
|
|
698
|
-
this.declarations = declarations
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
class StaticVariable extends ASTNode {
|
|
703
|
-
constructor(name, value = null, loc = null) {
|
|
704
|
-
super('StaticVariable', loc)
|
|
705
|
-
this.name = name
|
|
706
|
-
this.value = value
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
class DeclareStatement extends ASTNode {
|
|
711
|
-
constructor(directives = [], body = null, loc = null) {
|
|
712
|
-
super('DeclareStatement', loc)
|
|
713
|
-
this.directives = directives
|
|
714
|
-
this.body = body
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
class DeclareDirective extends ASTNode {
|
|
719
|
-
constructor(name, value, loc = null) {
|
|
720
|
-
super('DeclareDirective', loc)
|
|
721
|
-
this.name = name
|
|
722
|
-
this.value = value
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
class ListExpression extends ASTNode {
|
|
727
|
-
constructor(elements = [], loc = null) {
|
|
728
|
-
super('ListExpression', loc)
|
|
729
|
-
this.elements = elements
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
class YieldExpression extends ASTNode {
|
|
734
|
-
constructor(key = null, value = null, loc = null) {
|
|
735
|
-
super('YieldExpression', loc)
|
|
736
|
-
this.key = key
|
|
737
|
-
this.value = value
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
class YieldFromExpression extends ASTNode {
|
|
742
|
-
constructor(expression, loc = null) {
|
|
743
|
-
super('YieldFromExpression', loc)
|
|
744
|
-
this.expression = expression
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
class ThrowExpression extends ASTNode {
|
|
749
|
-
constructor(argument, loc = null) {
|
|
750
|
-
super('ThrowExpression', loc)
|
|
751
|
-
this.argument = argument
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
class ExitExpression extends ASTNode {
|
|
756
|
-
constructor(argument = null, isDie = false, loc = null) {
|
|
757
|
-
super('ExitExpression', loc)
|
|
758
|
-
this.argument = argument
|
|
759
|
-
this.isDie = isDie
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
class EmptyExpression extends ASTNode {
|
|
764
|
-
constructor(argument, loc = null) {
|
|
765
|
-
super('EmptyExpression', loc)
|
|
766
|
-
this.argument = argument
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
class IssetExpression extends ASTNode {
|
|
771
|
-
constructor(arguments_ = [], loc = null) {
|
|
772
|
-
super('IssetExpression', loc)
|
|
773
|
-
this.arguments = arguments_
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
class UnsetStatement extends ASTNode {
|
|
778
|
-
constructor(arguments_ = [], loc = null) {
|
|
779
|
-
super('UnsetStatement', loc)
|
|
780
|
-
this.arguments = arguments_
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
class EvalExpression extends ASTNode {
|
|
785
|
-
constructor(code, loc = null) {
|
|
786
|
-
super('EvalExpression', loc)
|
|
787
|
-
this.code = code
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
class PrintExpression extends ASTNode {
|
|
792
|
-
constructor(argument, loc = null) {
|
|
793
|
-
super('PrintExpression', loc)
|
|
794
|
-
this.argument = argument
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
class ShellExecExpression extends ASTNode {
|
|
799
|
-
constructor(command, loc = null) {
|
|
800
|
-
super('ShellExecExpression', loc)
|
|
801
|
-
this.command = command
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
class AnonymousClass extends ASTNode {
|
|
806
|
-
constructor(arguments_ = [], superClass = null, interfaces = [], body, loc = null) {
|
|
807
|
-
super('AnonymousClass', loc)
|
|
808
|
-
this.arguments = arguments_
|
|
809
|
-
this.superClass = superClass
|
|
810
|
-
this.interfaces = interfaces
|
|
811
|
-
this.body = body
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
class NamespaceName extends ASTNode {
|
|
816
|
-
constructor(parts = [], absolute = false, loc = null) {
|
|
817
|
-
super('NamespaceName', loc)
|
|
818
|
-
this.parts = parts
|
|
819
|
-
this.absolute = absolute
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
class LabelStatement extends ASTNode {
|
|
824
|
-
constructor(name, loc = null) {
|
|
825
|
-
super('LabelStatement', loc)
|
|
826
|
-
this.name = name
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
class GotoStatement extends ASTNode {
|
|
831
|
-
constructor(label, loc = null) {
|
|
832
|
-
super('GotoStatement', loc)
|
|
833
|
-
this.label = label
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
class EtherNaturalExpression extends ASTNode {
|
|
838
|
-
constructor(description, loc = null) {
|
|
839
|
-
super('EtherNaturalExpression', loc)
|
|
840
|
-
this.description = description
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
class EtherPipeExpression extends ASTNode {
|
|
845
|
-
constructor(left, right, loc = null) {
|
|
846
|
-
super('EtherPipeExpression', loc)
|
|
847
|
-
this.left = left
|
|
848
|
-
this.right = right
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
module.exports = {
|
|
853
|
-
ASTNode,
|
|
854
|
-
Program,
|
|
855
|
-
PHPBlock,
|
|
856
|
-
HTMLBlock,
|
|
857
|
-
EchoStatement,
|
|
858
|
-
PrintStatement,
|
|
859
|
-
Identifier,
|
|
860
|
-
Variable,
|
|
861
|
-
VariableVariable,
|
|
862
|
-
ConstantDeclaration,
|
|
863
|
-
DefineCall,
|
|
864
|
-
StringLiteral,
|
|
865
|
-
NumericLiteral,
|
|
866
|
-
BooleanLiteral,
|
|
867
|
-
NullLiteral,
|
|
868
|
-
ArrayExpression,
|
|
869
|
-
ArrayElement,
|
|
870
|
-
HeredocLiteral,
|
|
871
|
-
InterpolatedString,
|
|
872
|
-
BinaryExpression,
|
|
873
|
-
UnaryExpression,
|
|
874
|
-
UpdateExpression,
|
|
875
|
-
AssignmentExpression,
|
|
876
|
-
ConditionalExpression,
|
|
877
|
-
NullCoalescingExpression,
|
|
878
|
-
SpaceshipExpression,
|
|
879
|
-
InstanceofExpression,
|
|
880
|
-
CastExpression,
|
|
881
|
-
CloneExpression,
|
|
882
|
-
ErrorSuppressExpression,
|
|
883
|
-
IfStatement,
|
|
884
|
-
SwitchStatement,
|
|
885
|
-
SwitchCase,
|
|
886
|
-
MatchExpression,
|
|
887
|
-
MatchArm,
|
|
888
|
-
ForStatement,
|
|
889
|
-
ForeachStatement,
|
|
890
|
-
WhileStatement,
|
|
891
|
-
DoWhileStatement,
|
|
892
|
-
BreakStatement,
|
|
893
|
-
ContinueStatement,
|
|
894
|
-
ReturnStatement,
|
|
895
|
-
ThrowStatement,
|
|
896
|
-
TryStatement,
|
|
897
|
-
CatchClause,
|
|
898
|
-
FinallyClause,
|
|
899
|
-
FunctionDeclaration,
|
|
900
|
-
ArrowFunction,
|
|
901
|
-
ClosureExpression,
|
|
902
|
-
ClosureUse,
|
|
903
|
-
Parameter,
|
|
904
|
-
TypeReference,
|
|
905
|
-
UnionType,
|
|
906
|
-
IntersectionType,
|
|
907
|
-
CallExpression,
|
|
908
|
-
NamedArgument,
|
|
909
|
-
NewExpression,
|
|
910
|
-
MemberExpression,
|
|
911
|
-
StaticMemberExpression,
|
|
912
|
-
ArrayAccess,
|
|
913
|
-
ClassDeclaration,
|
|
914
|
-
ClassBody,
|
|
915
|
-
MethodDefinition,
|
|
916
|
-
PropertyDeclaration,
|
|
917
|
-
ClassConstant,
|
|
918
|
-
InterfaceDeclaration,
|
|
919
|
-
TraitDeclaration,
|
|
920
|
-
TraitUse,
|
|
921
|
-
TraitAlias,
|
|
922
|
-
TraitInsteadof,
|
|
923
|
-
EnumDeclaration,
|
|
924
|
-
EnumCase,
|
|
925
|
-
Attribute,
|
|
926
|
-
AttributeGroup,
|
|
927
|
-
NamespaceDeclaration,
|
|
928
|
-
UseDeclaration,
|
|
929
|
-
UseClause,
|
|
930
|
-
GroupUse,
|
|
931
|
-
IncludeExpression,
|
|
932
|
-
ExpressionStatement,
|
|
933
|
-
BlockStatement,
|
|
934
|
-
EmptyStatement,
|
|
935
|
-
GlobalStatement,
|
|
936
|
-
StaticStatement,
|
|
937
|
-
StaticVariable,
|
|
938
|
-
DeclareStatement,
|
|
939
|
-
DeclareDirective,
|
|
940
|
-
ListExpression,
|
|
941
|
-
YieldExpression,
|
|
942
|
-
YieldFromExpression,
|
|
943
|
-
ThrowExpression,
|
|
944
|
-
ExitExpression,
|
|
945
|
-
EmptyExpression,
|
|
946
|
-
IssetExpression,
|
|
947
|
-
UnsetStatement,
|
|
948
|
-
EvalExpression,
|
|
949
|
-
PrintExpression,
|
|
950
|
-
ShellExecExpression,
|
|
951
|
-
AnonymousClass,
|
|
952
|
-
NamespaceName,
|
|
953
|
-
LabelStatement,
|
|
954
|
-
GotoStatement,
|
|
955
|
-
EtherNaturalExpression,
|
|
956
|
-
EtherPipeExpression
|
|
957
|
-
}
|