Permalink
Browse files

Performed necessary changes in browser w.r.t. located lids and paths

  • Loading branch information...
1 parent 6b50d4e commit 5b7529f22e7e06d7288b8df6d68442a99c4a15ce @tturpin tturpin committed Jul 2, 2011
View
BIN boot/ocamlc
Binary file not shown.
View
BIN boot/ocamldep
Binary file not shown.
View
6 ocamlwizard/owz.sh
@@ -1,6 +0,0 @@
-#!/bin/sh
-OWZ=owz.opt
-PROJECT_DIR=`$OWZ -find-project-dir $*`
-echo ocamlwizard $* >$PROJECT_DIR/.ocamlwizard-stderr
-OCAMLLIB=/usr/local/lib/ocaml $OWZ -debug -backtrace $* \
-2>>$PROJECT_DIR/.ocamlwizard-stderr | tee $PROJECT_DIR/.ocamlwizard-stdout
View
18 otherlibs/labltk/browser/searchid.ml
@@ -267,7 +267,7 @@ let search_all_types t ~mode =
in List2.flat_map !module_list ~f:
begin fun modname ->
let mlid = Lident modname in
- try match lookup_module mlid initial with
+ try match lookup_module_lid mlid initial with
_, Mty_signature sign ->
List2.flat_map tl
~f:(search_type_in_signature ~sign ~prefix:[modname] ~mode)
@@ -349,7 +349,7 @@ let search_pattern_symbol text =
let check i = check_match ~pattern (explode (Ident.name i)) in
let l = List.map !module_list ~f:
begin fun modname -> Lident modname,
- try match lookup_module (Lident modname) initial with
+ try match lookup_module_lid (Lident modname) initial with
_, Mty_signature sign ->
List2.flat_map sign ~f:
begin function
@@ -394,13 +394,13 @@ let search_string_symbol text =
try let _ = f lid Env.initial in [lid, k]
with Not_found | Env.Error _ -> []
in
- try_lookup lookup_constructor Pconstructor @
- try_lookup lookup_module Pmodule @
- try_lookup lookup_modtype Pmodtype @
- try_lookup lookup_value Pvalue @
- try_lookup lookup_type Ptype @
- try_lookup lookup_label Plabel @
- try_lookup lookup_class Pclass
+ try_lookup lookup_constructor_lid Pconstructor @
+ try_lookup lookup_module_lid Pmodule @
+ try_lookup lookup_modtype_lid Pmodtype @
+ try_lookup lookup_value_lid Pvalue @
+ try_lookup lookup_type_lid Ptype @
+ try_lookup lookup_label_lid Plabel @
+ try_lookup lookup_class_lid Pclass
open Parsetree
View
8 otherlibs/labltk/browser/searchid.mli
@@ -16,7 +16,7 @@
val start_env : Env.t ref
val module_list : string list ref
-val longident_of_path : Path.t ->Longident.t
+val longident_of_path : Path.t ->Longident.lid
type pkind =
Pvalue
@@ -33,9 +33,9 @@ val string_of_kind : pkind -> string
exception Error of int * int
val search_string_type :
- string -> mode:[`Exact|`Included] -> (Longident.t * pkind) list
-val search_pattern_symbol : string -> (Longident.t * pkind) list
-val search_string_symbol : string -> (Longident.t * pkind) list
+ string -> mode:[`Exact|`Included] -> (Longident.lid * pkind) list
+val search_pattern_symbol : string -> (Longident.lid * pkind) list
+val search_string_symbol : string -> (Longident.lid * pkind) list
val search_structure :
Parsetree.structure ->
View
44 otherlibs/labltk/browser/searchpos.ml
@@ -97,7 +97,7 @@ end
type skind = [`Type|`Class|`Module|`Modtype]
-let found_sig = ref ([] : ((skind * Longident.t) * Env.t * Location.t) list)
+let found_sig = ref ([] : ((skind * Longident.lid) * Env.t * Location.t) list)
let add_found_sig = add_found ~found:found_sig
let rec search_pos_type t ~pos ~env =
@@ -118,7 +118,7 @@ let rec search_pos_type t ~pos ~env =
List.iter tl ~f:(search_pos_type ~pos ~env)
| Ptyp_constr (lid, tl) ->
List.iter tl ~f:(search_pos_type ~pos ~env);
- add_found_sig (`Type, lid) ~env ~loc:t.ptyp_loc
+ add_found_sig (`Type, lid.lid) ~env ~loc:t.ptyp_loc
| Ptyp_object fl ->
List.iter fl ~f:
begin function
@@ -127,7 +127,7 @@ let rec search_pos_type t ~pos ~env =
end
| Ptyp_class (lid, tl, _) ->
List.iter tl ~f:(search_pos_type ~pos ~env);
- add_found_sig (`Type, lid) ~env ~loc:t.ptyp_loc
+ add_found_sig (`Type, lid.lid) ~env ~loc:t.ptyp_loc
| Ptyp_alias (t, _)
| Ptyp_poly (_, t) -> search_pos_type ~pos ~env t
| Ptyp_package (_, stl) ->
@@ -138,7 +138,7 @@ let rec search_pos_class_type cl ~pos ~env =
if in_loc cl.pcty_loc ~pos then
begin match cl.pcty_desc with
Pcty_constr (lid, _) ->
- add_found_sig (`Class, lid) ~env ~loc:cl.pcty_loc
+ add_found_sig (`Class, lid.lid) ~env ~loc:cl.pcty_loc
| Pcty_signature { pcsig_fields = cfl } ->
List.iter cfl ~f:
begin function pctf ->
@@ -191,7 +191,7 @@ let rec search_pos_signature l ~pos ~env =
Psig_open id ->
let path, mt = lookup_module id env in
begin match mt with
- Mty_signature sign -> open_signature path sign env
+ Mty_signature sign -> open_signature path.path sign env
| _ -> env
end
| sign_item ->
@@ -221,7 +221,7 @@ let rec search_pos_signature l ~pos ~env =
List.iter l
~f:(fun ci -> search_pos_class_type ci.pci_expr ~pos ~env)
(* The last cases should not happen in generated interfaces *)
- | Psig_open lid -> add_found_sig (`Module, lid) ~env ~loc:pt.psig_loc
+ | Psig_open lid -> add_found_sig (`Module, lid.lid) ~env ~loc:pt.psig_loc
| Psig_include t -> search_pos_module t ~pos ~env
end;
env
@@ -230,7 +230,7 @@ let rec search_pos_signature l ~pos ~env =
and search_pos_module m ~pos ~env =
if in_loc m.pmty_loc ~pos then begin
begin match m.pmty_desc with
- Pmty_ident lid -> add_found_sig (`Modtype, lid) ~env ~loc:m.pmty_loc
+ Pmty_ident lid -> add_found_sig (`Modtype, lid.lid) ~env ~loc:m.pmty_loc
| Pmty_signature sg -> search_pos_signature sg ~pos ~env
| Pmty_functor (_ , m1, m2) ->
search_pos_module m1 ~pos ~env;
@@ -449,7 +449,7 @@ and view_module path ~env =
view_signature_item [Sig_module (id, modtype, Trec_not)] ~path ~env
and view_module_id id ~env =
- let path, _ = lookup_module id env in
+ let path, _ = lookup_module_lid id env in
view_module path ~env
and view_type_decl path ~env =
@@ -467,23 +467,23 @@ and view_type_decl path ~env =
[Sig_type(ident_of_path path ~default:"t", td, Trec_first)]
and view_type_id li ~env =
- let path, decl = lookup_type li env in
+ let path, decl = lookup_type_lid li env in
view_type_decl path ~env
and view_class_id li ~env =
- let path, cl = lookup_class li env in
+ let path, cl = lookup_class_lid li env in
view_signature_item ~path ~env
[Sig_class(ident_of_path path ~default:"c", cl, Trec_first);
dummy_item; dummy_item; dummy_item]
and view_cltype_id li ~env =
- let path, clt = lookup_cltype li env in
+ let path, clt = lookup_cltype_lid li env in
view_signature_item ~path ~env
[Sig_class_type(ident_of_path path ~default:"ct", clt, Trec_first);
dummy_item; dummy_item]
and view_modtype_id li ~env =
- let path, td = lookup_modtype li env in
+ let path, td = lookup_modtype_lid li env in
view_signature_item ~path ~env
[Sig_modtype(ident_of_path path ~default:"S", td)]
@@ -509,10 +509,10 @@ and view_decl lid ~kind ~env =
and view_decl_menu lid ~kind ~env ~parent =
let path, kname =
try match kind with
- `Type -> fst (lookup_type lid env), "Type"
- | `Class -> fst (lookup_class lid env), "Class"
- | `Module -> fst (lookup_module lid env), "Module"
- | `Modtype -> fst (lookup_modtype lid env), "Module type"
+ `Type -> fst (lookup_type_lid lid env), "Type"
+ | `Class -> fst (lookup_class_lid lid env), "Class"
+ | `Module -> fst (lookup_module_lid lid env), "Module"
+ | `Modtype -> fst (lookup_modtype_lid lid env), "Module type"
with Env.Error _ -> raise Not_found
in
let menu = Menu.create parent ~tearoff:false in
@@ -713,7 +713,7 @@ and search_pos_class_expr ~pos cl =
if in_loc cl.cl_loc ~pos then begin
begin match cl.cl_desc with
Tcl_ident (path, _) ->
- add_found_str (`Class (path, cl.cl_type))
+ add_found_str (`Class (path.path, cl.cl_type))
~env:!start_env ~loc:cl.cl_loc
| Tcl_structure cls ->
search_pos_class_structure ~pos cls
@@ -743,7 +743,7 @@ and search_pos_expr ~pos exp =
if in_loc exp.exp_loc ~pos then begin
begin match exp.exp_desc with
Texp_ident (path, _) ->
- add_found_str (`Exp(`Val path, exp.exp_type))
+ add_found_str (`Exp(`Val path.path, exp.exp_type))
~env:exp.exp_env ~loc:exp.exp_loc
| Texp_constant v ->
add_found_str (`Exp(`Const, exp.exp_type))
@@ -804,14 +804,14 @@ and search_pos_expr ~pos exp =
search_pos_expr a ~pos; search_pos_expr b ~pos
| Texp_send (exp, _, _) -> search_pos_expr exp ~pos
| Texp_new (path, _) ->
- add_found_str (`Exp(`New path, exp.exp_type))
+ add_found_str (`Exp(`New path.path, exp.exp_type))
~env:exp.exp_env ~loc:exp.exp_loc
| Texp_instvar (_,path) ->
- add_found_str (`Exp(`Var path, exp.exp_type))
+ add_found_str (`Exp(`Var path.path, exp.exp_type))
~env:exp.exp_env ~loc:exp.exp_loc
| Texp_setinstvar (_, path, exp) ->
search_pos_expr exp ~pos;
- add_found_str (`Exp(`Var path, exp.exp_type))
+ add_found_str (`Exp(`Var path.path, exp.exp_type))
~env:exp.exp_env ~loc:exp.exp_loc
| Texp_override (_, l) ->
List.iter l ~f:(fun (_, exp) -> search_pos_expr exp ~pos)
@@ -868,7 +868,7 @@ and search_pos_module_expr ~pos m =
if in_loc m.mod_loc ~pos then begin
begin match m.mod_desc with
Tmod_ident path ->
- add_found_str (`Module (path, m.mod_type))
+ add_found_str (`Module (path.path, m.mod_type))
~env:m.mod_env ~loc:m.mod_loc
| Tmod_structure str -> search_pos_structure str ~pos
| Tmod_functor (_, _, m) -> search_pos_module_expr m ~pos
View
20 otherlibs/labltk/browser/searchpos.mli
@@ -31,7 +31,7 @@ val is_shown_module : Path.t -> bool
val default_frame : module_widgets option ref
val set_path : (Path.t -> sign:Types.signature -> unit) ref
-val view_defined_ref : (Longident.t -> env:Env.t -> unit) ref
+val view_defined_ref : (Longident.lid -> env:Env.t -> unit) ref
val editor_ref :
(?file:string -> ?pos:int -> ?opendialog:bool -> unit -> unit) ref
@@ -40,20 +40,20 @@ val view_signature :
?path:Path.t -> ?env:Env.t -> ?detach:bool -> Types.signature -> unit
val view_signature_item :
Types.signature -> path:Path.t -> env:Env.t -> unit
-val view_module_id : Longident.t -> env:Env.t -> unit
-val view_type_id : Longident.t -> env:Env.t -> unit
-val view_class_id : Longident.t -> env:Env.t -> unit
-val view_cltype_id : Longident.t -> env:Env.t -> unit
-val view_modtype_id : Longident.t -> env:Env.t -> unit
+val view_module_id : Longident.lid -> env:Env.t -> unit
+val view_type_id : Longident.lid -> env:Env.t -> unit
+val view_class_id : Longident.lid -> env:Env.t -> unit
+val view_cltype_id : Longident.lid -> env:Env.t -> unit
+val view_modtype_id : Longident.lid -> env:Env.t -> unit
val view_type_decl : Path.t -> env:Env.t -> unit
type skind = [`Type|`Class|`Module|`Modtype]
val search_pos_signature :
Parsetree.signature -> pos:int -> env:Env.t ->
- ((skind * Longident.t) * Env.t * Location.t) list
-val view_decl : Longident.t -> kind:skind -> env:Env.t -> unit
+ ((skind * Longident.lid) * Env.t * Location.t) list
+val view_decl : Longident.lid -> kind:skind -> env:Env.t -> unit
val view_decl_menu :
- Longident.t ->
+ Longident.lid ->
kind:skind -> env:Env.t -> parent:text widget -> menu widget
type fkind = [
@@ -73,5 +73,5 @@ val view_type_menu : fkind -> env:Env.t -> parent:'a widget -> menu widget
val parent_path : Path.t -> Path.t option
val string_of_path : Path.t -> string
-val string_of_longident : Longident.t -> string
+val string_of_longident : Longident.lid -> string
val lines_to_chars : int -> text:string -> int
View
12 otherlibs/labltk/browser/viewer.ml
@@ -60,16 +60,16 @@ let view_symbol ~kind ~env ?path id =
in
match kind with
Pvalue ->
- let path, vd = lookup_value id env in
+ let path, vd = lookup_value_lid id env in
view_signature_item ~path ~env [Sig_value (Ident.create name, vd)]
| Ptype -> view_type_id id ~env
- | Plabel -> let (_path, ld) = lookup_label id env in
+ | Plabel -> let (_path, ld) = lookup_label_lid id env in
begin match ld.lbl_res.desc with
Tconstr (path, _, _) -> view_type_decl path ~env
| _ -> ()
end
| Pconstructor ->
- let (_path, cd) = lookup_constructor id env in
+ let (_path, cd) = lookup_constructor_lid id env in
begin match cd.cstr_res.desc with
Tconstr (cpath, _, _) ->
if Path.same cpath Predef.path_exn then
@@ -120,7 +120,7 @@ let choose_symbol ~title ~env ?signature ?path l =
match path, li with
None, Ldot (lip, _) ->
begin try
- Some (fst (lookup_module lip env))
+ Some (fst (lookup_module_lid lip env))
with Not_found -> None
end
| _ -> path
@@ -226,7 +226,7 @@ let ident_of_decl ~modlid = function
| Sig_class_type (id, _, _) -> Lident (Ident.name id), Pcltype
let view_defined ~env ?(show_all=false) modlid =
- try match lookup_module modlid env with path, Mty_signature sign ->
+ try match lookup_module_lid modlid env with path, Mty_signature sign ->
let rec iter_sign sign idents =
match sign with
[] -> List.rev idents
@@ -602,7 +602,7 @@ object (self)
match path, li with
None, Ldot (lip, _) ->
begin try
- Some (fst (lookup_module lip env))
+ Some (fst (lookup_module_lid lip env))
with Not_found -> None
end
| _ -> path
View
2 otherlibs/labltk/browser/viewer.mli
@@ -25,7 +25,7 @@ val f : ?dir:string -> ?on:toplevel widget -> unit -> unit
val st_viewer : ?dir:string -> ?on:toplevel widget -> unit -> unit
(* one-box viewer *)
-val view_defined : env:Env.t -> ?show_all:bool -> Longident.t -> unit
+val view_defined : env:Env.t -> ?show_all:bool -> Longident.lid -> unit
(* displays a signature, found in environment *)
val close_all_views : unit -> unit

0 comments on commit 5b7529f

Please sign in to comment.