File tree Expand file tree Collapse file tree 4 files changed +377
-1
lines changed
tests/fixtures/parser/ast Expand file tree Collapse file tree 4 files changed +377
-1
lines changed Original file line number Diff line number Diff line change 275275 processJsonValue (options, ctx, reference .from .type );
276276 ctx .appendText (' ,\n ' );
277277 ctx .appendIndent ().appendText (` "resolved": ` );
278- processJsonValue (options, ctx, reference .resolved ? .defs [0 ].name ?? null );
278+ processJsonValue (options, ctx, reference .resolved ? .defs [0 ]? .name ?? null );
279279 ctx .appendText (' ,\n ' );
280280 ctx .appendIndent ().appendText (` "init": ` );
281281 processJsonValue (options, ctx, reference .init ?? null );
Original file line number Diff line number Diff line change 1+ {#if $$slots .labelText }
2+ {/if }
Original file line number Diff line number Diff line change 1+ {
2+ "type" : " Program" ,
3+ "body" : [
4+ {
5+ "type" : " SvelteIfBlock" ,
6+ "elseif" : false ,
7+ "expression" : {
8+ "type" : " MemberExpression" ,
9+ "computed" : false ,
10+ "object" : {
11+ "type" : " Identifier" ,
12+ "name" : " $$slots" ,
13+ "range" : [
14+ 5 ,
15+ 12
16+ ],
17+ "loc" : {
18+ "start" : {
19+ "line" : 1 ,
20+ "column" : 5
21+ },
22+ "end" : {
23+ "line" : 1 ,
24+ "column" : 12
25+ }
26+ }
27+ },
28+ "optional" : false ,
29+ "property" : {
30+ "type" : " Identifier" ,
31+ "name" : " labelText" ,
32+ "range" : [
33+ 13 ,
34+ 22
35+ ],
36+ "loc" : {
37+ "start" : {
38+ "line" : 1 ,
39+ "column" : 13
40+ },
41+ "end" : {
42+ "line" : 1 ,
43+ "column" : 22
44+ }
45+ }
46+ },
47+ "range" : [
48+ 5 ,
49+ 22
50+ ],
51+ "loc" : {
52+ "start" : {
53+ "line" : 1 ,
54+ "column" : 5
55+ },
56+ "end" : {
57+ "line" : 1 ,
58+ "column" : 22
59+ }
60+ }
61+ },
62+ "children" : [],
63+ "else" : null ,
64+ "range" : [
65+ 0 ,
66+ 29
67+ ],
68+ "loc" : {
69+ "start" : {
70+ "line" : 1 ,
71+ "column" : 0
72+ },
73+ "end" : {
74+ "line" : 2 ,
75+ "column" : 5
76+ }
77+ }
78+ }
79+ ],
80+ "sourceType" : " module" ,
81+ "comments" : [],
82+ "tokens" : [
83+ {
84+ "type" : " Punctuator" ,
85+ "value" : " {" ,
86+ "range" : [
87+ 0 ,
88+ 1
89+ ],
90+ "loc" : {
91+ "start" : {
92+ "line" : 1 ,
93+ "column" : 0
94+ },
95+ "end" : {
96+ "line" : 1 ,
97+ "column" : 1
98+ }
99+ }
100+ },
101+ {
102+ "type" : " MustacheKeyword" ,
103+ "value" : " #if" ,
104+ "range" : [
105+ 1 ,
106+ 4
107+ ],
108+ "loc" : {
109+ "start" : {
110+ "line" : 1 ,
111+ "column" : 1
112+ },
113+ "end" : {
114+ "line" : 1 ,
115+ "column" : 4
116+ }
117+ }
118+ },
119+ {
120+ "type" : " Identifier" ,
121+ "value" : " $$slots" ,
122+ "range" : [
123+ 5 ,
124+ 12
125+ ],
126+ "loc" : {
127+ "start" : {
128+ "line" : 1 ,
129+ "column" : 5
130+ },
131+ "end" : {
132+ "line" : 1 ,
133+ "column" : 12
134+ }
135+ }
136+ },
137+ {
138+ "type" : " Punctuator" ,
139+ "value" : " ." ,
140+ "range" : [
141+ 12 ,
142+ 13
143+ ],
144+ "loc" : {
145+ "start" : {
146+ "line" : 1 ,
147+ "column" : 12
148+ },
149+ "end" : {
150+ "line" : 1 ,
151+ "column" : 13
152+ }
153+ }
154+ },
155+ {
156+ "type" : " Identifier" ,
157+ "value" : " labelText" ,
158+ "range" : [
159+ 13 ,
160+ 22
161+ ],
162+ "loc" : {
163+ "start" : {
164+ "line" : 1 ,
165+ "column" : 13
166+ },
167+ "end" : {
168+ "line" : 1 ,
169+ "column" : 22
170+ }
171+ }
172+ },
173+ {
174+ "type" : " Punctuator" ,
175+ "value" : " }" ,
176+ "range" : [
177+ 22 ,
178+ 23
179+ ],
180+ "loc" : {
181+ "start" : {
182+ "line" : 1 ,
183+ "column" : 22
184+ },
185+ "end" : {
186+ "line" : 1 ,
187+ "column" : 23
188+ }
189+ }
190+ },
191+ {
192+ "type" : " Punctuator" ,
193+ "value" : " {" ,
194+ "range" : [
195+ 24 ,
196+ 25
197+ ],
198+ "loc" : {
199+ "start" : {
200+ "line" : 2 ,
201+ "column" : 0
202+ },
203+ "end" : {
204+ "line" : 2 ,
205+ "column" : 1
206+ }
207+ }
208+ },
209+ {
210+ "type" : " MustacheKeyword" ,
211+ "value" : " /if" ,
212+ "range" : [
213+ 25 ,
214+ 28
215+ ],
216+ "loc" : {
217+ "start" : {
218+ "line" : 2 ,
219+ "column" : 1
220+ },
221+ "end" : {
222+ "line" : 2 ,
223+ "column" : 4
224+ }
225+ }
226+ },
227+ {
228+ "type" : " Punctuator" ,
229+ "value" : " }" ,
230+ "range" : [
231+ 28 ,
232+ 29
233+ ],
234+ "loc" : {
235+ "start" : {
236+ "line" : 2 ,
237+ "column" : 4
238+ },
239+ "end" : {
240+ "line" : 2 ,
241+ "column" : 5
242+ }
243+ }
244+ }
245+ ],
246+ "range" : [
247+ 0 ,
248+ 30
249+ ],
250+ "loc" : {
251+ "start" : {
252+ "line" : 1 ,
253+ "column" : 0
254+ },
255+ "end" : {
256+ "line" : 3 ,
257+ "column" : 0
258+ }
259+ }
260+ }
Original file line number Diff line number Diff line change 1+ {
2+ "type" : " global" ,
3+ "variables" : [
4+ {
5+ "name" : " $$slots" ,
6+ "identifiers" : [],
7+ "defs" : [],
8+ "references" : [
9+ {
10+ "identifier" : {
11+ "type" : " Identifier" ,
12+ "name" : " $$slots" ,
13+ "range" : [
14+ 5 ,
15+ 12
16+ ],
17+ "loc" : {
18+ "start" : {
19+ "line" : 1 ,
20+ "column" : 5
21+ },
22+ "end" : {
23+ "line" : 1 ,
24+ "column" : 12
25+ }
26+ }
27+ },
28+ "from" : " module" ,
29+ "init" : null ,
30+ "resolved" : null
31+ }
32+ ]
33+ },
34+ {
35+ "name" : " $$props" ,
36+ "identifiers" : [],
37+ "defs" : [],
38+ "references" : []
39+ },
40+ {
41+ "name" : " $$restProps" ,
42+ "identifiers" : [],
43+ "defs" : [],
44+ "references" : []
45+ }
46+ ],
47+ "references" : [],
48+ "childScopes" : [
49+ {
50+ "type" : " module" ,
51+ "variables" : [],
52+ "references" : [
53+ {
54+ "identifier" : {
55+ "type" : " Identifier" ,
56+ "name" : " $$slots" ,
57+ "range" : [
58+ 5 ,
59+ 12
60+ ],
61+ "loc" : {
62+ "start" : {
63+ "line" : 1 ,
64+ "column" : 5
65+ },
66+ "end" : {
67+ "line" : 1 ,
68+ "column" : 12
69+ }
70+ }
71+ },
72+ "from" : " module" ,
73+ "init" : null ,
74+ "resolved" : null
75+ }
76+ ],
77+ "childScopes" : [
78+ {
79+ "type" : " block" ,
80+ "variables" : [],
81+ "references" : [],
82+ "childScopes" : [],
83+ "through" : []
84+ }
85+ ],
86+ "through" : [
87+ {
88+ "identifier" : {
89+ "type" : " Identifier" ,
90+ "name" : " $$slots" ,
91+ "range" : [
92+ 5 ,
93+ 12
94+ ],
95+ "loc" : {
96+ "start" : {
97+ "line" : 1 ,
98+ "column" : 5
99+ },
100+ "end" : {
101+ "line" : 1 ,
102+ "column" : 12
103+ }
104+ }
105+ },
106+ "from" : " module" ,
107+ "init" : null ,
108+ "resolved" : null
109+ }
110+ ]
111+ }
112+ ],
113+ "through" : []
114+ }
You can’t perform that action at this time.
0 commit comments