camlspotter avatar camlspotter committed 692bfa3

forgot to add .ocamlspot

Comments (0)

Files changed (5)

tests/dot_ocamlspot/.ocamlspot

+build_dir=build
   val compare : t -> t 
     -> [`Left | `Right | `Includes | `Included | `Same | `Overwrap]
   val split : t -> by:t -> (t * t) option
+  val format : Format.formatter -> t -> unit
 end
 
 module Make(Ord : OrderedType) = struct
       | `Left -> -1
       | `Right -> 1
       | _ -> 0
+    let format ppf = function
+      | Node (e, _) -> Ord.format ppf e
   end
   
   and NodeSet : Xset.S with type elt = 
   let add_elem elem t = add_node (Node (elem, empty)) t  
 
   let rec find_path_contains_aux path node t =
+(*
+    Format.eprintf "FIND: %a in @[%a@]@."
+      (fun ppf node -> match node with Node (e, _) -> Ord.format ppf e) node
+      NodeSet.unsafe_dump t;
+*)
     match unsafe_find node t with
     | None -> path
     | Some (Node (elem', t')) ->
   val compare : t -> t 
     -> [ `Included | `Includes | `Left | `Overwrap | `Right | `Same ]
   val split : t -> by:t -> (t * t) option
+
+  val format : Format.formatter -> t -> unit
+  (** for debugging *)
 end
 
 module Make (Ord : OrderedType) : sig
 
 (* Set with binary custom search *)
 
-module type OrderedType = Set.OrderedType
+module type OrderedType = sig
+  include Set.OrderedType
+  val format : Format.formatter -> t -> unit
+end
 
 module type S = sig
   include Set.S
   val unsafe_binary : t -> (t * elt * t) option
   val unsafe_middle : t -> elt option
   val unsafe_find : elt -> t -> elt option
+  val unsafe_dump : Format.formatter -> t -> unit
 end
 
 module Make(Ord : OrderedType) : S with type elt = Ord.t = struct
   let rec unsafe_find elt t = match unsafe_internal t with
     | Empty -> None
     | Node (left, elt', right, _) -> 
+        (* Format.eprintf "looking %a@." Ord.format elt'; *)
 	match Ord.compare elt elt' with 
 	| 0  -> Some elt'
 	| -1 -> unsafe_find elt left
 	| 1  -> unsafe_find elt right
 	| _  -> assert false
+
+  let rec unsafe_dump ppf t = match unsafe_internal t with
+    | Empty -> Format.fprintf ppf "."
+    | Node (left, elt', right, _) -> 
+        Format.fprintf ppf "@[<v2>%a@,%a@,%a@]"
+          Ord.format elt'
+          unsafe_dump left
+          unsafe_dump right
+      
 end
 
 (* Set with binary custom search *)
 
-module type OrderedType = Set.OrderedType
+module type OrderedType = sig
+  include Set.OrderedType
+  val format : Format.formatter -> t -> unit
+end
 
 module type S = sig
   include Set.S
   val unsafe_binary : t -> (t * elt * t) option
   val unsafe_middle : t -> elt option
   val unsafe_find : elt -> t -> elt option
+  val unsafe_dump : Format.formatter -> t -> unit
 end
 
 module Make(Ord : OrderedType) : S 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.