Debian Codegraph @

packages/babel-parser/test/fixtures/tokens/template-string/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": true,
87 "startsExpr": true,
88 "rightAssociative": false,
89 "isLoop": false,
90 "isAssign": false,
91 "prefix": false,
92 "postfix": false,
93 "binop": null
94 },
95 "value": "`before${",
96 "start":0,"end":9,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":9,"index":9}}
97 },
98 {
99 "type": {
100 "label": "name",
101 "beforeExpr": false,
102 "startsExpr": true,
103 "rightAssociative": false,
104 "isLoop": false,
105 "isAssign": false,
106 "prefix": false,
107 "postfix": false,
108 "binop": null
109 },
110 "value": "x",
111 "start":9,"end":10,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":10,"index":10}}
112 },
113 {
114 "type": {
115 "label": "...${",
116 "beforeExpr": true,
117 "startsExpr": true,
118 "rightAssociative": false,
119 "isLoop": false,
120 "isAssign": false,
121 "prefix": false,
122 "postfix": false,
123 "binop": null
124 },
125 "value": "}middle${",
126 "start":10,"end":19,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":1,"column":19,"index":19}}
127 },
128 {
129 "type": {
130 "label": "name",
131 "beforeExpr": false,
132 "startsExpr": true,
133 "rightAssociative": false,
134 "isLoop": false,
135 "isAssign": false,
136 "prefix": false,
137 "postfix": false,
138 "binop": null
139 },
140 "value": "y",
141 "start":19,"end":20,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":20,"index":20}}
142 },
143 {
144 "type": {
145 "label": "...`",
146 "beforeExpr": false,
147 "startsExpr": true,
148 "rightAssociative": false,
149 "isLoop": false,
150 "isAssign": false,
151 "prefix": false,
152 "postfix": false,
153 "binop": null
154 },
155 "value": "}after`",
156 "start":20,"end":27,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":27,"index":27}}
157 },
158 {
159 "type": {
160 "label": ";",
161 "beforeExpr": true,
162 "startsExpr": false,
163 "rightAssociative": false,
164 "isLoop": false,
165 "isAssign": false,
166 "prefix": false,
167 "postfix": false,
168 "binop": null
169 },
170 "start":27,"end":28,"loc":{"start":{"line":1,"column":27,"index":27},"end":{"line":1,"column":28,"index":28}}
171 },
172 {
173 "type": {
174 "label": "...`",
175 "beforeExpr": false,
176 "startsExpr": true,
177 "rightAssociative": false,
178 "isLoop": false,
179 "isAssign": false,
180 "prefix": false,
181 "postfix": false,
182 "binop": null
183 },
184 "value": "`x`",
185 "start":29,"end":32,"loc":{"start":{"line":2,"column":0,"index":29},"end":{"line":2,"column":3,"index":32}}
186 },
187 {
188 "type": {
189 "label": ";",
190 "beforeExpr": true,
191 "startsExpr": false,
192 "rightAssociative": false,
193 "isLoop": false,
194 "isAssign": false,
195 "prefix": false,
196 "postfix": false,
197 "binop": null
198 },
199 "start":32,"end":33,"loc":{"start":{"line":2,"column":3,"index":32},"end":{"line":2,"column":4,"index":33}}
200 },
201 {
202 "type": {
203 "label": "eof",
204 "beforeExpr": false,
205 "startsExpr": false,
206 "rightAssociative": false,
207 "isLoop": false,
208 "isAssign": false,
209 "prefix": false,
210 "postfix": false,
211 "binop": null
212 },
213 "start":33,"end":33,"loc":{"start":{"line":2,"column":4,"index":33},"end":{"line":2,"column":4,"index":33}}
214 }
215 ]
216 }