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.
Files changed (44) hide show
  1. package/cli/ether.js +1 -1
  2. package/generators/css-generator.js +42 -55
  3. package/generators/graphql-generator.js +19 -22
  4. package/generators/html-generator.js +51 -182
  5. package/generators/js-generator.js +76 -157
  6. package/generators/node-generator.js +49 -93
  7. package/generators/php-generator.js +46 -68
  8. package/generators/python-generator.js +35 -54
  9. package/generators/react-generator.js +37 -47
  10. package/generators/ruby-generator.js +59 -119
  11. package/generators/sql-generator.js +42 -63
  12. package/generators/ts-generator.js +59 -133
  13. package/i18n/i18n-css.json +147 -147
  14. package/i18n/i18n-graphql.json +6 -6
  15. package/i18n/i18n-html.json +135 -135
  16. package/i18n/i18n-js.json +107 -107
  17. package/i18n/i18n-node.json +14 -14
  18. package/i18n/i18n-php.json +177 -177
  19. package/i18n/i18n-python.json +16 -16
  20. package/i18n/i18n-react.json +97 -97
  21. package/i18n/i18n-ruby.json +22 -22
  22. package/i18n/i18n-sql.json +153 -153
  23. package/i18n/i18n-ts.json +10 -10
  24. package/lexer/ether-lexer.js +175 -34
  25. package/lexer/tokens.js +6 -6
  26. package/package.json +1 -1
  27. package/parsers/ast-css.js +0 -545
  28. package/parsers/ast-graphql.js +0 -424
  29. package/parsers/ast-html.js +0 -886
  30. package/parsers/ast-js.js +0 -750
  31. package/parsers/ast-node.js +0 -2440
  32. package/parsers/ast-php.js +0 -957
  33. package/parsers/ast-react.js +0 -580
  34. package/parsers/ast-ruby.js +0 -895
  35. package/parsers/ast-ts.js +0 -1352
  36. package/parsers/css-parser.js +0 -1981
  37. package/parsers/graphql-parser.js +0 -2011
  38. package/parsers/html-parser.js +0 -1182
  39. package/parsers/js-parser.js +0 -2564
  40. package/parsers/node-parser.js +0 -2644
  41. package/parsers/php-parser.js +0 -3037
  42. package/parsers/react-parser.js +0 -1035
  43. package/parsers/ruby-parser.js +0 -2680
  44. package/parsers/ts-parser.js +0 -3881
@@ -1,424 +0,0 @@
1
- class ASTNode {
2
- constructor(type, loc = null) {
3
- this.type = type
4
- this.loc = loc
5
- }
6
- }
7
-
8
- class DocumentNode extends ASTNode {
9
- constructor(definitions, loc = null) {
10
- super('Document', loc)
11
- this.definitions = definitions
12
- }
13
- }
14
-
15
- class OperationDefinitionNode extends ASTNode {
16
- constructor(operation, name, variableDefinitions, directives, selectionSet, loc = null) {
17
- super('OperationDefinition', loc)
18
- this.operation = operation
19
- this.name = name
20
- this.variableDefinitions = variableDefinitions
21
- this.directives = directives
22
- this.selectionSet = selectionSet
23
- }
24
- }
25
-
26
- class VariableDefinitionNode extends ASTNode {
27
- constructor(variable, type, defaultValue, directives, loc = null) {
28
- super('VariableDefinition', loc)
29
- this.variable = variable
30
- this.type = type
31
- this.defaultValue = defaultValue
32
- this.directives = directives
33
- }
34
- }
35
-
36
- class VariableNode extends ASTNode {
37
- constructor(name, loc = null) {
38
- super('Variable', loc)
39
- this.name = name
40
- }
41
- }
42
-
43
- class SelectionSetNode extends ASTNode {
44
- constructor(selections, loc = null) {
45
- super('SelectionSet', loc)
46
- this.selections = selections
47
- }
48
- }
49
-
50
- class FieldNode extends ASTNode {
51
- constructor(alias, name, args, directives, selectionSet, loc = null) {
52
- super('Field', loc)
53
- this.alias = alias
54
- this.name = name
55
- this.arguments = args
56
- this.directives = directives
57
- this.selectionSet = selectionSet
58
- }
59
- }
60
-
61
- class ArgumentNode extends ASTNode {
62
- constructor(name, value, loc = null) {
63
- super('Argument', loc)
64
- this.name = name
65
- this.value = value
66
- }
67
- }
68
-
69
- class FragmentSpreadNode extends ASTNode {
70
- constructor(name, directives, loc = null) {
71
- super('FragmentSpread', loc)
72
- this.name = name
73
- this.directives = directives
74
- }
75
- }
76
-
77
- class InlineFragmentNode extends ASTNode {
78
- constructor(typeCondition, directives, selectionSet, loc = null) {
79
- super('InlineFragment', loc)
80
- this.typeCondition = typeCondition
81
- this.directives = directives
82
- this.selectionSet = selectionSet
83
- }
84
- }
85
-
86
- class FragmentDefinitionNode extends ASTNode {
87
- constructor(name, typeCondition, directives, selectionSet, loc = null) {
88
- super('FragmentDefinition', loc)
89
- this.name = name
90
- this.typeCondition = typeCondition
91
- this.directives = directives
92
- this.selectionSet = selectionSet
93
- }
94
- }
95
-
96
- class IntValueNode extends ASTNode {
97
- constructor(value, loc = null) {
98
- super('IntValue', loc)
99
- this.value = value
100
- }
101
- }
102
-
103
- class FloatValueNode extends ASTNode {
104
- constructor(value, loc = null) {
105
- super('FloatValue', loc)
106
- this.value = value
107
- }
108
- }
109
-
110
- class StringValueNode extends ASTNode {
111
- constructor(value, block = false, loc = null) {
112
- super('StringValue', loc)
113
- this.value = value
114
- this.block = block
115
- }
116
- }
117
-
118
- class BooleanValueNode extends ASTNode {
119
- constructor(value, loc = null) {
120
- super('BooleanValue', loc)
121
- this.value = value
122
- }
123
- }
124
-
125
- class NullValueNode extends ASTNode {
126
- constructor(loc = null) {
127
- super('NullValue', loc)
128
- }
129
- }
130
-
131
- class EnumValueNode extends ASTNode {
132
- constructor(value, loc = null) {
133
- super('EnumValue', loc)
134
- this.value = value
135
- }
136
- }
137
-
138
- class ListValueNode extends ASTNode {
139
- constructor(values, loc = null) {
140
- super('ListValue', loc)
141
- this.values = values
142
- }
143
- }
144
-
145
- class ObjectValueNode extends ASTNode {
146
- constructor(fields, loc = null) {
147
- super('ObjectValue', loc)
148
- this.fields = fields
149
- }
150
- }
151
-
152
- class ObjectFieldNode extends ASTNode {
153
- constructor(name, value, loc = null) {
154
- super('ObjectField', loc)
155
- this.name = name
156
- this.value = value
157
- }
158
- }
159
-
160
- class DirectiveNode extends ASTNode {
161
- constructor(name, args, loc = null) {
162
- super('Directive', loc)
163
- this.name = name
164
- this.arguments = args
165
- }
166
- }
167
-
168
- class NamedTypeNode extends ASTNode {
169
- constructor(name, loc = null) {
170
- super('NamedType', loc)
171
- this.name = name
172
- }
173
- }
174
-
175
- class ListTypeNode extends ASTNode {
176
- constructor(type, loc = null) {
177
- super('ListType', loc)
178
- this.type = type
179
- }
180
- }
181
-
182
- class NonNullTypeNode extends ASTNode {
183
- constructor(type, loc = null) {
184
- super('NonNullType', loc)
185
- this.type = type
186
- }
187
- }
188
-
189
- class NameNode extends ASTNode {
190
- constructor(value, loc = null) {
191
- super('Name', loc)
192
- this.value = value
193
- }
194
- }
195
-
196
- class SchemaDefinitionNode extends ASTNode {
197
- constructor(description, directives, operationTypes, loc = null) {
198
- super('SchemaDefinition', loc)
199
- this.description = description
200
- this.directives = directives
201
- this.operationTypes = operationTypes
202
- }
203
- }
204
-
205
- class OperationTypeDefinitionNode extends ASTNode {
206
- constructor(operation, type, loc = null) {
207
- super('OperationTypeDefinition', loc)
208
- this.operation = operation
209
- this.type = type
210
- }
211
- }
212
-
213
- class ScalarTypeDefinitionNode extends ASTNode {
214
- constructor(description, name, directives, loc = null) {
215
- super('ScalarTypeDefinition', loc)
216
- this.description = description
217
- this.name = name
218
- this.directives = directives
219
- }
220
- }
221
-
222
- class ObjectTypeDefinitionNode extends ASTNode {
223
- constructor(description, name, interfaces, directives, fields, loc = null) {
224
- super('ObjectTypeDefinition', loc)
225
- this.description = description
226
- this.name = name
227
- this.interfaces = interfaces
228
- this.directives = directives
229
- this.fields = fields
230
- }
231
- }
232
-
233
- class FieldDefinitionNode extends ASTNode {
234
- constructor(description, name, args, type, directives, loc = null) {
235
- super('FieldDefinition', loc)
236
- this.description = description
237
- this.name = name
238
- this.arguments = args
239
- this.type = type
240
- this.directives = directives
241
- }
242
- }
243
-
244
- class InputValueDefinitionNode extends ASTNode {
245
- constructor(description, name, type, defaultValue, directives, loc = null) {
246
- super('InputValueDefinition', loc)
247
- this.description = description
248
- this.name = name
249
- this.type = type
250
- this.defaultValue = defaultValue
251
- this.directives = directives
252
- }
253
- }
254
-
255
- class InterfaceTypeDefinitionNode extends ASTNode {
256
- constructor(description, name, interfaces, directives, fields, loc = null) {
257
- super('InterfaceTypeDefinition', loc)
258
- this.description = description
259
- this.name = name
260
- this.interfaces = interfaces
261
- this.directives = directives
262
- this.fields = fields
263
- }
264
- }
265
-
266
- class UnionTypeDefinitionNode extends ASTNode {
267
- constructor(description, name, directives, types, loc = null) {
268
- super('UnionTypeDefinition', loc)
269
- this.description = description
270
- this.name = name
271
- this.directives = directives
272
- this.types = types
273
- }
274
- }
275
-
276
- class EnumTypeDefinitionNode extends ASTNode {
277
- constructor(description, name, directives, values, loc = null) {
278
- super('EnumTypeDefinition', loc)
279
- this.description = description
280
- this.name = name
281
- this.directives = directives
282
- this.values = values
283
- }
284
- }
285
-
286
- class EnumValueDefinitionNode extends ASTNode {
287
- constructor(description, name, directives, loc = null) {
288
- super('EnumValueDefinition', loc)
289
- this.description = description
290
- this.name = name
291
- this.directives = directives
292
- }
293
- }
294
-
295
- class InputObjectTypeDefinitionNode extends ASTNode {
296
- constructor(description, name, directives, fields, loc = null) {
297
- super('InputObjectTypeDefinition', loc)
298
- this.description = description
299
- this.name = name
300
- this.directives = directives
301
- this.fields = fields
302
- }
303
- }
304
-
305
- class DirectiveDefinitionNode extends ASTNode {
306
- constructor(description, name, args, repeatable, locations, loc = null) {
307
- super('DirectiveDefinition', loc)
308
- this.description = description
309
- this.name = name
310
- this.arguments = args
311
- this.repeatable = repeatable
312
- this.locations = locations
313
- }
314
- }
315
-
316
- class SchemaExtensionNode extends ASTNode {
317
- constructor(directives, operationTypes, loc = null) {
318
- super('SchemaExtension', loc)
319
- this.directives = directives
320
- this.operationTypes = operationTypes
321
- }
322
- }
323
-
324
- class ScalarTypeExtensionNode extends ASTNode {
325
- constructor(name, directives, loc = null) {
326
- super('ScalarTypeExtension', loc)
327
- this.name = name
328
- this.directives = directives
329
- }
330
- }
331
-
332
- class ObjectTypeExtensionNode extends ASTNode {
333
- constructor(name, interfaces, directives, fields, loc = null) {
334
- super('ObjectTypeExtension', loc)
335
- this.name = name
336
- this.interfaces = interfaces
337
- this.directives = directives
338
- this.fields = fields
339
- }
340
- }
341
-
342
- class InterfaceTypeExtensionNode extends ASTNode {
343
- constructor(name, interfaces, directives, fields, loc = null) {
344
- super('InterfaceTypeExtension', loc)
345
- this.name = name
346
- this.interfaces = interfaces
347
- this.directives = directives
348
- this.fields = fields
349
- }
350
- }
351
-
352
- class UnionTypeExtensionNode extends ASTNode {
353
- constructor(name, directives, types, loc = null) {
354
- super('UnionTypeExtension', loc)
355
- this.name = name
356
- this.directives = directives
357
- this.types = types
358
- }
359
- }
360
-
361
- class EnumTypeExtensionNode extends ASTNode {
362
- constructor(name, directives, values, loc = null) {
363
- super('EnumTypeExtension', loc)
364
- this.name = name
365
- this.directives = directives
366
- this.values = values
367
- }
368
- }
369
-
370
- class InputObjectTypeExtensionNode extends ASTNode {
371
- constructor(name, directives, fields, loc = null) {
372
- super('InputObjectTypeExtension', loc)
373
- this.name = name
374
- this.directives = directives
375
- this.fields = fields
376
- }
377
- }
378
-
379
- module.exports = {
380
- ASTNode,
381
- DocumentNode,
382
- OperationDefinitionNode,
383
- VariableDefinitionNode,
384
- VariableNode,
385
- SelectionSetNode,
386
- FieldNode,
387
- ArgumentNode,
388
- FragmentSpreadNode,
389
- InlineFragmentNode,
390
- FragmentDefinitionNode,
391
- IntValueNode,
392
- FloatValueNode,
393
- StringValueNode,
394
- BooleanValueNode,
395
- NullValueNode,
396
- EnumValueNode,
397
- ListValueNode,
398
- ObjectValueNode,
399
- ObjectFieldNode,
400
- DirectiveNode,
401
- NamedTypeNode,
402
- ListTypeNode,
403
- NonNullTypeNode,
404
- NameNode,
405
- SchemaDefinitionNode,
406
- OperationTypeDefinitionNode,
407
- ScalarTypeDefinitionNode,
408
- ObjectTypeDefinitionNode,
409
- FieldDefinitionNode,
410
- InputValueDefinitionNode,
411
- InterfaceTypeDefinitionNode,
412
- UnionTypeDefinitionNode,
413
- EnumTypeDefinitionNode,
414
- EnumValueDefinitionNode,
415
- InputObjectTypeDefinitionNode,
416
- DirectiveDefinitionNode,
417
- SchemaExtensionNode,
418
- ScalarTypeExtensionNode,
419
- ObjectTypeExtensionNode,
420
- InterfaceTypeExtensionNode,
421
- UnionTypeExtensionNode,
422
- EnumTypeExtensionNode,
423
- InputObjectTypeExtensionNode
424
- }