summaryrefslogtreecommitdiff
path: root/typing/ident.ml
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2010-01-11 19:50:55 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2010-01-11 19:50:55 +0000
commite4876f38068b7567ffb573b1dfb83c42181ef53c (patch)
tree994119b7e2d182cb36fa82a665047b2153623bed /typing/ident.ml
parent041533d953ad11d353c5b2fabddc474a7f74e1f8 (diff)
downloadocaml-e4876f38068b7567ffb573b1dfb83c42181ef53c.tar.gz
Trying to turn .cvsignore into .svnignore.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/dothat@9522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/ident.ml')
-rw-r--r--typing/ident.ml16
1 files changed, 16 insertions, 0 deletions
diff --git a/typing/ident.ml b/typing/ident.ml
index 89a343c31e..c5728804cc 100644
--- a/typing/ident.ml
+++ b/typing/ident.ml
@@ -150,6 +150,22 @@ let rec find_stamp s = function
| Some k ->
if k.ident.stamp = s then k.data else find_stamp s k.previous
+let rec mem_stamp s = function
+ | None ->
+ false
+ | Some k ->
+ k.ident.stamp = s || mem_stamp s k.previous
+
+let rec mem id = function
+ | Empty -> false
+ | Node(l, k, r, _) ->
+ let c = compare id.name k.ident.name in
+ if c = 0 then
+ id.stamp = k.ident.stamp ||
+ mem_stamp id.stamp k.previous
+ else
+ mem id (if c < 0 then l else r)
+
let rec find_same id = function
Empty ->
raise Not_found