Debian Codegraph @

packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":69,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":18,"index":69}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":69,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":18,"index":69}},
7 "sourceType": "script",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "VariableDeclaration",
12 "start":0,"end":69,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":18,"index":69}},
13 "declarations": [
14 {
15 "type": "VariableDeclarator",
16 "start":6,"end":68,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":6,"column":17,"index":68}},
17 "id": {
18 "type": "ObjectPattern",
19 "start":6,"end":52,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":6,"column":1,"index":52}},
20 "properties": [
21 {
22 "type": "ObjectProperty",
23 "start":22,"end":23,"loc":{"start":{"line":3,"column":2,"index":22},"end":{"line":3,"column":3,"index":23}},
24 "key": {
25 "type": "Identifier",
26 "start":22,"end":23,"loc":{"start":{"line":3,"column":2,"index":22},"end":{"line":3,"column":3,"index":23},"identifierName":"x"},
27 "name": "x"
28 },
29 "computed": false,
30 "method": false,
31 "shorthand": true,
32 "value": {
33 "type": "Identifier",
34 "start":22,"end":23,"loc":{"start":{"line":3,"column":2,"index":22},"end":{"line":3,"column":3,"index":23},"identifierName":"x"},
35 "name": "x"
36 },
37 "extra": {
38 "shorthand": true
39 },
40 "trailingComments": [
41 {
42 "type": "CommentBlock",
43 "value": " Two ",
44 "start":26,"end":35,"loc":{"start":{"line":4,"column":2,"index":26},"end":{"line":4,"column":11,"index":35}}
45 },
46 {
47 "type": "CommentBlock",
48 "value": " Three ",
49 "start":39,"end":50,"loc":{"start":{"line":5,"column":2,"index":39},"end":{"line":5,"column":13,"index":50}}
50 }
51 ],
52 "leadingComments": [
53 {
54 "type": "CommentBlock",
55 "value": " One ",
56 "start":10,"end":19,"loc":{"start":{"line":2,"column":2,"index":10},"end":{"line":2,"column":11,"index":19}}
57 }
58 ]
59 }
60 ],
61 "extra": {
62 "trailingComma": 35
63 },
64 "trailingComments": [
65 {
66 "type": "CommentBlock",
67 "value": " Four ",
68 "start":53,"end":63,"loc":{"start":{"line":6,"column":2,"index":53},"end":{"line":6,"column":12,"index":63}}
69 }
70 ]
71 },
72 "init": {
73 "type": "ObjectExpression",
74 "start":66,"end":68,"loc":{"start":{"line":6,"column":15,"index":66},"end":{"line":6,"column":17,"index":68}},
75 "properties": []
76 }
77 }
78 ],
79 "kind": "const"
80 }
81 ],
82 "directives": []
83 },
84 "comments": [
85 {
86 "type": "CommentBlock",
87 "value": " One ",
88 "start":10,"end":19,"loc":{"start":{"line":2,"column":2,"index":10},"end":{"line":2,"column":11,"index":19}}
89 },
90 {
91 "type": "CommentBlock",
92 "value": " Two ",
93 "start":26,"end":35,"loc":{"start":{"line":4,"column":2,"index":26},"end":{"line":4,"column":11,"index":35}}
94 },
95 {
96 "type": "CommentBlock",
97 "value": " Three ",
98 "start":39,"end":50,"loc":{"start":{"line":5,"column":2,"index":39},"end":{"line":5,"column":13,"index":50}}
99 },
100 {
101 "type": "CommentBlock",
102 "value": " Four ",
103 "start":53,"end":63,"loc":{"start":{"line":6,"column":2,"index":53},"end":{"line":6,"column":12,"index":63}}
104 }
105 ]
106 }