Debian Codegraph @

packages/babel-parser/test/fixtures/flow/regression/issue-2083/output.json

raw
1 {
2 "type": "File",
3 "start":0,"end":164,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":164}},
4 "program": {
5 "type": "Program",
6 "start":0,"end":164,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":164}},
7 "sourceType": "module",
8 "interpreter": null,
9 "body": [
10 {
11 "type": "ClassDeclaration",
12 "start":0,"end":164,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":11,"column":1,"index":164}},
13 "id": {
14 "type": "Identifier",
15 "start":6,"end":9,"loc":{"start":{"line":1,"column":6,"index":6},"end":{"line":1,"column":9,"index":9},"identifierName":"Foo"},
16 "name": "Foo"
17 },
18 "superClass": null,
19 "body": {
20 "type": "ClassBody",
21 "start":10,"end":164,"loc":{"start":{"line":1,"column":10,"index":10},"end":{"line":11,"column":1,"index":164}},
22 "body": [
23 {
24 "type": "ClassMethod",
25 "start":14,"end":110,"loc":{"start":{"line":2,"column":2,"index":14},"end":{"line":6,"column":3,"index":110}},
26 "static": false,
27 "key": {
28 "type": "Identifier",
29 "start":14,"end":17,"loc":{"start":{"line":2,"column":2,"index":14},"end":{"line":2,"column":5,"index":17},"identifierName":"foo"},
30 "name": "foo"
31 },
32 "computed": false,
33 "kind": "method",
34 "id": null,
35 "generator": false,
36 "async": false,
37 "params": [],
38 "body": {
39 "type": "BlockStatement",
40 "start":20,"end":110,"loc":{"start":{"line":2,"column":8,"index":20},"end":{"line":6,"column":3,"index":110}},
41 "body": [
42 {
43 "type": "SwitchStatement",
44 "start":26,"end":106,"loc":{"start":{"line":3,"column":4,"index":26},"end":{"line":5,"column":5,"index":106}},
45 "discriminant": {
46 "type": "NumericLiteral",
47 "start":34,"end":35,"loc":{"start":{"line":3,"column":12,"index":34},"end":{"line":3,"column":13,"index":35}},
48 "extra": {
49 "rawValue": 1,
50 "raw": "1"
51 },
52 "value": 1
53 },
54 "cases": [
55 {
56 "type": "SwitchCase",
57 "start":45,"end":100,"loc":{"start":{"line":4,"column":6,"index":45},"end":{"line":4,"column":61,"index":100}},
58 "consequent": [],
59 "test": {
60 "type": "BinaryExpression",
61 "start":51,"end":98,"loc":{"start":{"line":4,"column":12,"index":51},"end":{"line":4,"column":59,"index":98}},
62 "left": {
63 "type": "MemberExpression",
64 "start":51,"end":71,"loc":{"start":{"line":4,"column":12,"index":51},"end":{"line":4,"column":32,"index":71}},
65 "object": {
66 "type": "Identifier",
67 "start":51,"end":61,"loc":{"start":{"line":4,"column":12,"index":51},"end":{"line":4,"column":22,"index":61},"identifierName":"MatrixType"},
68 "name": "MatrixType"
69 },
70 "computed": false,
71 "property": {
72 "type": "Identifier",
73 "start":62,"end":71,"loc":{"start":{"line":4,"column":23,"index":62},"end":{"line":4,"column":32,"index":71},"identifierName":"IsScaling"},
74 "name": "IsScaling"
75 }
76 },
77 "operator": "|",
78 "right": {
79 "type": "MemberExpression",
80 "start":74,"end":98,"loc":{"start":{"line":4,"column":35,"index":74},"end":{"line":4,"column":59,"index":98}},
81 "object": {
82 "type": "Identifier",
83 "start":74,"end":84,"loc":{"start":{"line":4,"column":35,"index":74},"end":{"line":4,"column":45,"index":84},"identifierName":"MatrixType"},
84 "name": "MatrixType"
85 },
86 "computed": false,
87 "property": {
88 "type": "Identifier",
89 "start":85,"end":98,"loc":{"start":{"line":4,"column":46,"index":85},"end":{"line":4,"column":59,"index":98},"identifierName":"IsTranslation"},
90 "name": "IsTranslation"
91 }
92 },
93 "extra": {
94 "parenthesized": true,
95 "parenStart": 50
96 }
97 }
98 }
99 ]
100 }
101 ],
102 "directives": []
103 }
104 },
105 {
106 "type": "ClassMethod",
107 "start":114,"end":162,"loc":{"start":{"line":8,"column":2,"index":114},"end":{"line":10,"column":3,"index":162}},
108 "static": false,
109 "key": {
110 "type": "Identifier",
111 "start":114,"end":117,"loc":{"start":{"line":8,"column":2,"index":114},"end":{"line":8,"column":5,"index":117},"identifierName":"bar"},
112 "name": "bar"
113 },
114 "computed": false,
115 "kind": "method",
116 "id": null,
117 "generator": false,
118 "async": false,
119 "params": [],
120 "body": {
121 "type": "BlockStatement",
122 "start":120,"end":162,"loc":{"start":{"line":8,"column":8,"index":120},"end":{"line":10,"column":3,"index":162}},
123 "body": [
124 {
125 "type": "SwitchStatement",
126 "start":126,"end":158,"loc":{"start":{"line":9,"column":4,"index":126},"end":{"line":9,"column":36,"index":158}},
127 "discriminant": {
128 "type": "BinaryExpression",
129 "start":134,"end":154,"loc":{"start":{"line":9,"column":12,"index":134},"end":{"line":9,"column":32,"index":154}},
130 "left": {
131 "type": "BinaryExpression",
132 "start":135,"end":145,"loc":{"start":{"line":9,"column":13,"index":135},"end":{"line":9,"column":23,"index":145}},
133 "left": {
134 "type": "Identifier",
135 "start":135,"end":140,"loc":{"start":{"line":9,"column":13,"index":135},"end":{"line":9,"column":18,"index":140},"identifierName":"typeA"},
136 "name": "typeA"
137 },
138 "operator": "<<",
139 "right": {
140 "type": "NumericLiteral",
141 "start":144,"end":145,"loc":{"start":{"line":9,"column":22,"index":144},"end":{"line":9,"column":23,"index":145}},
142 "extra": {
143 "rawValue": 4,
144 "raw": "4"
145 },
146 "value": 4
147 },
148 "extra": {
149 "parenthesized": true,
150 "parenStart": 134
151 }
152 },
153 "operator": "|",
154 "right": {
155 "type": "Identifier",
156 "start":149,"end":154,"loc":{"start":{"line":9,"column":27,"index":149},"end":{"line":9,"column":32,"index":154},"identifierName":"typeB"},
157 "name": "typeB"
158 }
159 },
160 "cases": []
161 }
162 ],
163 "directives": []
164 }
165 }
166 ]
167 }
168 }
169 ],
170 "directives": []
171 }
172 }