summaryrefslogtreecommitdiffstats
path: root/typing/path.ml
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2010-11-12 03:09:11 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2010-11-12 03:09:11 +0000
commite67c5db33f7d2146c6bfd78bf90b436b4b0ceb98 (patch)
tree9da3f8f82fff48f811e75594c792baea8979e5f4 /typing/path.ml
parent73102f0fdf7fe427d3893fb033f480a7714d51e9 (diff)
move everything to type_expect
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadts@10796 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/path.ml')
-rw-r--r--typing/path.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/typing/path.ml b/typing/path.ml
index 009550261..0d8ebc6f1 100644
--- a/typing/path.ml
+++ b/typing/path.ml
@@ -37,10 +37,12 @@ let rec binding_time = function
| Pdot(p, s, pos) -> binding_time p
| Papply(p1, p2) -> max (binding_time p1) (binding_time p2)
-let rec name = function
+let kfalse x = false
+
+let rec name ?(paren=kfalse) = function
Pident id -> Ident.name id
- | Pdot(p, s, pos) -> name p ^ "." ^ s
- | Papply(p1, p2) -> name p1 ^ "(" ^ name p2 ^ ")"
+ | Pdot(p, s, pos) -> name ~paren p ^ if paren s then ".( " ^ s ^ " )" else s
+ | Papply(p1, p2) -> name ~paren p1 ^ "(" ^ name ~paren p2 ^ ")"
let rec head = function
Pident id -> id