Debian Codegraph @

packages/babel-parser/test/fixtures/tokens/template-string-babel-7/basic/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":4,"index":33}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":4,"index":33}},
7 "sourceType": "script",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "ExpressionStatement",
12 "start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}},
13 "expression": {
14 "type": "TemplateLiteral",
15 "start":0,"end":27,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":27,"index":27}},
16 "expressions": [
17 {
18 "type": "Identifier",
19 "start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10},"identifierName":"x"},
20 "name": "x"
21 },
22 {
23 "type": "Identifier",
24 "start":19,"end":20,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":20,"index":20},"identifierName":"y"},
25 "name": "y"
26 }
27 ],
28 "quasis": [
29 {
30 "type": "TemplateElement",
31 "start":1,"end":7,"loc":{"start":{"line":1,"column":1,"index":1},"end":{"line":1,"column":7,"index":7}},
32 "value": {
33 "raw": "before",
34 "cooked": "before"
35 },
36 "tail": false
37 },
38 {
39 "type": "TemplateElement",
40 "start":11,"end":17,"loc":{"start":{"line":1,"column":11,"index":11},"end":{"line":1,"column":17,"index":17}},
41 "value": {
42 "raw": "middle",
43 "cooked": "middle"
44 },
45 "tail": false
46 },
47 {
48 "type": "TemplateElement",
49 "start":21,"end":26,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":26,"index":26}},
50 "value": {
51 "raw": "after",
52 "cooked": "after"
53 },
54 "tail": true
55 }
56 ]
57 }
58 },
59 {
60 "type": "ExpressionStatement",
61 "start":29,"end":33,"loc":{"start":{"line":2,"column":0,"index":29},"end":{"line":2,"column":4,"index":33}},
62 "expression": {
63 "type": "TemplateLiteral",
64 "start":29,"end":32,"loc":{"start":{"line":2,"column":0,"index":29},"end":{"line":2,"column":3,"index":32}},
65 "expressions": [],
66 "quasis": [
67 {
68 "type": "TemplateElement",
69 "start":30,"end":31,"loc":{"start":{"line":2,"column":1,"index":30},"end":{"line":2,"column":2,"index":31}},
70 "value": {
71 "raw": "x",
72 "cooked": "x"
73 },
74 "tail": true
75 }
76 ]
77 }
78 }
79 ],
80 "directives": []
81 },
82 "tokens": [
83 {
84 "type": {
85 "label": "`",
86 "beforeExpr": false,
87 "startsExpr": true,
88 "rightAssociative": false,
89 "isLoop": false,
90 "isAssign": false,
91 "prefix": false,
92 "postfix": false,
93 "binop": null
94 },
95 "value": "`",
96 "start":0,"end":1,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":1,"index":1}}
97 },
98 {
99 "type": {
100 "label": "template",
101 "beforeExpr": false,
102 "startsExpr": false,
103 "rightAssociative": false,
104 "isLoop": false,
105 "isAssign": false,
106 "prefix": false,
107 "postfix": false,
108 "binop": null,
109 "updateContext": null
110 },
111 "value": "before",
112 "start":1,"end":7,"loc":{"start":{"line":1,"column":1,"index":1},"end":{"line":1,"column":7,"index":7}}
113 },
114 {
115 "type": {
116 "label": "${",
117 "beforeExpr": true,
118 "startsExpr": true,
119 "rightAssociative": false,
120 "isLoop": false,
121 "isAssign": false,
122 "prefix": false,
123 "postfix": false,
124 "binop": null
125 },
126 "value": "${",
127 "start":7,"end":9,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":9,"index":9}}
128 },
129 {
130 "type": {
131 "label": "name",
132 "beforeExpr": false,
133 "startsExpr": true,
134 "rightAssociative": false,
135 "isLoop": false,
136 "isAssign": false,
137 "prefix": false,
138 "postfix": false,
139 "binop": null,
140 "updateContext": null
141 },
142 "value": "x",
143 "start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10}}
144 },
145 {
146 "type": {
147 "label": "}",
148 "beforeExpr": false,
149 "startsExpr": false,
150 "rightAssociative": false,
151 "isLoop": false,
152 "isAssign": false,
153 "prefix": false,
154 "postfix": false,
155 "binop": null
156 },
157 "value": "}",
158 "start":10,"end":11,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":11,"index":11}}
159 },
160 {
161 "type": {
162 "label": "template",
163 "beforeExpr": false,
164 "startsExpr": false,
165 "rightAssociative": false,
166 "isLoop": false,
167 "isAssign": false,
168 "prefix": false,
169 "postfix": false,
170 "binop": null,
171 "updateContext": null
172 },
173 "value": "middle",
174 "start":11,"end":17,"loc":{"start":{"line":1,"column":11,"index":11},"end":{"line":1,"column":17,"index":17}}
175 },
176 {
177 "type": {
178 "label": "${",
179 "beforeExpr": true,
180 "startsExpr": true,
181 "rightAssociative": false,
182 "isLoop": false,
183 "isAssign": false,
184 "prefix": false,
185 "postfix": false,
186 "binop": null
187 },
188 "value": "${",
189 "start":17,"end":19,"loc":{"start":{"line":1,"column":17,"index":17},"end":{"line":1,"column":19,"index":19}}
190 },
191 {
192 "type": {
193 "label": "name",
194 "beforeExpr": false,
195 "startsExpr": true,
196 "rightAssociative": false,
197 "isLoop": false,
198 "isAssign": false,
199 "prefix": false,
200 "postfix": false,
201 "binop": null,
202 "updateContext": null
203 },
204 "value": "y",
205 "start":19,"end":20,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":20,"index":20}}
206 },
207 {
208 "type": {
209 "label": "}",
210 "beforeExpr": false,
211 "startsExpr": false,
212 "rightAssociative": false,
213 "isLoop": false,
214 "isAssign": false,
215 "prefix": false,
216 "postfix": false,
217 "binop": null
218 },
219 "value": "}",
220 "start":20,"end":21,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":21,"index":21}}
221 },
222 {
223 "type": {
224 "label": "template",
225 "beforeExpr": false,
226 "startsExpr": false,
227 "rightAssociative": false,
228 "isLoop": false,
229 "isAssign": false,
230 "prefix": false,
231 "postfix": false,
232 "binop": null,
233 "updateContext": null
234 },
235 "value": "after",
236 "start":21,"end":26,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":26,"index":26}}
237 },
238 {
239 "type": {
240 "label": "`",
241 "beforeExpr": false,
242 "startsExpr": true,
243 "rightAssociative": false,
244 "isLoop": false,
245 "isAssign": false,
246 "prefix": false,
247 "postfix": false,
248 "binop": null
249 },
250 "value": "`",
251 "start":26,"end":27,"loc":{"start":{"line":1,"column":26,"index":26},"end":{"line":1,"column":27,"index":27}}
252 },
253 {
254 "type": {
255 "label": ";",
256 "beforeExpr": true,
257 "startsExpr": false,
258 "rightAssociative": false,
259 "isLoop": false,
260 "isAssign": false,
261 "prefix": false,
262 "postfix": false,
263 "binop": null,
264 "updateContext": null
265 },
266 "start":27,"end":28,"loc":{"start":{"line":1,"column":27,"index":27},"end":{"line":1,"column":28,"index":28}}
267 },
268 {
269 "type": {
270 "label": "`",
271 "beforeExpr": false,
272 "startsExpr": true,
273 "rightAssociative": false,
274 "isLoop": false,
275 "isAssign": false,
276 "prefix": false,
277 "postfix": false,
278 "binop": null
279 },
280 "value": "`",
281 "start":29,"end":30,"loc":{"start":{"line":2,"column":0,"index":29},"end":{"line":2,"column":1,"index":30}}
282 },
283 {
284 "type": {
285 "label": "template",
286 "beforeExpr": false,
287 "startsExpr": false,
288 "rightAssociative": false,
289 "isLoop": false,
290 "isAssign": false,
291 "prefix": false,
292 "postfix": false,
293 "binop": null,
294 "updateContext": null
295 },
296 "value": "x",
297 "start":30,"end":31,"loc":{"start":{"line":2,"column":1,"index":30},"end":{"line":2,"column":2,"index":31}}
298 },
299 {
300 "type": {
301 "label": "`",
302 "beforeExpr": false,
303 "startsExpr": true,
304 "rightAssociative": false,
305 "isLoop": false,
306 "isAssign": false,
307 "prefix": false,
308 "postfix": false,
309 "binop": null
310 },
311 "value": "`",
312 "start":31,"end":32,"loc":{"start":{"line":2,"column":2,"index":31},"end":{"line":2,"column":3,"index":32}}
313 },
314 {
315 "type": {
316 "label": ";",
317 "beforeExpr": true,
318 "startsExpr": false,
319 "rightAssociative": false,
320 "isLoop": false,
321 "isAssign": false,
322 "prefix": false,
323 "postfix": false,
324 "binop": null,
325 "updateContext": null
326 },
327 "start":32,"end":33,"loc":{"start":{"line":2,"column":3,"index":32},"end":{"line":2,"column":4,"index":33}}
328 },
329 {
330 "type": {
331 "label": "eof",
332 "beforeExpr": false,
333 "startsExpr": false,
334 "rightAssociative": false,
335 "isLoop": false,
336 "isAssign": false,
337 "prefix": false,
338 "postfix": false,
339 "binop": null,
340 "updateContext": null
341 },
342 "start":33,"end":33,"loc":{"start":{"line":2,"column":4,"index":33},"end":{"line":2,"column":4,"index":33}}
343 }
344 ]
345 }