summaryrefslogtreecommitdiffstats
path: root/typing/path.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-08-23 11:55:54 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-08-23 11:55:54 +0000
commit90fc1c2cf4eee25f6ca0427273ff1baf4d364abf (patch)
treeb66a09ee5614005a7904a2f45c0cc2b7c1c50e65 /typing/path.ml
parent50b6deb34c0e1c31a0abf372ccecc885c549e0c6 (diff)
Foncteurs applicatifs.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@205 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/path.ml')
-rw-r--r--typing/path.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/typing/path.ml b/typing/path.ml
index 8aa7a1fbf..19c617d3d 100644
--- a/typing/path.ml
+++ b/typing/path.ml
@@ -14,6 +14,7 @@
type t =
Pident of Ident.t
| Pdot of t * string * int
+ | Papply of t * t
let nopos = -1
@@ -21,10 +22,10 @@ let rec same p1 p2 =
match (p1, p2) with
(Pident id1, Pident id2) -> Ident.same id1 id2
| (Pdot(p1, s1, pos1), Pdot(p2, s2, pos2)) -> s1 = s2 & same p1 p2
+ | (Papply(fun1, arg1), Papply(fun2, arg2)) -> same fun1 fun2 & same arg1 arg2
| (_, _) -> false
-let rec root = function
- Pident id -> id
- | Pdot(p, s, pos) -> root p
-
-let isfree id p = Ident.same id (root p)
+let rec isfree id = function
+ Pident id' -> Ident.same id id'
+ | Pdot(p, s, pos) -> isfree id p
+ | Papply(p1, p2) -> isfree id p1 or isfree id p2