File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
let defaultPrintWidth = 100
2
2
3
3
(* Determine if the file is in uncurried mode by looking for
4
- the fist ancestor .bsconfig and see if it contains "uncurried": " true" *)
4
+ the fist ancestor .bsconfig and see if it contains "uncurried": true *)
5
5
let getUncurriedFromBsconfig ~filename =
6
6
let rec findBsconfig ~dir =
7
7
let bsconfig = Filename. concat dir " bsconfig.json" in
@@ -41,9 +41,19 @@ let getUncurriedFromBsconfig ~filename =
41
41
let uncurried =
42
42
lines
43
43
|> List. exists (fun line ->
44
- let words = line |> String. split_on_char '\"' in
45
- words |> List. exists (fun word -> word = " uncurried" )
46
- && words |> List. exists (fun word -> word = " true" ))
44
+ let uncurried = ref false in
45
+ let true_ = ref false in
46
+ let words = line |> String. split_on_char ' ' in
47
+ words
48
+ |> List. iter (fun word ->
49
+ match word with
50
+ | "\" uncurried\" " | "\" uncurried\" :" -> uncurried := true
51
+ | "\" uncurried\" :true" | "\" uncurried\" :true," ->
52
+ uncurried := true ;
53
+ true_ := true
54
+ | "true" | ":true" | "true," | ":true," -> true_ := true
55
+ | _ -> () );
56
+ ! uncurried && ! true_)
47
57
in
48
58
if uncurried then Config. uncurried := Uncurried
49
59
You can’t perform that action at this time.
0 commit comments