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 *)
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
(fun ds ->
match ds.ds_attached with
| Info -> ()
| Unattached ->
prerr_warning ds.ds_loc (Warnings.Bad_docstring true)
prerr_warning ds.ds_loc (Warnings.Unexpected_docstring true)
| Docs ->
match ds.ds_associated with
| Zero | One -> ()
| Many ->
prerr_warning ds.ds_loc (Warnings.Bad_docstring false))
prerr_warning ds.ds_loc (Warnings.Unexpected_docstring false))
(List.rev !docstrings)
end

View File

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

View File

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