summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_name.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ocamldoc/odoc_name.ml')
-rw-r--r--ocamldoc/odoc_name.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/ocamldoc/odoc_name.ml b/ocamldoc/odoc_name.ml
index c0c820b3b..c874c5b66 100644
--- a/ocamldoc/odoc_name.ml
+++ b/ocamldoc/odoc_name.ml
@@ -35,12 +35,13 @@ type t = string
let parens_if_infix name =
match name with
- "" -> ""
- | s ->
- if List.mem s.[0] infix_chars then
- "("^s^")"
- else
- s
+ | "" -> ""
+ | s when s.[0] = '*' || s.[String.length s - 1] = '*' -> "( " ^ s ^ " )"
+ | s when List.mem s.[0] infix_chars -> "(" ^ s ^ ")"
+ | "or" | "mod" | "land" | "lor" | "lxor" | "lsl" | "lsr" | "asr" ->
+ "(" ^ name ^ ")"
+ | _ -> name
+;;
let cut name =
match name with