Commits

camlspotter committed fbe41a7

fix

Comments (0)

Files changed (5)

ocamlspot/ocamlspot.ml

         (* print "Val: val name : type" if it is a Str: val *)
         let print_sig_entry annots =
           let rec find_type = function
-            | Annot.Type typ :: _ -> Some typ
+            | Annot.Type (typ, _) :: _ -> Some typ
             | _::xs -> find_type xs
             | [] -> None
           in
         (* print_type_decl: if one Type is found *)
         if C.print_type_declaration then begin
           match List.filter (function Annot.Type _ -> true | _ -> false) annots with
-          | [Annot.Type typ] -> ()
-              
-              
+          | [Annot.Type (typ, env)] -> 
+              printf "Expand: @[%a@]@." Typeexpand.format_as_expr (Typeexpand.expand env typ)
           | [] -> ()
           | _ -> eprintf "More than one Annot.Type found. Disabled --print-type-decl.@."
         end;

ocamlspot/spotapi.ml

 
   let ident_of_structure_item : structure_item -> (Kind.t * Ident.t) option = function
     | Str_value id        -> Some (Kind.Value, id)
-    | Str_type (id, _)    -> Some (Kind.Type, id)
+    | Str_type id         -> Some (Kind.Type, id)
     | Str_exception id    -> Some (Kind.Exception, id) 
     | Str_module (id, _)  -> Some (Kind.Module, id)
     | Str_modtype (id, _) -> Some (Kind.Module_type, id)
       
   and format_structure_item ppf = function
     | Str_value id -> fprintf ppf "val %s" (Ident.name id)
-    | Str_type (id, _) -> fprintf ppf "type %s" (Ident.name id) (* CR jfuruse: todo *)
+    | Str_type id -> fprintf ppf "type %s" (Ident.name id) (* CR jfuruse: todo *)
     | Str_exception id -> fprintf ppf "exception %s" (Ident.name id)
     | Str_module (id, mexp) -> 
         fprintf ppf "@[<v4>module %s = %a@]" 
   include Annot
 
   let format ppf = function
-    | Type typ -> 
+    | Type (typ, _env) -> 
 	Printtyp.reset ();
 	Printtyp.mark_loops typ;
         (* CR jfuruse: not fancy having @. *)
         fprintf ppf "Non_expansive: %b" b
 
   let summary ppf = function
-    | Type _typ -> 
+    | Type (_typ, _env) -> 
         (* CR jfuruse: not fancy having @. *)
 	fprintf ppf "Type: ...@ ";
 	fprintf ppf "XType: ..."
 module RAnnot = struct
   open Regioned
 
-  type t = Annot.t Regioned.t
+  type t      = Annot.t Regioned.t
   let split   = Regioned.split
   let compare = Regioned.compare
   let format  = Regioned.format Annot.format

ocamlspot/spotapi.mli

 
   and structure_item = Spot.Abstraction.structure_item =
       | Str_value     of Ident.t
-      | Str_type      of Ident.t * Types.type_declaration
+      | Str_type      of Ident.t
       | Str_exception of Ident.t
       | Str_module    of Ident.t * module_expr
       | Str_modtype   of Ident.t * module_expr
 module Annot : sig
 
   type t = Spot.Annot.t =
-      | Type of Types.type_expr
-      | Str of Abstraction.structure_item
-      | Use of Kind.t * Path.t
-      | Module of Abstraction.module_expr
+      | Type              of Types.type_expr * Env.t
+      | Str               of Abstraction.structure_item
+      | Use               of Kind.t * Path.t
+      | Module            of Abstraction.module_expr
       | Functor_parameter of Ident.t
-      | Non_expansive of bool
-      | Mod_type of Types.module_type
+      | Non_expansive     of bool
+      | Mod_type          of Types.module_type
 
   val record : Location.t -> t -> unit
   val record_constr_type_use : Location.t -> Types.type_expr -> unit

ocamlspot/spoteval.ml

     List.fold_left (fun str sitem ->
       match sitem with
       | Str_value id 
-      | Str_type (id, _) (* CR jfuruse: correct? *)
+      | Str_type id
       | Str_exception id
       | Str_class id
       | Str_cltype id ->

ocamlspot/spotfile.ml

         List.iter (fun { Regioned.region = loc; value = annot } ->
           match annot with
           | Annot.Str ( Abstraction.Str_value id
-                      | Abstraction.Str_type (id, _) (* CR jfuruse: ? *)
+                      | Abstraction.Str_type id
                       | Abstraction.Str_exception id
                       | Abstraction.Str_modtype (id, _)
                       | Abstraction.Str_class id