From e4876f38068b7567ffb573b1dfb83c42181ef53c Mon Sep 17 00:00:00 2001 From: Pierre Weis Date: Mon, 11 Jan 2010 19:50:55 +0000 Subject: Trying to turn .cvsignore into .svnignore. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/dothat@9522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- typing/ident.ml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'typing/ident.ml') 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 -- cgit v1.2.1