Debian Codegraph @

packages/babel-parser/test/fixtures/comments/basic/comment-within-condition/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":30,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":20,"index":30}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":30,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":20,"index":30}},
7 "sourceType": "script",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "IfStatement",
12 "start":10,"end":30,"loc":{"start":{"line":2,"column":0,"index":10},"end":{"line":2,"column":20,"index":30}},
13 "test": {
14 "type": "Identifier",
15 "start":25,"end":26,"loc":{"start":{"line":2,"column":15,"index":25},"end":{"line":2,"column":16,"index":26},"identifierName":"a"},
16 "name": "a",
17 "leadingComments": [
18 {
19 "type": "CommentBlock",
20 "value": " bar ",
21 "start":14,"end":23,"loc":{"start":{"line":2,"column":4,"index":14},"end":{"line":2,"column":13,"index":23}}
22 }
23 ]
24 },
25 "consequent": {
26 "type": "BlockStatement",
27 "start":28,"end":30,"loc":{"start":{"line":2,"column":18,"index":28},"end":{"line":2,"column":20,"index":30}},
28 "body": [],
29 "directives": []
30 },
31 "alternate": null,
32 "leadingComments": [
33 {
34 "type": "CommentBlock",
35 "value": " foo ",
36 "start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}
37 }
38 ]
39 }
40 ],
41 "directives": []
42 },
43 "comments": [
44 {
45 "type": "CommentBlock",
46 "value": " foo ",
47 "start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}
48 },
49 {
50 "type": "CommentBlock",
51 "value": " bar ",
52 "start":14,"end":23,"loc":{"start":{"line":2,"column":4,"index":14},"end":{"line":2,"column":13,"index":23}}
53 }
54 ]
55 }