File tree Expand file tree Collapse file tree 2 files changed +85
-8
lines changed 
jscomp/syntax/tests/printer/pattern Expand file tree Collapse file tree 2 files changed +85
-8
lines changed Original file line number Diff line number Diff line change 11let  someDict  =  dict {
2-      "one" : "one" ,
2+   "one" : "one" ,
33}
44
55let  dict {"one" : ?one } =  someDict 
66
7- let  foo  =  () =>  switch  someDict  {
8- | dict {"one" : "one" } =>  Js .log ("one" )
9- | _  =>  Js .log ("not one" )
10- }
7+ let  foo  =  () =>  {
8+   let  _  =  switch  someDict  {
9+   // Comment here 
10+   | dict {
11+       // Comment above the pattern 
12+       "one" :
13+         // Comment right in the pattern 
14+         "one" ,
15+     } => 
16+     Js .log ("one" )
17+   | _  =>  Js .log ("not one" )
18+   }
19+ 
20+   let  _  =  switch  someDict  {
21+   | dict {
22+       // foo 
23+       "one" : "one" ,
24+       // bar 
25+       "twoooooooooo" : 2 ,
26+       // baz 
27+       "three" : 3 ,
28+       "fooooour" : 4 ,
29+       "fiiiive" : 5 ,
30+     } => 
31+     Js .log ("one" )
32+   | _  =>  Js .log ("not one" )
33+   }
34+ 
35+   let  _  =  switch  someDict  {
36+   | dict {
37+       /* foo */ 
38+       /* baz */  "one" : "one" ,
39+       /* bar */ 
40+       /* baz */  "twoooooooooo" : 2 ,
41+       /* baz */ 
42+       /* baz */  "three" : 3 ,
43+       "fooooour" : 4 ,
44+       "fiiiive" : 5 ,
45+     } => 
46+     Js .log ("one" )
47+   | _  =>  Js .log ("not one" )
48+   }
49+ }
Original file line number Diff line number Diff line change @@ -4,8 +4,46 @@ let someDict = dict{
44
55let dict{"one": ?one} = someDict
66
7- let foo = () =>
8-   switch someDict {
9-   | dict{"one": "one"} => Js.log("one")
7+ let foo = () => {
8+   let _ = switch someDict {
9+   // Comment here
10+   | dict{
11+       // Comment above the pattern
12+       "one":
13+         // Comment right in the pattern
14+         "one",
15+     } =>
16+     Js.log("one")
1017  | _ => Js.log("not one")
1118  }
19+ 
20+   let _ = switch someDict {
21+   | dict{
22+       // foo
23+       "one": "one",
24+       // bar
25+       "twoooooooooo": 2,
26+       // baz
27+       "three": 3,
28+       "fooooour": 4,
29+       "fiiiive": 5,
30+     } =>
31+     Js.log("one")
32+   | _ => Js.log("not one")
33+   }
34+ 
35+   let _ = switch someDict {
36+   | dict{
37+       /* foo */
38+       /* baz */ "one": "one",
39+       /* bar */
40+       /* baz */ "twoooooooooo": 2,
41+       /* baz */
42+       /* baz */ "three": 3,
43+       "fooooour": 4,
44+       "fiiiive": 5,
45+     } =>
46+     Js.log("one")
47+   | _ => Js.log("not one")
48+   }
49+ }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments