Debian Codegraph @

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

raw
1 {
2 "type": "File",
3 "start":0,"end":229,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":18,"column":10,"index":229}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":229,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":18,"column":10,"index":229}},
7 "sourceType": "script",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "VariableDeclaration",
12 "start":0,"end":76,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":1,"index":76}},
13 "declarations": [
14 {
15 "type": "VariableDeclarator",
16 "start":6,"end":76,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":6,"column":1,"index":76}},
17 "id": {
18 "type": "Identifier",
19 "start":6,"end":17,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":17,"index":17},"identifierName":"nonTrailing"},
20 "name": "nonTrailing"
21 },
22 "init": {
23 "type": "ArrayExpression",
24 "start":20,"end":76,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":6,"column":1,"index":76}},
25 "elements": [
26 {
27 "type": "StringLiteral",
28 "start":24,"end":29,"loc":{"start":{"line":2,"column":2,"index":24},"end":{"line":2,"column":7,"index":29}},
29 "extra": {
30 "rawValue": "One",
31 "raw": "\"One\""
32 },
33 "value": "One"
34 },
35 {
36 "type": "StringLiteral",
37 "start":50,"end":55,"loc":{"start":{"line":4,"column":2,"index":50},"end":{"line":4,"column":7,"index":55}},
38 "extra": {
39 "rawValue": "Two",
40 "raw": "\"Two\""
41 },
42 "value": "Two",
43 "trailingComments": [
44 {
45 "type": "CommentLine",
46 "value": " Three",
47 "start":56,"end":64,"loc":{"start":{"line":4,"column":8,"index":56},"end":{"line":4,"column":16,"index":64}}
48 },
49 {
50 "type": "CommentLine",
51 "value": " Four",
52 "start":67,"end":74,"loc":{"start":{"line":5,"column":2,"index":67},"end":{"line":5,"column":9,"index":74}}
53 }
54 ],
55 "leadingComments": [
56 {
57 "type": "CommentLine",
58 "value": " One",
59 "start":31,"end":37,"loc":{"start":{"line":2,"column":9,"index":31},"end":{"line":2,"column":15,"index":37}}
60 },
61 {
62 "type": "CommentLine",
63 "value": " Two",
64 "start":41,"end":47,"loc":{"start":{"line":3,"column":3,"index":41},"end":{"line":3,"column":9,"index":47}}
65 }
66 ]
67 }
68 ]
69 }
70 }
71 ],
72 "kind": "const"
73 },
74 {
75 "type": "VariableDeclaration",
76 "start":78,"end":162,"loc":{"start":{"line":8,"column":0,"index":78},"end":{"line":13,"column":1,"index":162}},
77 "declarations": [
78 {
79 "type": "VariableDeclarator",
80 "start":84,"end":162,"loc":{"start":{"line":8,"column":6,"index":84},"end":{"line":13,"column":1,"index":162}},
81 "id": {
82 "type": "Identifier",
83 "start":84,"end":102,"loc":{"start":{"line":8,"column":6,"index":84},"end":{"line":8,"column":24,"index":102},"identifierName":"trailingAfterComma"},
84 "name": "trailingAfterComma"
85 },
86 "init": {
87 "type": "ArrayExpression",
88 "start":105,"end":162,"loc":{"start":{"line":8,"column":27,"index":105},"end":{"line":13,"column":1,"index":162}},
89 "extra": {
90 "trailingComma": 140
91 },
92 "elements": [
93 {
94 "type": "StringLiteral",
95 "start":109,"end":114,"loc":{"start":{"line":9,"column":2,"index":109},"end":{"line":9,"column":7,"index":114}},
96 "extra": {
97 "rawValue": "One",
98 "raw": "\"One\""
99 },
100 "value": "One"
101 },
102 {
103 "type": "StringLiteral",
104 "start":135,"end":140,"loc":{"start":{"line":11,"column":2,"index":135},"end":{"line":11,"column":7,"index":140}},
105 "extra": {
106 "rawValue": "Two",
107 "raw": "\"Two\""
108 },
109 "value": "Two",
110 "trailingComments": [
111 {
112 "type": "CommentLine",
113 "value": " Three",
114 "start":142,"end":150,"loc":{"start":{"line":11,"column":9,"index":142},"end":{"line":11,"column":17,"index":150}}
115 },
116 {
117 "type": "CommentLine",
118 "value": " Four",
119 "start":153,"end":160,"loc":{"start":{"line":12,"column":2,"index":153},"end":{"line":12,"column":9,"index":160}}
120 }
121 ],
122 "leadingComments": [
123 {
124 "type": "CommentLine",
125 "value": " One",
126 "start":116,"end":122,"loc":{"start":{"line":9,"column":9,"index":116},"end":{"line":9,"column":15,"index":122}}
127 },
128 {
129 "type": "CommentLine",
130 "value": " Two",
131 "start":126,"end":132,"loc":{"start":{"line":10,"column":3,"index":126},"end":{"line":10,"column":9,"index":132}}
132 }
133 ]
134 }
135 ]
136 }
137 }
138 ],
139 "kind": "const"
140 },
141 {
142 "type": "VariableDeclaration",
143 "start":164,"end":220,"loc":{"start":{"line":15,"column":0,"index":164},"end":{"line":18,"column":1,"index":220}},
144 "declarations": [
145 {
146 "type": "VariableDeclarator",
147 "start":170,"end":220,"loc":{"start":{"line":15,"column":6,"index":170},"end":{"line":18,"column":1,"index":220}},
148 "id": {
149 "type": "Identifier",
150 "start":170,"end":188,"loc":{"start":{"line":15,"column":6,"index":170},"end":{"line":15,"column":24,"index":188},"identifierName":"trailingAfterArray"},
151 "name": "trailingAfterArray"
152 },
153 "init": {
154 "type": "ArrayExpression",
155 "start":191,"end":220,"loc":{"start":{"line":15,"column":27,"index":191},"end":{"line":18,"column":1,"index":220}},
156 "extra": {
157 "trailingComma": 200
158 },
159 "elements": [
160 {
161 "type": "StringLiteral",
162 "start":195,"end":200,"loc":{"start":{"line":16,"column":2,"index":195},"end":{"line":16,"column":7,"index":200}},
163 "extra": {
164 "rawValue": "One",
165 "raw": "\"One\""
166 },
167 "value": "One",
168 "trailingComments": [
169 {
170 "type": "CommentLine",
171 "value": " One",
172 "start":202,"end":208,"loc":{"start":{"line":16,"column":9,"index":202},"end":{"line":16,"column":15,"index":208}}
173 },
174 {
175 "type": "CommentLine",
176 "value": " Two",
177 "start":212,"end":218,"loc":{"start":{"line":17,"column":3,"index":212},"end":{"line":17,"column":9,"index":218}}
178 }
179 ]
180 }
181 ]
182 }
183 }
184 ],
185 "kind": "const",
186 "trailingComments": [
187 {
188 "type": "CommentLine",
189 "value": " Three",
190 "start":221,"end":229,"loc":{"start":{"line":18,"column":2,"index":221},"end":{"line":18,"column":10,"index":229}}
191 }
192 ]
193 }
194 ],
195 "directives": []
196 },
197 "comments": [
198 {
199 "type": "CommentLine",
200 "value": " One",
201 "start":31,"end":37,"loc":{"start":{"line":2,"column":9,"index":31},"end":{"line":2,"column":15,"index":37}}
202 },
203 {
204 "type": "CommentLine",
205 "value": " Two",
206 "start":41,"end":47,"loc":{"start":{"line":3,"column":3,"index":41},"end":{"line":3,"column":9,"index":47}}
207 },
208 {
209 "type": "CommentLine",
210 "value": " Three",
211 "start":56,"end":64,"loc":{"start":{"line":4,"column":8,"index":56},"end":{"line":4,"column":16,"index":64}}
212 },
213 {
214 "type": "CommentLine",
215 "value": " Four",
216 "start":67,"end":74,"loc":{"start":{"line":5,"column":2,"index":67},"end":{"line":5,"column":9,"index":74}}
217 },
218 {
219 "type": "CommentLine",
220 "value": " One",
221 "start":116,"end":122,"loc":{"start":{"line":9,"column":9,"index":116},"end":{"line":9,"column":15,"index":122}}
222 },
223 {
224 "type": "CommentLine",
225 "value": " Two",
226 "start":126,"end":132,"loc":{"start":{"line":10,"column":3,"index":126},"end":{"line":10,"column":9,"index":132}}
227 },
228 {
229 "type": "CommentLine",
230 "value": " Three",
231 "start":142,"end":150,"loc":{"start":{"line":11,"column":9,"index":142},"end":{"line":11,"column":17,"index":150}}
232 },
233 {
234 "type": "CommentLine",
235 "value": " Four",
236 "start":153,"end":160,"loc":{"start":{"line":12,"column":2,"index":153},"end":{"line":12,"column":9,"index":160}}
237 },
238 {
239 "type": "CommentLine",
240 "value": " One",
241 "start":202,"end":208,"loc":{"start":{"line":16,"column":9,"index":202},"end":{"line":16,"column":15,"index":208}}
242 },
243 {
244 "type": "CommentLine",
245 "value": " Two",
246 "start":212,"end":218,"loc":{"start":{"line":17,"column":3,"index":212},"end":{"line":17,"column":9,"index":218}}
247 },
248 {
249 "type": "CommentLine",
250 "value": " Three",
251 "start":221,"end":229,"loc":{"start":{"line":18,"column":2,"index":221},"end":{"line":18,"column":10,"index":229}}
252 }
253 ]
254 }