diff options
Diffstat (limited to 'ocamldoc')
-rw-r--r-- | ocamldoc/odoc_html.ml | 1 | ||||
-rw-r--r-- | ocamldoc/odoc_info.mli | 1 | ||||
-rw-r--r-- | ocamldoc/odoc_latex.ml | 3 | ||||
-rw-r--r-- | ocamldoc/odoc_man.ml | 1 | ||||
-rw-r--r-- | ocamldoc/odoc_sig.ml | 7 | ||||
-rw-r--r-- | ocamldoc/odoc_type.ml | 1 |
6 files changed, 10 insertions, 4 deletions
diff --git a/ocamldoc/odoc_html.ml b/ocamldoc/odoc_html.ml index 369114d74c..c016773e14 100644 --- a/ocamldoc/odoc_html.ml +++ b/ocamldoc/odoc_html.ml @@ -1521,6 +1521,7 @@ class html = bs b "</td>\n<td align=\"left\" valign=\"top\" >\n"; bs b "<code>"; if r.rf_mutable then bs b (self#keyword "mutable ") ; + if r.rf_focus then bs b (self#keyword "match ") ; bs b (r.rf_name ^ " : ") ; self#html_of_type_expr b father r.rf_type; bs b ";</code></td>\n"; diff --git a/ocamldoc/odoc_info.mli b/ocamldoc/odoc_info.mli index 0ab1fa815a..d3e5b32451 100644 --- a/ocamldoc/odoc_info.mli +++ b/ocamldoc/odoc_info.mli @@ -210,6 +210,7 @@ module Type : { rf_name : string ; (** Name of the field. *) rf_mutable : bool ; (** [true] if mutable. *) + rf_focus : bool; (** [true] if autofocus. *) rf_type : Types.type_expr ; (** Type of the field. *) mutable rf_text : text option ; (** Optional description in the associated comment.*) } diff --git a/ocamldoc/odoc_latex.ml b/ocamldoc/odoc_latex.ml index df404fc327..5c05bfc780 100644 --- a/ocamldoc/odoc_latex.ml +++ b/ocamldoc/odoc_latex.ml @@ -592,8 +592,9 @@ class latex = (fun r -> let s_field = p fmt2 - "@[<h 6> %s%s :@ %s ;" + "@[<h 6> %s%s%s :@ %s ;" (if r.rf_mutable then "mutable " else "") + (if r.rf_focus then "match " else "") r.rf_name (self#normal_type mod_name r.rf_type); flush2 () diff --git a/ocamldoc/odoc_man.ml b/ocamldoc/odoc_man.ml index 037dee02da..3d9c0d7767 100644 --- a/ocamldoc/odoc_man.ml +++ b/ocamldoc/odoc_man.ml @@ -514,6 +514,7 @@ class man = List.iter (fun r -> bs b (if r.rf_mutable then "\n\n.B mutable \n" else "\n "); + bs b (if r.rf_focus then "\n\n.B match \n" else "\n "); bs b (r.rf_name^" : "); self#man_of_type_expr b father r.rf_type; bs b ";"; diff --git a/ocamldoc/odoc_sig.ml b/ocamldoc/odoc_sig.ml index 74de957ed6..87d1276a3e 100644 --- a/ocamldoc/odoc_sig.ml +++ b/ocamldoc/odoc_sig.ml @@ -201,12 +201,12 @@ module Analyser = let rec f = function [] -> [] - | (name, _, ct, xxloc) :: [] -> + | (name, _, _, ct, xxloc) :: [] -> let pos = ct.Parsetree.ptyp_loc.Location.loc_end.Lexing.pos_cnum in let s = get_string_of_file pos pos_end in let (_,comment_opt) = My_ir.just_after_special !file_name s in [name.txt, comment_opt] - | (name,_,ct,xxloc) :: ((name2,_,ct2,xxloc2) as ele2) :: q -> + | (name,_,_,ct,xxloc) :: ((name2,_,_,ct2,xxloc2) as ele2) :: q -> let pos = ct.Parsetree.ptyp_loc.Location.loc_end.Lexing.pos_cnum in let pos2 = ct2.Parsetree.ptyp_loc.Location.loc_start.Lexing.pos_cnum in let s = get_string_of_file pos pos2 in @@ -239,7 +239,7 @@ module Analyser = Odoc_type.Type_variant (List.map f l) | Types.Type_record (l, _) -> - let f (field_name, mutable_flag, type_expr) = + let f (field_name, mutable_flag, focus_flag, type_expr) = let field_name = Ident.name field_name in let comment_opt = try @@ -251,6 +251,7 @@ module Analyser = { rf_name = field_name ; rf_mutable = mutable_flag = Mutable ; + rf_focus = focus_flag = AutoFocus ; rf_type = Odoc_env.subst_type env type_expr ; rf_text = comment_opt } diff --git a/ocamldoc/odoc_type.ml b/ocamldoc/odoc_type.ml index ee973a01d7..1a15322f33 100644 --- a/ocamldoc/odoc_type.ml +++ b/ocamldoc/odoc_type.ml @@ -30,6 +30,7 @@ type variant_constructor = { type record_field = { rf_name : string ; rf_mutable : bool ; (** true if mutable *) + rf_focus : bool; (** [true] if autofocus. *) rf_type : Types.type_expr ; mutable rf_text : Odoc_types.text option ; (** optional user description *) } |