Commits

camlspotter committed 7f3aaf8 Merge

merge

  • Participants
  • Parent commits 29c1449, 1904069
  • Branches custom

Comments (0)

Files changed (15)

File INSTALL-ocamlspot.txt

 
   ; load-path
   (setq load-path (cons "WHERE-YOU-HAVE-INSTALLED-THE-ELISP" load-path))
- 
+
   ; set the path of the ocamlspot binary
   (setq ocamlspot-path "WHERE-YOU-HAVE-INSTALLED-THE-BINARIES/ocamlspot")
- 
+
   ; autoload
   (autoload 'ocamlspot-query "ocamlspot" "OCamlSpot")
- 
+
   ; tuareg mode hook (use caml-mode-hook instead if you use caml-mode)
-    (add-hook 'tuareg-mode-hook 
-    	  '(lambda ()
+  (add-hook 'tuareg-mode-hook
+  	  '(lambda ()
   	     (local-set-key "\C-c;" 'ocamlspot-query)
   	     (local-set-key "\C-c\C-t" 'ocamlspot-type)
              (local-set-key "\C-c\C-y" 'ocamlspot-type-and-copy)
   	     (local-set-key "\C-c\C-u" 'ocamlspot-use)
   	     (local-set-key "\C-ct" 'caml-types-show-type)))
- 
+
 10. How to use
 
-  Compiler your ML project by this patched compiler with -annot option to create .spot files. Open one of the source files in Emacs and place the cursor at the name whose definition is in question. Type C-c; will show you the defintion.
+  Compile your ML project by this patched compiler with -annot option to create .spot files. Open one of the source files in Emacs and place the cursor at the name whose definition is in question. Type C-c; will show you the defintion.
 
 11. bug report
 

File README-ocamlspot.txt

 ====================================
 
   Camel spotter: Oh, it was extremely interesting, very, very -
-    quite... it was dull; dull, dull, dull, oh God it was dull. 
-    Sitting in the Waterloo waiting room. ...
+  quite... it was dull; dull, dull, dull, oh God it was dull. 
+  Sitting in the Waterloo waiting room. ...
 
                                      from You're No Fun Anymore, 
                                     Monty Python's Flying Circus
 You first days after joining a large OCaml project should be this kind
 of manual value definition spotting with find + grep commands. Yes,
 actually it is very educational: you can learn a lot about the project
-struggling in the source tree (only if your collegues have organized
+struggling in the source tree (only if your colleagues have organized
 things very well :-P), but it is still a dull job...
 
 To say short, OCamlSpotter is a tool which does this dull job
 automatically for you and permits your energy for something more
 "interesting" like Yeti spotting:
 
+===============================
+Summary
+===============================
+
  - The -annot option of ocamlc and ocamlopt is extended and creates 
    <module>.spot files (<module>.spit for .mli), which record the
    location information of the names defined and used in the module.
  - ocamlspot.el provides interactive ocaml-spotting of definition 
    locations in emacs.
 
- - Interfaces for other editors such as vi can be built easily, if you
-   want. I do not want.
+ - Interfaces for other editors such as Vim can be built easily.
+   A small sample for Vim is available (ocamlspot.vim).
    
+===============================
+ocamlc compiler modifications
+===============================
+
+ - The -annot option of ocamlc and ocamlopt is extended and creates 
+   <module>.spot files (<module>.spit for .mli), which record the
+   location information of the names defined and used in the module.
+
+ - Existence of OCAML_ANNOT environment variable turns on .annot, .spot
+   and .spit file creation, even without -annot option to the compiler.
+   It is good for compiling OCaml softwares with .spot+.spit files without
+   modifying Makefiles.
+
+===============================
+ocamlspot query application
+===============================
+
+
 Compilation information
 ===============================
 
 
       Retrieve various annotation information from .spot or .spit files
       of the source code position or identifier, specified by the
-      search spec. Information is prited to stdout. They are:
+      search spec. Information is printed to stdout. They are:
 
       Spot: file:pos
           The definition position of the object which the search spec
       XType: type     
           The type of the object which the search spec points to, if
           available. In XType, paths are printed with position
-          informaiton: for example, "unit__6" instead of "unit".
+          information: for example, "unit__6" instead of "unit".
 
       Use: kind, name
           The kind and the name with id numbers of the identifier 
           i.e. types, paths, etc.
 
 
+Value usage analysis (Experimental)
+===================================
+
+SYNOPSIS
+
+      ocamlspot use [search] [target files and dirs]
+            search ::= [file]:[pos] | [file]:[kind]:[path]
+            pos ::= l[line]c[column_bytes] | b[bytes] | [bytes]
+            kind ::= v|t|e|m|mt|c|ct
+            
+            where
+              v  : value
+	      t  : type
+	      e  : exception
+	      m  : module
+	      mt : module type
+	      c  : class
+	      ct : class type
+
+DESCRIPTION
+
+      ocamlspot use does opposite of ocamlspot query: search the uses of
+      the identifier specified by the search spec.
+
+      After the search spec, the search target path names can be specified.
+      If a target is a directory, the search is performed recursively
+      in the directory.
+
+Spot creation w/o real compilation
+==================================
+
+SYNOPSIS
+
+      ocamlspot typecheck <args>
+      ocamlspot recheck <targets>
+
+DESCRIPTION
+
+      ocamlspot typecheck <args> is as same as ocamlc <args>, but it does
+      not create object files but only .annot/.spot/.spit files 
+      independently. Useful if you want to stick to the official OCaml 
+      compiler to create object files.
+
+      ocamlspot recheck <targets> redos the typecheck and creation of
+      .annot/.spot/.spit files using the compilation information already
+      stored in .spot/.spit files.
+
+===============================
+ocamlspot.el emacs interface
+===============================
+
+...
+
+=====================
 Bugs and future works
 =====================
 
 This software contain lots of bugs and todos.
 
+=======
 License
 =======
 
 Read LICENSE file in this directory. 
 
+======
 Author
 ======
 
   Jun FURUSE (jun.furuse@gmail.com). Bug reports and comments are
   welcome. Patches are appreciated. Donating camel related gadgets is
-  the most wonderful. Complaints might be simply ignored.
+  the most wonderful.

File boot/ocamlc

Binary file modified.

File boot/ocamldep

Binary file modified.

File boot/ocamllex

Binary file modified.

File ocamlspot/Makefile

 # Various commands and dir
 ##########################
 CAMLRUN=../boot/ocamlrun
-OCAMLC   = ../ocamlcomp.sh -annot -w Ae -warn-error Ae-31
+OCAMLC   = ../ocamlcomp.sh -annot -w Ae -warn-error Ae
 OCAMLOPT = ../ocamlcompopt.sh
 OCAMLDEP = $(CAMLRUN) ../tools/ocamldep
 OCAMLLEX = $(CAMLRUN) ../boot/ocamllex

File ocamlspot/ocamlspot.el

File contents unchanged.

File ocamlspot/ocamlspot.ml

File contents unchanged.

File ocamlspot/pathreparse.ml

 
 open Spotapi
 
-open Parsetree
-open Lexing
-
 open Path
 
 open Locident

File ocamlspot/spotapi.mli

 module Printtyp : sig
   open Format
 
-  open Types
-
   val reset : unit -> unit
   val mark_loops : Types.type_expr -> unit
   val reset_names : unit -> unit

File ocamlspot/spotconfig.ml

File contents unchanged.

File ocamlspot/tests_use/.depend

+dummy.cmi:
+test1.cmo:
+test1.cmx:
+test2.cmo: test1.cmo
+test2.cmx: test1.cmx

File ocamlspot/tests_use/Makefile

 beforedepend::
 
 depend: beforedepend
-	$(CAMLRUN) ../../tools/ocamldep $(INCLUDES) -I dir1 -I dir2 *.mli *.ml */*.mli */*.ml > .depend
+	$(CAMLRUN) ../../tools/ocamldep $(INCLUDES) *.mli *.ml */*.mli */*.ml > .depend
 
 Makefile.targets: *.ml *.mli
 	echo TARGETS= \\ > $@

File ocamlspot/tests_use/dummy.mli

Empty file added.

File ocamlspot/typeexpand.mli

 
 (* expansion of expr/pattern by type *)
 
-open Asttypes
 open Types
 
 type t