1313if(true)// 2
1414{ }
1515
16+ if(true)
17+ // 22
18+ { }
19+
1620if(true){ } // 3
1721
1822if(true)/*4*/{ }
@@ -29,6 +33,17 @@ if(true) /* 7 */ ++x;
2933if(1) // 8
3034 foo();
3135
36+ if (0) { // comment
37+ }
38+
39+ if (0) {
40+ // comment
41+ }
42+
43+ if (0) { /* comment */ }
44+
45+ if ((0, 0/* comment */)) { }
46+
3247=====================================output=====================================
3348if (
3449 true
@@ -40,6 +55,11 @@ if (true) // 2
4055{
4156}
4257
58+ if (true)
59+ // 22
60+ {
61+ }
62+
4363if (true) {
4464} // 3
4565
@@ -61,6 +81,111 @@ if (1)
6181 // 8
6282 foo();
6383
84+ if (0) {
85+ // comment
86+ }
87+
88+ if (0) {
89+ // comment
90+ }
91+
92+ if (0) {
93+ /* comment */
94+ }
95+
96+ if ((0, 0) /* comment */) {
97+ }
98+
99+ ================================================================================
100+ ` ;
101+
102+ exports [` switch.js format 1` ] = `
103+ ====================================options=====================================
104+ parsers: ["babel", "flow", "typescript"]
105+ printWidth: 80 (default) |
106+ =====================================input======================================
107+ switch(
108+ true
109+ // 1
110+ ) { }
111+
112+ switch(true)// 2
113+ { }
114+
115+ switch(true)
116+ // 22
117+ { }
118+
119+ switch(true){ } // 3
120+
121+ switch(true)/*4*/{ }
122+
123+ switch(
124+ true // 5
125+ && true // 52
126+ ){ }
127+
128+ switch(true) { } // 6
129+
130+ switch (0) { // comment
131+ }
132+
133+ switch (0) {
134+ // comment
135+ }
136+
137+ switch (0) { /* comment */ }
138+
139+ switch ((0, 0/* comment */)) { }
140+
141+ =====================================output=====================================
142+ switch (
143+ true
144+ // 1
145+ ) {
146+ }
147+
148+ switch (
149+ true // 2
150+ ) {
151+ }
152+
153+ switch (
154+ true
155+ // 22
156+ ) {
157+ }
158+
159+ switch (true) {
160+ } // 3
161+
162+ switch (true /*4*/) {
163+ }
164+
165+ switch (
166+ true && // 5
167+ true // 52
168+ ) {
169+ }
170+
171+ switch (true) {
172+ } // 6
173+
174+ switch (0) {
175+ // comment
176+ }
177+
178+ switch (0) {
179+ // comment
180+ }
181+
182+ switch (0) {
183+ /* comment */
184+ }
185+
186+ switch ((0, 0) /* comment */) {
187+ }
188+
64189================================================================================
65190` ;
66191
@@ -77,6 +202,10 @@ while(
77202while(true)// 2
78203{ }
79204
205+ while(true)
206+ // 22
207+ { }
208+
80209while(true){ } // 3
81210
82211while(true)/*4*/{ }
@@ -93,6 +222,17 @@ while(true) /* 7 */ ++x;
93222while(1) // 8
94223 foo();
95224
225+ while (0) { // comment
226+ }
227+
228+ while (0) {
229+ // comment
230+ }
231+
232+ while (0) { /* comment */ }
233+
234+ while ((0, 0/* comment */)) { }
235+
96236=====================================output=====================================
97237while (
98238 true
@@ -102,6 +242,10 @@ while (
102242while (true) // 2
103243{ }
104244
245+ while (true)
246+ // 22
247+ { }
248+
105249while (true) { } // 3
106250
107251while (true) /*4*/ { }
@@ -119,6 +263,20 @@ while (1)
119263 // 8
120264 foo();
121265
266+ while (0) {
267+ // comment
268+ }
269+
270+ while (0) {
271+ // comment
272+ }
273+
274+ while (0) {
275+ /* comment */
276+ }
277+
278+ while ((0, 0) /* comment */) { }
279+
122280================================================================================
123281` ;
124282
@@ -135,6 +293,10 @@ with(
135293with(foo)// 2
136294{ }
137295
296+ with(foo)
297+ // 22
298+ { }
299+
138300with(foo){ } // 3
139301
140302with(foo)/*4*/{ }
@@ -151,6 +313,17 @@ with(foo) /* 7 */ ++x;
151313with(1) // 8
152314 foo();
153315
316+ with (0) { // comment
317+ }
318+
319+ with (0) {
320+ // comment
321+ }
322+
323+ with (0) { /* comment */ }
324+
325+ with ((0, 0/* comment */)) { }
326+
154327=====================================output=====================================
155328with (
156329 foo
@@ -162,6 +335,11 @@ with (foo) // 2
162335{
163336}
164337
338+ with (foo)
339+ // 22
340+ {
341+ }
342+
165343with (foo) {
166344} // 3
167345
@@ -183,5 +361,20 @@ with (1)
183361 // 8
184362 foo();
185363
364+ with (0) {
365+ // comment
366+ }
367+
368+ with (0) {
369+ // comment
370+ }
371+
372+ with (0) {
373+ /* comment */
374+ }
375+
376+ with ((0, 0) /* comment */) {
377+ }
378+
186379================================================================================
187380` ;
0 commit comments