File tree 3 files changed +36
-3
lines changed
3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ git version
7
7
- locate: look for original source files before looking for preprocessed
8
8
files (#1219 by @ddickstein , fixes #894 )
9
9
- fix handlink of ppx's under Windows (#1413 )
10
+ - handle ` = ` syntax in compiler flags (#1409 )
10
11
+ test suite
11
12
- make ` merlin-wrapper ` create a default ` .merlin ` file only when there is
12
13
no ` dune-project ` to let tests use ` dune ocaml-merlin ` reader. (#1425 )
Original file line number Diff line number Diff line change @@ -76,9 +76,16 @@ let parse_all ~warning global_spec local_spec =
76
76
match parse_one ~warning global_spec local_spec args global local with
77
77
| Some (args , global , local ) -> normal_parsing args global local
78
78
| None -> match args with
79
- | arg :: args ->
80
- warning (" unknown flag " ^ arg);
81
- resume_parsing args global local
79
+ | arg :: args -> begin
80
+ (* We split on the first '=' to check if the argument was
81
+ of the form name=value *)
82
+ try
83
+ let name, value = Misc. cut_at arg '=' in
84
+ normal_parsing (name::value::args) global local
85
+ with Not_found ->
86
+ warning (" unknown flag " ^ arg);
87
+ resume_parsing args global local
88
+ end
82
89
| [] -> (global, local)
83
90
and resume_parsing args global local =
84
91
let args = match args with
Original file line number Diff line number Diff line change 35
35
" value" : [],
36
36
" notifications" : []
37
37
}
38
+
39
+ $ cat > . merlin << EOF
40
+ > S .
41
+ > B .
42
+ > FLG -nopervasives -alert= -deprecated
43
+ > EOF
44
+
45
+ $ $ MERLIN single errors -filename main. ml < main. ml
46
+ {
47
+ " class" : " return" ,
48
+ " value" : [],
49
+ " notifications" : []
50
+ }
51
+
52
+ The compiler accept both
53
+ $ $ OCAMLC -c main. ml
54
+ File " main.ml" , line 2 , characters 8 -12:
55
+ 2 | let x = sqrt 3 .
56
+ ^^^^
57
+ Alert deprecated: Lib. sqrt
58
+ I am deprecated
59
+
60
+ $ $ OCAMLC -alert -deprecated -c main. ml
61
+
62
+ $ $ OCAMLC -alert= -deprecated -c main. ml
You can’t perform that action at this time.
0 commit comments