Rename Bad_docstring => Unexpected_docstring

master
Nicolás Ojeda Bär 2020-07-10 18:04:15 +02:00
parent 9f9cc29fd8
commit a0cef9fdc6
3 changed files with 8 additions and 8 deletions

View File

@ -44,18 +44,18 @@ let docstrings : docstring list ref = ref []
(* Warn for unused and ambiguous docstrings *) (* Warn for unused and ambiguous docstrings *)
let warn_bad_docstrings () = let warn_bad_docstrings () =
if Warnings.is_active (Warnings.Bad_docstring true) then begin if Warnings.is_active (Warnings.Unexpected_docstring true) then begin
List.iter List.iter
(fun ds -> (fun ds ->
match ds.ds_attached with match ds.ds_attached with
| Info -> () | Info -> ()
| Unattached -> | Unattached ->
prerr_warning ds.ds_loc (Warnings.Bad_docstring true) prerr_warning ds.ds_loc (Warnings.Unexpected_docstring true)
| Docs -> | Docs ->
match ds.ds_associated with match ds.ds_associated with
| Zero | One -> () | Zero | One -> ()
| Many -> | Many ->
prerr_warning ds.ds_loc (Warnings.Bad_docstring false)) prerr_warning ds.ds_loc (Warnings.Unexpected_docstring false))
(List.rev !docstrings) (List.rev !docstrings)
end end

View File

@ -74,7 +74,7 @@ type t =
| Attribute_payload of string * string (* 47 *) | Attribute_payload of string * string (* 47 *)
| Eliminated_optional_arguments of string list (* 48 *) | Eliminated_optional_arguments of string list (* 48 *)
| No_cmi_file of string * string option (* 49 *) | No_cmi_file of string * string option (* 49 *)
| Bad_docstring of bool (* 50 *) | Unexpected_docstring of bool (* 50 *)
| Expect_tailcall (* 51 *) | Expect_tailcall (* 51 *)
| Fragile_literal_pattern (* 52 *) | Fragile_literal_pattern (* 52 *)
| Misplaced_attribute of string (* 53 *) | Misplaced_attribute of string (* 53 *)
@ -151,7 +151,7 @@ let number = function
| Attribute_payload _ -> 47 | Attribute_payload _ -> 47
| Eliminated_optional_arguments _ -> 48 | Eliminated_optional_arguments _ -> 48
| No_cmi_file _ -> 49 | No_cmi_file _ -> 49
| Bad_docstring _ -> 50 | Unexpected_docstring _ -> 50
| Expect_tailcall -> 51 | Expect_tailcall -> 51
| Fragile_literal_pattern -> 52 | Fragile_literal_pattern -> 52
| Misplaced_attribute _ -> 53 | Misplaced_attribute _ -> 53
@ -291,7 +291,7 @@ let descriptions =
49, "Absent cmi file when looking up module alias.", 49, "Absent cmi file when looking up module alias.",
["no-cmi-file"]; ["no-cmi-file"];
50, "Unexpected documentation comment.", 50, "Unexpected documentation comment.",
["bad-docstring"]; ["unexpected-docstring"];
51, "Warning on non-tail calls if @tailcall present.", 51, "Warning on non-tail calls if @tailcall present.",
["expect-tailcall"]; ["expect-tailcall"];
52, "Fragile constant pattern.", 52, "Fragile constant pattern.",
@ -736,7 +736,7 @@ let message = function
Printf.sprintf Printf.sprintf
"no valid cmi file was found in path for module %s. %s" "no valid cmi file was found in path for module %s. %s"
name msg name msg
| Bad_docstring unattached -> | Unexpected_docstring unattached ->
if unattached then "unattached documentation comment (ignored)" if unattached then "unattached documentation comment (ignored)"
else "ambiguous documentation comment" else "ambiguous documentation comment"
| Expect_tailcall -> | Expect_tailcall ->

View File

@ -76,7 +76,7 @@ type t =
| Attribute_payload of string * string (* 47 *) | Attribute_payload of string * string (* 47 *)
| Eliminated_optional_arguments of string list (* 48 *) | Eliminated_optional_arguments of string list (* 48 *)
| No_cmi_file of string * string option (* 49 *) | No_cmi_file of string * string option (* 49 *)
| Bad_docstring of bool (* 50 *) | Unexpected_docstring of bool (* 50 *)
| Expect_tailcall (* 51 *) | Expect_tailcall (* 51 *)
| Fragile_literal_pattern (* 52 *) | Fragile_literal_pattern (* 52 *)
| Misplaced_attribute of string (* 53 *) | Misplaced_attribute of string (* 53 *)