@ant-yasa/uast-parser-java-js 0.1.15-beta

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 (100) hide show
  1. package/.babelrc +12 -0
  2. package/.eslintignore +1 -0
  3. package/.eslintrc.js +38 -0
  4. package/.mocharc-integration.js +1 -0
  5. package/.mocharc.js +4 -0
  6. package/.prettierignore +1 -0
  7. package/.prettierrc +4 -0
  8. package/LEGAL.md +7 -0
  9. package/README.md +35 -0
  10. package/antlr/Java.g4 +1008 -0
  11. package/antlr/JavaLexer.g4 +241 -0
  12. package/antlr/JavaLexer_origin.g4 +241 -0
  13. package/antlr/JavaParser.g4 +765 -0
  14. package/antlr/JavaParser_origin.g4 +766 -0
  15. package/dist/package.json +73 -0
  16. package/dist/src/frontend/java/ASTBuilder.d.ts +171 -0
  17. package/dist/src/frontend/java/ASTBuilder.js +2369 -0
  18. package/dist/src/frontend/java/ASTBuilder.js.map +1 -0
  19. package/dist/src/frontend/java/ErrorListener.d.ts +9 -0
  20. package/dist/src/frontend/java/ErrorListener.js +24 -0
  21. package/dist/src/frontend/java/ErrorListener.js.map +1 -0
  22. package/dist/src/frontend/java/antlr/JavaLexer.d.ts +154 -0
  23. package/dist/src/frontend/java/antlr/JavaLexer.js +812 -0
  24. package/dist/src/frontend/java/antlr/JavaLexer.js.map +1 -0
  25. package/dist/src/frontend/java/antlr/JavaListener.d.ts +1393 -0
  26. package/dist/src/frontend/java/antlr/JavaListener.js +4 -0
  27. package/dist/src/frontend/java/antlr/JavaListener.js.map +1 -0
  28. package/dist/src/frontend/java/antlr/JavaParser.d.ts +2065 -0
  29. package/dist/src/frontend/java/antlr/JavaParser.js +15279 -0
  30. package/dist/src/frontend/java/antlr/JavaParser.js.map +1 -0
  31. package/dist/src/frontend/java/antlr/JavaVisitor.d.ts +892 -0
  32. package/dist/src/frontend/java/antlr/JavaVisitor.js +4 -0
  33. package/dist/src/frontend/java/antlr/JavaVisitor.js.map +1 -0
  34. package/dist/src/frontend/java/parser.d.ts +20 -0
  35. package/dist/src/frontend/java/parser.js +93 -0
  36. package/dist/src/frontend/java/parser.js.map +1 -0
  37. package/dist/src/frontend/java/testBuilder.d.ts +146 -0
  38. package/dist/src/frontend/java/testBuilder.js +464 -0
  39. package/dist/src/frontend/java/testBuilder.js.map +1 -0
  40. package/dist/src/frontend/java/types.d.ts +29 -0
  41. package/dist/src/frontend/java/types.js +3 -0
  42. package/dist/src/frontend/java/types.js.map +1 -0
  43. package/dist/src/frontend/javascript/parser.d.ts +8 -0
  44. package/dist/src/frontend/javascript/parser.js +1121 -0
  45. package/dist/src/frontend/javascript/parser.js.map +1 -0
  46. package/dist/src/index.d.ts +14 -0
  47. package/dist/src/index.js +76 -0
  48. package/dist/src/index.js.map +1 -0
  49. package/output.txt +3820 -0
  50. package/package.json +73 -0
  51. package/tests/benchmark/base/class.js +32 -0
  52. package/tests/benchmark/base/class.js.json +1809 -0
  53. package/tests/benchmark/base/class_test.js +13 -0
  54. package/tests/benchmark/base/class_test.js.json +435 -0
  55. package/tests/benchmark/base/comment.js +21 -0
  56. package/tests/benchmark/base/comment.js.json +1443 -0
  57. package/tests/benchmark/base/demo.ts +1060 -0
  58. package/tests/benchmark/base/empty.js +4 -0
  59. package/tests/benchmark/base/empty.js.json +202 -0
  60. package/tests/benchmark/base/export.js +36 -0
  61. package/tests/benchmark/base/export.js.json +6345 -0
  62. package/tests/benchmark/base/export1.js +2 -0
  63. package/tests/benchmark/base/export1.js.json +251 -0
  64. package/tests/benchmark/base/export2.js +35 -0
  65. package/tests/benchmark/base/export2.js.json +3297 -0
  66. package/tests/benchmark/base/expressions.js +25 -0
  67. package/tests/benchmark/base/expressions.js.json +1654 -0
  68. package/tests/benchmark/base/for.js +7 -0
  69. package/tests/benchmark/base/for.js.json +738 -0
  70. package/tests/benchmark/base/function.js +15 -0
  71. package/tests/benchmark/base/function.js.json +1458 -0
  72. package/tests/benchmark/base/import.js +3 -0
  73. package/tests/benchmark/base/import.js.json +416 -0
  74. package/tests/benchmark/base/literal.js +27 -0
  75. package/tests/benchmark/base/literal.js.json +1234 -0
  76. package/tests/benchmark/base/param.js +4 -0
  77. package/tests/benchmark/base/param.js.json +410 -0
  78. package/tests/benchmark/base/parseerror.js +1 -0
  79. package/tests/benchmark/base/parseerror.js.json +191 -0
  80. package/tests/benchmark/base/patternlike.js +24 -0
  81. package/tests/benchmark/base/patternlike.js.json +3720 -0
  82. package/tests/benchmark/base/react.js +8 -0
  83. package/tests/benchmark/base/react.js.json +211 -0
  84. package/tests/benchmark/base/switch.js +11 -0
  85. package/tests/benchmark/base/switch.js.json +741 -0
  86. package/tests/benchmark/base/taint.ts +61 -0
  87. package/tests/benchmark/base/temp.js +311 -0
  88. package/tests/benchmark/base/temp.js.json +22170 -0
  89. package/tests/benchmark/base/tmp.js +134 -0
  90. package/tests/benchmark/base/tmp.js.json +15409 -0
  91. package/tests/benchmark/base/vardecl.js +9 -0
  92. package/tests/benchmark/base/vardecl.js.json +491 -0
  93. package/tests/index.js +43 -0
  94. package/tests/index.ts +66 -0
  95. package/tests/test.d.ts +0 -0
  96. package/tests/test.js +38 -0
  97. package/tests/test.ts +60 -0
  98. package/tsconfig.json +24 -0
  99. package/tsconfig.test.json +13 -0
  100. package/webpack.config.js +21 -0
@@ -0,0 +1,3 @@
1
+ import {foo} from './m1.mjs';
2
+
3
+ import monitor from '/alipayLogger_v1.1.1.js/alipayLogger'
@@ -0,0 +1,416 @@
1
+ {
2
+ "type": "CompileUnit",
3
+ "body": [
4
+ {
5
+ "type": "Sequence",
6
+ "expressions": [
7
+ {
8
+ "type": "VariableDeclaration",
9
+ "id": {
10
+ "type": "Identifier",
11
+ "name": "__tmp0__",
12
+ "_meta": {},
13
+ "loc": {
14
+ "start": {
15
+ "line": 1,
16
+ "column": 1
17
+ },
18
+ "end": {
19
+ "line": 1,
20
+ "column": 30
21
+ },
22
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
23
+ }
24
+ },
25
+ "init": {
26
+ "type": "ImportExpression",
27
+ "from": {
28
+ "type": "Literal",
29
+ "value": "./m1.mjs",
30
+ "literalType": "string",
31
+ "_meta": {
32
+ "_extra": {
33
+ "start": 18,
34
+ "end": 28
35
+ }
36
+ },
37
+ "loc": {
38
+ "start": {
39
+ "line": 1,
40
+ "column": 19
41
+ },
42
+ "end": {
43
+ "line": 1,
44
+ "column": 29
45
+ },
46
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
47
+ }
48
+ },
49
+ "local": null,
50
+ "imported": null,
51
+ "_meta": {},
52
+ "loc": {
53
+ "start": {
54
+ "line": 1,
55
+ "column": 1
56
+ },
57
+ "end": {
58
+ "line": 1,
59
+ "column": 30
60
+ },
61
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
62
+ }
63
+ },
64
+ "cloned": false,
65
+ "varType": {
66
+ "type": "DynamicType",
67
+ "id": null,
68
+ "_meta": {}
69
+ },
70
+ "_meta": {},
71
+ "loc": {
72
+ "start": {
73
+ "line": 1,
74
+ "column": 1
75
+ },
76
+ "end": {
77
+ "line": 1,
78
+ "column": 30
79
+ },
80
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
81
+ }
82
+ },
83
+ {
84
+ "type": "VariableDeclaration",
85
+ "id": {
86
+ "type": "Identifier",
87
+ "name": "foo",
88
+ "_meta": {
89
+ "_extra": {
90
+ "start": 8,
91
+ "end": 11
92
+ }
93
+ },
94
+ "loc": {
95
+ "start": {
96
+ "line": 1,
97
+ "column": 9
98
+ },
99
+ "end": {
100
+ "line": 1,
101
+ "column": 12
102
+ },
103
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
104
+ }
105
+ },
106
+ "init": {
107
+ "type": "MemberAccess",
108
+ "object": {
109
+ "type": "Identifier",
110
+ "name": "__tmp0__",
111
+ "_meta": {},
112
+ "loc": {
113
+ "start": {
114
+ "line": 1,
115
+ "column": 1
116
+ },
117
+ "end": {
118
+ "line": 1,
119
+ "column": 30
120
+ },
121
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
122
+ }
123
+ },
124
+ "property": {
125
+ "type": "Identifier",
126
+ "name": "foo",
127
+ "_meta": {
128
+ "_extra": {
129
+ "start": 8,
130
+ "end": 11
131
+ }
132
+ },
133
+ "loc": {
134
+ "start": {
135
+ "line": 1,
136
+ "column": 9
137
+ },
138
+ "end": {
139
+ "line": 1,
140
+ "column": 12
141
+ },
142
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
143
+ }
144
+ },
145
+ "computed": false,
146
+ "_meta": {},
147
+ "loc": {
148
+ "start": {
149
+ "line": 1,
150
+ "column": 9
151
+ },
152
+ "end": {
153
+ "line": 1,
154
+ "column": 12
155
+ },
156
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
157
+ }
158
+ },
159
+ "cloned": false,
160
+ "varType": {
161
+ "type": "DynamicType",
162
+ "id": null,
163
+ "_meta": {}
164
+ },
165
+ "_meta": {
166
+ "_extra": {
167
+ "start": 8,
168
+ "end": 11
169
+ }
170
+ },
171
+ "loc": {
172
+ "start": {
173
+ "line": 1,
174
+ "column": 9
175
+ },
176
+ "end": {
177
+ "line": 1,
178
+ "column": 12
179
+ },
180
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
181
+ }
182
+ }
183
+ ],
184
+ "_meta": {
185
+ "_extra": {
186
+ "end": 29
187
+ }
188
+ },
189
+ "loc": {
190
+ "start": {
191
+ "line": 1,
192
+ "column": 1
193
+ },
194
+ "end": {
195
+ "line": 1,
196
+ "column": 30
197
+ },
198
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
199
+ }
200
+ },
201
+ {
202
+ "type": "Sequence",
203
+ "expressions": [
204
+ {
205
+ "type": "VariableDeclaration",
206
+ "id": {
207
+ "type": "Identifier",
208
+ "name": "__tmp1__",
209
+ "_meta": {},
210
+ "loc": {
211
+ "start": {
212
+ "line": 3,
213
+ "column": 1
214
+ },
215
+ "end": {
216
+ "line": 3,
217
+ "column": 59
218
+ },
219
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
220
+ }
221
+ },
222
+ "init": {
223
+ "type": "ImportExpression",
224
+ "from": {
225
+ "type": "Literal",
226
+ "value": "/alipayLogger_v1.1.1.js/alipayLogger",
227
+ "literalType": "string",
228
+ "_meta": {
229
+ "_extra": {
230
+ "start": 51,
231
+ "end": 89
232
+ }
233
+ },
234
+ "loc": {
235
+ "start": {
236
+ "line": 3,
237
+ "column": 21
238
+ },
239
+ "end": {
240
+ "line": 3,
241
+ "column": 59
242
+ },
243
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
244
+ }
245
+ },
246
+ "local": null,
247
+ "imported": null,
248
+ "_meta": {},
249
+ "loc": {
250
+ "start": {
251
+ "line": 3,
252
+ "column": 1
253
+ },
254
+ "end": {
255
+ "line": 3,
256
+ "column": 59
257
+ },
258
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
259
+ }
260
+ },
261
+ "cloned": false,
262
+ "varType": {
263
+ "type": "DynamicType",
264
+ "id": null,
265
+ "_meta": {}
266
+ },
267
+ "_meta": {},
268
+ "loc": {
269
+ "start": {
270
+ "line": 3,
271
+ "column": 1
272
+ },
273
+ "end": {
274
+ "line": 3,
275
+ "column": 59
276
+ },
277
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
278
+ }
279
+ },
280
+ {
281
+ "type": "VariableDeclaration",
282
+ "id": {
283
+ "type": "Identifier",
284
+ "name": "monitor",
285
+ "_meta": {
286
+ "_extra": {
287
+ "start": 38,
288
+ "end": 45
289
+ }
290
+ },
291
+ "loc": {
292
+ "start": {
293
+ "line": 3,
294
+ "column": 8
295
+ },
296
+ "end": {
297
+ "line": 3,
298
+ "column": 15
299
+ },
300
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
301
+ }
302
+ },
303
+ "init": {
304
+ "type": "MemberAccess",
305
+ "object": {
306
+ "type": "Identifier",
307
+ "name": "__tmp1__",
308
+ "_meta": {},
309
+ "loc": {
310
+ "start": {
311
+ "line": 3,
312
+ "column": 1
313
+ },
314
+ "end": {
315
+ "line": 3,
316
+ "column": 59
317
+ },
318
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
319
+ }
320
+ },
321
+ "property": {
322
+ "type": "Identifier",
323
+ "name": "default",
324
+ "_meta": {},
325
+ "loc": {
326
+ "start": {
327
+ "line": 3,
328
+ "column": 8
329
+ },
330
+ "end": {
331
+ "line": 3,
332
+ "column": 15
333
+ },
334
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
335
+ }
336
+ },
337
+ "computed": false,
338
+ "_meta": {},
339
+ "loc": {
340
+ "start": {
341
+ "line": 3,
342
+ "column": 8
343
+ },
344
+ "end": {
345
+ "line": 3,
346
+ "column": 15
347
+ },
348
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
349
+ }
350
+ },
351
+ "cloned": false,
352
+ "varType": {
353
+ "type": "DynamicType",
354
+ "id": null,
355
+ "_meta": {}
356
+ },
357
+ "_meta": {
358
+ "_extra": {
359
+ "start": 38,
360
+ "end": 45
361
+ }
362
+ },
363
+ "loc": {
364
+ "start": {
365
+ "line": 3,
366
+ "column": 8
367
+ },
368
+ "end": {
369
+ "line": 3,
370
+ "column": 15
371
+ },
372
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
373
+ }
374
+ }
375
+ ],
376
+ "_meta": {
377
+ "_extra": {
378
+ "start": 31,
379
+ "end": 89
380
+ }
381
+ },
382
+ "loc": {
383
+ "start": {
384
+ "line": 3,
385
+ "column": 1
386
+ },
387
+ "end": {
388
+ "line": 3,
389
+ "column": 59
390
+ },
391
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
392
+ }
393
+ }
394
+ ],
395
+ "language": "javascript",
396
+ "languageVersion": null,
397
+ "uri": "",
398
+ "version": "0.1.63",
399
+ "_meta": {
400
+ "_extra": {
401
+ "end": 90,
402
+ "directives": []
403
+ }
404
+ },
405
+ "loc": {
406
+ "start": {
407
+ "line": 1,
408
+ "column": 1
409
+ },
410
+ "end": {
411
+ "line": 4,
412
+ "column": 1
413
+ },
414
+ "sourcefile": "/Users/jiufo/yasaaaaa/uastparser_js/tests/benchmark/base/import.js"
415
+ }
416
+ }
@@ -0,0 +1,27 @@
1
+ 3;
2
+
3
+ 'hello';
4
+
5
+ 0x123123;
6
+
7
+ /ab+c/;
8
+
9
+ `Roses are red,
10
+ Violets are blue.
11
+ Sugar is sweet,
12
+ and so is foo.`
13
+
14
+ true;false;
15
+
16
+ null;
17
+
18
+ undefined;
19
+
20
+ `Fifteen is ${1+1} and
21
+ not ${2 * 100 * 100 * 100 * 100 * 100 * 100 * 100 * 100 + 1 }.`;
22
+
23
+ `${1}.`;
24
+
25
+ `x${1}`;
26
+
27
+