Commits

camlspotter committed 6b6120d

Str => Str_item

  • Participants
  • Parent commits bb86b10

Comments (0)

Files changed (3)

File ocamlspot.ml

 	(* Find the innermost module *)
         let find_module_path treepath = List.concat_map (fun { Regioned.value = annots } ->
           List.filter_map (function 
-            | Annot.Str (Abstraction.AStr_module (id, _)) -> Some id
+            | Annot.Str_item (Abstraction.AStr_module (id, _)) -> Some id
             | _ -> None) annots) treepath
         in
         printf "In_module: %s@."
 	file.Unit.path 
 	(Position.to_string pos);
       match List.find_map_opt (function 
-	| Annot.Str str_item -> 
+	| Annot.Str_item str_item -> 
 	    Some (`Def (Abstraction.ident_of_structure_item str_item))
 	| Annot.Use (kind, path) -> Some (`Use (kind, path))
 	| _ -> None) (query_by_pos file file.Unit.path pos)
     | Use               of Kind.t * Path.t
     | Type              of Types.type_expr * Env.t * [`Expr of Path.t option | `Pattern of Ident.t option ]
     | Mod_type          of Types.module_type
-    | Str               of Abstraction.structure_item  (* CRjfuruse: Should be Sitem *)
+    | Str_item          of Abstraction.structure_item
     | Module            of Abstraction.module_expr
     | Functor_parameter of Ident.t
     | Non_expansive     of bool
   let equal t1 t2 = match t1, t2 with
     | Type (t1, _, _), Type (t2, _, _) -> t1 == t2
     | Mod_type mty1, Mod_type mty2 -> mty1 == mty2
-    | Str sitem1, Str sitem2 -> Abstraction.Structure_item.equal sitem1 sitem2
+    | Str_item sitem1, Str_item sitem2 -> Abstraction.Structure_item.equal sitem1 sitem2
     | Module mexp1, Module mexp2 -> mexp1 == mexp2
     | Use (k1,p1), Use (k2,p2) -> k1 = k2 && p1 = p2
     | Non_expansive b1, Non_expansive b2 -> b1 = b2
     | Functor_parameter id1, Functor_parameter id2 -> id1 = id2
-    | (Type _ | Str _ | Module _ | Functor_parameter _ | Use _ | Non_expansive _
+    | (Type _ | Str_item _ | Module _ | Functor_parameter _ | Use _ | Non_expansive _
           | Mod_type _),
-      (Type _ | Str _ | Module _ | Functor_parameter _ | Use _ | Non_expansive _
+      (Type _ | Str_item _ | Module _ | Functor_parameter _ | Use _ | Non_expansive _
           | Mod_type _) -> false
 
   module Record = struct
 
     class fold tbl =
       let record = record tbl in
-      let record_def loc sitem = record loc (Str sitem)
+      let record_def loc sitem = record loc (Str_item sitem)
       and record_use loc kind path = record loc (Use (kind, path)) in
     object
       inherit Ttfold.fold as super
     | Mod_type mty ->
 	fprintf ppf "Type: %a@ " (Printtyp.modtype ~with_pos:false) mty;
 	fprintf ppf "XType: %a" (Printtyp.modtype ~with_pos:true) mty
-    | Str str ->
-	fprintf ppf "Str: %a"
+    | Str_item str ->
+	fprintf ppf "Str_item: %a"
 	  Abstraction.format_structure_item str
     | Use (use, path) ->
 	fprintf ppf "Use: %s, %s"
     | Mod_type _mty ->
 	fprintf ppf "Type: ...@ ";
 	fprintf ppf "XType: ..."
-    | Str _str ->
-	fprintf ppf "Str: ..."
+    | Str_item _str ->
+	fprintf ppf "Str_item: ..."
     | Use (use, path) ->
 	fprintf ppf "Use: %s, %s"
 	  (String.capitalize (Kind.name use)) (Path.name path)
       let tbl = Hashtbl.create 1023 in
       Hashtbl.iter (fun loc annots ->
         List.iter (function
-          | Annot.Str sitem ->
+          | Annot.Str_item sitem ->
               let _kind,id = Abstraction.ident_of_structure_item sitem in
               Hashtbl.add tbl id (Region.of_parsing f.F.builddir loc)
           | _ -> ()) annots) loc_annots;
     (* CR jfuruse: it is almost the same as id_def_regions_list *)
     let flat = lazy (Hashtbl.fold (fun _loc annots st ->
       List.filter_map (function
-        | Annot.Str sitem -> Some sitem
+        | Annot.Str_item sitem -> Some sitem
         | _ -> None) annots @ st) loc_annots [])
     in
     { modname    = f.F.modname;
     | Use of Kind.t * Path.t
     | Type of Types.type_expr * Env.t * [`Expr of Path.t option | `Pattern of Ident.t option ]
     | Mod_type of Types.module_type
-    | Str of Abstraction.structure_item 
+    | Str_item of Abstraction.structure_item 
     | Module of Abstraction.module_expr
     | Functor_parameter of Ident.t
     | Non_expansive of bool