Debian Codegraph @

packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":296,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":13,"column":2,"index":296}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":296,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":13,"column":2,"index":296}},
7 "sourceType": "script",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "ExpressionStatement",
12 "start":0,"end":296,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":13,"column":2,"index":296}},
13 "expression": {
14 "type": "AssignmentExpression",
15 "start":0,"end":295,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":13,"column":1,"index":295}},
16 "operator": "=",
17 "left": {
18 "type": "MemberExpression",
19 "start":0,"end":14,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":14,"index":14}},
20 "object": {
21 "type": "Identifier",
22 "start":0,"end":6,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":6,"index":6},"identifierName":"module"},
23 "name": "module"
24 },
25 "computed": false,
26 "property": {
27 "type": "Identifier",
28 "start":7,"end":14,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":14,"index":14},"identifierName":"exports"},
29 "name": "exports"
30 }
31 },
32 "right": {
33 "type": "FunctionExpression",
34 "start":17,"end":295,"loc":{"start":{"line":1,"column":17,"index":17},"end":{"line":13,"column":1,"index":295}},
35 "id": null,
36 "generator": false,
37 "async": false,
38 "params": [
39 {
40 "type": "Identifier",
41 "start":26,"end":33,"loc":{"start":{"line":1,"column":26,"index":26},"end":{"line":1,"column":33,"index":33},"identifierName":"context"},
42 "name": "context"
43 }
44 ],
45 "body": {
46 "type": "BlockStatement",
47 "start":35,"end":295,"loc":{"start":{"line":1,"column":35,"index":35},"end":{"line":13,"column":1,"index":295}},
48 "body": [
49 {
50 "type": "FunctionDeclaration",
51 "start":42,"end":292,"loc":{"start":{"line":3,"column":4,"index":42},"end":{"line":11,"column":5,"index":292}},
52 "id": {
53 "type": "Identifier",
54 "start":51,"end":61,"loc":{"start":{"line":3,"column":13,"index":51},"end":{"line":3,"column":23,"index":61},"identifierName":"isConstant"},
55 "name": "isConstant"
56 },
57 "generator": false,
58 "async": false,
59 "params": [
60 {
61 "type": "Identifier",
62 "start":62,"end":66,"loc":{"start":{"line":3,"column":24,"index":62},"end":{"line":3,"column":28,"index":66},"identifierName":"node"},
63 "name": "node"
64 }
65 ],
66 "body": {
67 "type": "BlockStatement",
68 "start":68,"end":292,"loc":{"start":{"line":3,"column":30,"index":68},"end":{"line":11,"column":5,"index":292}},
69 "body": [
70 {
71 "type": "SwitchStatement",
72 "start":78,"end":255,"loc":{"start":{"line":4,"column":8,"index":78},"end":{"line":8,"column":9,"index":255}},
73 "discriminant": {
74 "type": "MemberExpression",
75 "start":86,"end":95,"loc":{"start":{"line":4,"column":16,"index":86},"end":{"line":4,"column":25,"index":95}},
76 "object": {
77 "type": "Identifier",
78 "start":86,"end":90,"loc":{"start":{"line":4,"column":16,"index":86},"end":{"line":4,"column":20,"index":90},"identifierName":"node"},
79 "name": "node"
80 },
81 "computed": false,
82 "property": {
83 "type": "Identifier",
84 "start":91,"end":95,"loc":{"start":{"line":4,"column":21,"index":91},"end":{"line":4,"column":25,"index":95},"identifierName":"type"},
85 "name": "type"
86 }
87 },
88 "cases": [
89 {
90 "type": "SwitchCase",
91 "start":111,"end":219,"loc":{"start":{"line":5,"column":12,"index":111},"end":{"line":6,"column":81,"index":219}},
92 "consequent": [
93 {
94 "type": "ReturnStatement",
95 "start":154,"end":219,"loc":{"start":{"line":6,"column":16,"index":154},"end":{"line":6,"column":81,"index":219}},
96 "argument": {
97 "type": "CallExpression",
98 "start":161,"end":218,"loc":{"start":{"line":6,"column":23,"index":161},"end":{"line":6,"column":80,"index":218}},
99 "callee": {
100 "type": "Identifier",
101 "start":161,"end":171,"loc":{"start":{"line":6,"column":23,"index":161},"end":{"line":6,"column":33,"index":171},"identifierName":"isConstant"},
102 "name": "isConstant"
103 },
104 "arguments": [
105 {
106 "type": "MemberExpression",
107 "start":172,"end":217,"loc":{"start":{"line":6,"column":34,"index":172},"end":{"line":6,"column":79,"index":217}},
108 "object": {
109 "type": "MemberExpression",
110 "start":172,"end":188,"loc":{"start":{"line":6,"column":34,"index":172},"end":{"line":6,"column":50,"index":188}},
111 "object": {
112 "type": "Identifier",
113 "start":172,"end":176,"loc":{"start":{"line":6,"column":34,"index":172},"end":{"line":6,"column":38,"index":176},"identifierName":"node"},
114 "name": "node"
115 },
116 "computed": false,
117 "property": {
118 "type": "Identifier",
119 "start":177,"end":188,"loc":{"start":{"line":6,"column":39,"index":177},"end":{"line":6,"column":50,"index":188},"identifierName":"expressions"},
120 "name": "expressions"
121 }
122 },
123 "computed": true,
124 "property": {
125 "type": "BinaryExpression",
126 "start":189,"end":216,"loc":{"start":{"line":6,"column":51,"index":189},"end":{"line":6,"column":78,"index":216}},
127 "left": {
128 "type": "MemberExpression",
129 "start":189,"end":212,"loc":{"start":{"line":6,"column":51,"index":189},"end":{"line":6,"column":74,"index":212}},
130 "object": {
131 "type": "MemberExpression",
132 "start":189,"end":205,"loc":{"start":{"line":6,"column":51,"index":189},"end":{"line":6,"column":67,"index":205}},
133 "object": {
134 "type": "Identifier",
135 "start":189,"end":193,"loc":{"start":{"line":6,"column":51,"index":189},"end":{"line":6,"column":55,"index":193},"identifierName":"node"},
136 "name": "node"
137 },
138 "computed": false,
139 "property": {
140 "type": "Identifier",
141 "start":194,"end":205,"loc":{"start":{"line":6,"column":56,"index":194},"end":{"line":6,"column":67,"index":205},"identifierName":"expressions"},
142 "name": "expressions"
143 }
144 },
145 "computed": false,
146 "property": {
147 "type": "Identifier",
148 "start":206,"end":212,"loc":{"start":{"line":6,"column":68,"index":206},"end":{"line":6,"column":74,"index":212},"identifierName":"length"},
149 "name": "length"
150 }
151 },
152 "operator": "-",
153 "right": {
154 "type": "NumericLiteral",
155 "start":215,"end":216,"loc":{"start":{"line":6,"column":77,"index":215},"end":{"line":6,"column":78,"index":216}},
156 "extra": {
157 "rawValue": 1,
158 "raw": "1"
159 },
160 "value": 1
161 }
162 }
163 }
164 ]
165 }
166 }
167 ],
168 "test": {
169 "type": "StringLiteral",
170 "start":116,"end":136,"loc":{"start":{"line":5,"column":17,"index":116},"end":{"line":5,"column":37,"index":136}},
171 "extra": {
172 "rawValue": "SequenceExpression",
173 "raw": "\"SequenceExpression\""
174 },
175 "value": "SequenceExpression"
176 },
177 "trailingComments": [
178 {
179 "type": "CommentLine",
180 "value": " no default",
181 "start":232,"end":245,"loc":{"start":{"line":7,"column":12,"index":232},"end":{"line":7,"column":25,"index":245}}
182 }
183 ]
184 }
185 ]
186 },
187 {
188 "type": "ReturnStatement",
189 "start":273,"end":286,"loc":{"start":{"line":10,"column":8,"index":273},"end":{"line":10,"column":21,"index":286}},
190 "argument": {
191 "type": "BooleanLiteral",
192 "start":280,"end":285,"loc":{"start":{"line":10,"column":15,"index":280},"end":{"line":10,"column":20,"index":285}},
193 "value": false
194 }
195 }
196 ],
197 "directives": []
198 }
199 }
200 ],
201 "directives": []
202 }
203 }
204 }
205 }
206 ],
207 "directives": []
208 },
209 "comments": [
210 {
211 "type": "CommentLine",
212 "value": " no default",
213 "start":232,"end":245,"loc":{"start":{"line":7,"column":12,"index":232},"end":{"line":7,"column":25,"index":245}}
214 }
215 ]
216 }