Imported Upstream version 3.08.1
authorSven Luther <luther@debian.org>
Thu, 19 Aug 2004 15:12:25 +0000 (15:12 +0000)
committerSven Luther <luther@debian.org>
Thu, 19 Aug 2004 15:12:25 +0000 (15:12 +0000)
59 files changed:
Changes
LICENSE
Makefile
asmcomp/asmpackager.ml
boot/ocamlc
boot/ocamllex
byterun/.cvsignore
byterun/Makefile
byterun/dynlink.c
byterun/dynlink.h
byterun/obj.c
byterun/osdeps.h
byterun/unix.c
camlp4/camlp4/Makefile
camlp4/config/configure_batch
camlp4/etc/pa_o.ml
camlp4/lib/Makefile
camlp4/lib/plexer.ml
camlp4/man/camlp4.1.tpl
camlp4/ocaml_src/camlp4/Makefile
camlp4/ocaml_src/lib/Makefile
camlp4/ocaml_src/lib/plexer.ml
camlp4/ocaml_src/meta/Makefile
camlp4/ocaml_src/odyl/.depend
camlp4/ocaml_src/odyl/Makefile
camlp4/odyl/Makefile
configure
emacs/COPYING [new file with mode: 0644]
emacs/Makefile
emacs/caml-compat.el
emacs/caml-emacs.el
emacs/caml-font.el
emacs/caml-help.el
emacs/caml-hilit.el
emacs/caml-types.el
emacs/caml-xemacs.el
emacs/caml.el
emacs/camldebug.el
emacs/inf-caml.el
emacs/ocamltags.in
lex/main.ml
ocamldoc/Changes.txt
ocamldoc/odoc_analyse.ml
ocamldoc/odoc_analyse.mli
ocamldoc/odoc_args.ml
ocamldoc/odoc_args.mli
ocamldoc/odoc_html.ml
ocamldoc/odoc_info.ml
ocamldoc/odoc_info.mli
ocamldoc/odoc_latex.ml
ocamldoc/odoc_messages.ml
ocamldoc/odoc_misc.ml
ocamldoc/odoc_misc.mli
ocamldoc/odoc_str.ml
ocamldoc/odoc_str.mli
ocamldoc/odoc_to_text.ml
stdlib/hashtbl.mli
stdlib/sys.ml
win32caml/ocaml.c

diff --git a/Changes b/Changes
index 1d26ffcb3a92df83b8ae1a714313ff2bc7af9db7..c8c2fd74a0ea1cb6ab21f0a0789d6bf9bf316864 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,30 @@
-Objective Caml 3.08:
---------------------
+Objective Caml 3.08.1:
+----------------------
+
+Licence:
+- The emacs files are now under GPL
+- Slightly relaxed some conditions of the QPL
+
+Bug fixes:
+- ld.conf now generated at compile-time instead of install-time
+- fixed -pack on Windows XP (PR#2935)
+- fixed Obj.tag (PR#2946)
+- added support for multiple dlopen in Darwin
+- run ranlib when installing camlp4 libraries (PR#2944)
+- link camlp4opt with -linkall (PR#2949)
+- camlp4 parsing of patterns now conforms to normal parsing (PR#3015)
+- install camlp4 *.cmx files (PR#2955)
+- fixed handling of linefeed in string constants in camlp4 (PR#3074)
+- ocamldoc: fixed display of class parameters in HTML and LaTeX (PR#2994)
+- ocamldoc: fixed display of link to class page in html (PR#2994)
+- Windows toplevel GUI: assorted fixes (including PR#2932)
+
+Misc:
+- added -v option to ocamllex
+- ocamldoc: new -intf and -impl options supported (PR#3036)
+
+Objective Caml 3.08.0:
+----------------------
 
 (Changes that can break existing programs are marked with a "*"  )
 
@@ -1758,4 +1783,4 @@ Caml Special Light 1.06:
 
 * First public release.
 
-$Id: Changes,v 1.140.2.3 2004/07/05 07:24:00 xleroy Exp $
+$Id: Changes,v 1.140.2.4 2004/08/19 12:52:17 doligez Exp $
diff --git a/LICENSE b/LICENSE
index bd3dbe83e412e2625e50cbb66737f7c27f50ff72..fce2fad28cf988c43ed6ffda31e6035ae1688b76 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,17 +1,26 @@
 In the following, "the Library" refers to all files marked "Copyright
 INRIA" in the following directories and their sub-directories:
 
-  asmrun, byterun, camlp4, config, maccaml, otherlibs, stdlib, win32caml
+  asmrun, byterun, camlp4, config, otherlibs, stdlib, win32caml
 
 and "the Compiler" refers to all files marked "Copyright INRIA" in the
-other directories and their sub-directories.
+following directories and their sub-directories:
+
+  asmcomp, boot, bytecomp, debugger, driver, lex, ocamldoc, parsing,
+  tools, toplevel, typing, utils, yacc
 
 The Compiler is distributed under the terms of the Q Public License
-version 1.0 (included below).
+version 1.0 with a change to choice of law (included below).
 
 The Library is distributed under the terms of the GNU Library General
 Public License version 2 (included below).
 
+As a special exception to the Q Public Licence, you may develop
+application programs, reusable components and other software items
+that link with the original or modified versions of the Compiler
+and are not made available to the general public, without any of the
+additional requirements listed in clause 6c of the Q Public licence.
+
 As a special exception to the GNU Library General Public License, you
 may link, statically or dynamically, a "work that uses the Library"
 with a publicly distributed version of the Library to produce an
@@ -129,8 +138,7 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
                             Choice of Law
 
-This license is governed by the Laws of France. Disputes shall be
-settled by the Court of Versailles.
+This license is governed by the Laws of France.
 
 ----------------------------------------------------------------------
 
index 7a368ecbde9b96e19416158ef11dc314513b7636..0905016876ed254b9c8a006b854de8cd127d2b3d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile,v 1.186.2.3 2004/07/02 12:19:18 mauny Exp $
+# $Id: Makefile,v 1.186.2.4 2004/07/16 16:11:33 doligez Exp $
 
 # The main Makefile
 
@@ -234,14 +234,12 @@ opt.opt: checkstack core ocaml opt-core ocamlc.opt otherlibraries camlp4out \
 install: FORCE
        if test -d $(BINDIR); then : ; else $(MKDIR) $(BINDIR); fi
        if test -d $(LIBDIR); then : ; else $(MKDIR) $(LIBDIR); fi
-       if test -d $(STUBLIBDIR); then : ; else $(MKDIR) $(LIBDIR)/stublibs; fi
+       if test -d $(STUBLIBDIR); then : ; else $(MKDIR) $(STUBLIBDIR); fi
        if test -d $(MANDIR)/man$(MANEXT); then : ; else $(MKDIR) $(MANDIR)/man$(MANEXT); fi
        cd $(LIBDIR); rm -f dllbigarray.so dlllabltk.so dllnums.so \
           dllthreads.so dllunix.so dllgraphics.so dllmldbm.so dllstr.so \
           dlltkanim.so
        cd byterun; $(MAKE) install
-       echo "$(STUBLIBDIR)" > $(LIBDIR)/ld.conf
-       echo "$(LIBDIR)" >> $(LIBDIR)/ld.conf
        cp ocamlc $(BINDIR)/ocamlc$(EXE)
        cp ocaml $(BINDIR)/ocaml$(EXE)
        cd stdlib; $(MAKE) install
index ea2db5d98bc7b8dc80ea84849a86b1e0c812f5a8..2617de5a60b5162c17be64c9b3222f7e876c3b7d 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: asmpackager.ml,v 1.14 2004/05/26 11:10:27 garrigue Exp $ *)
+(* $Id: asmpackager.ml,v 1.14.4.1 2004/08/10 12:16:47 xleroy Exp $ *)
 
 (* "Package" a set of .cmx/.o files into one .cmx/.o file having the
    original compilation units as sub-modules. *)
@@ -122,6 +122,13 @@ let prefix_symbol p s =
     "caml" ^ p ^ "__" ^ String.sub s 4 (String.length s - 4)
   end
 
+(* Strip leading _ from a low-level ident *)
+
+let strip_underscore s =
+  if String.length s > 0 && s.[0] = '_'
+  then String.sub s 1 (String.length s - 1)
+  else s
+
 (* return the list of symbols to rename in low-level form
    (with the leading "_caml" or "caml")
 *)
@@ -261,8 +268,10 @@ let build_package_cmx members target symbols_to_rename cmxfile =
     List.fold_left map_id Tbl.empty symbols_to_rename
   in
   let mapping_lbl =
-    List.fold_left (fun tbl s -> Tbl.add s (prefix_symbol target s) tbl)
-                   Tbl.empty symbols_to_rename in
+    List.fold_left
+      (fun tbl s ->
+        let s = strip_underscore s in Tbl.add s (prefix_symbol target s) tbl)
+      Tbl.empty symbols_to_rename in
   let member_defines m =
     match m.pm_kind with PM_intf -> [] | PM_impl info -> info.ui_defines in
   let defines =
index 5ff5ffc9631e210b674b62fbfe4c5d84a7360666..93fa1f8875c43a8bb9583f9ab2f856a02238d204 100755 (executable)
Binary files a/boot/ocamlc and b/boot/ocamlc differ
index e41b767ccfa08f1a53146aa356b177852cb85720..4144bdd978c1ab3d9b90c1d9350a5d3aadfee62e 100755 (executable)
Binary files a/boot/ocamllex and b/boot/ocamllex differ
index 351addb4182c1cc9ed9238a68b12da1202967061..895cec3f58c1ac2763afd57b37ed5bc6fe3b7d7f 100644 (file)
@@ -4,6 +4,7 @@ prims.c
 opnames.h
 ocamlrun
 ocamlrund
+ld.conf
 libcamlrun.x
 libcamlrun-gui.x
 *.c.x
index 9955d8ddd70ae64c810575ad995a068397ac0031..969a566c4339877be5894404d2416ad217696d19 100644 (file)
@@ -11,7 +11,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile,v 1.48 2004/05/09 10:37:27 xleroy Exp $
+# $Id: Makefile,v 1.48.4.1 2004/07/16 16:11:33 doligez Exp $
 
 include ../config/Makefile
 
@@ -37,7 +37,7 @@ PRIMS=alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c \
 PUBLIC_INCLUDES=alloc.h callback.h config.h custom.h fail.h intext.h \
   memory.h misc.h mlvalues.h signals.h compatibility.h
 
-all: ocamlrun$(EXE)
+all: ocamlrun$(EXE) ld.conf
 
 ocamlrun$(EXE): libcamlrun.a prims.o
        $(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \
@@ -55,6 +55,11 @@ install:
        for i in $(PUBLIC_INCLUDES); do \
           sed -f ../tools/cleanup-header $$i > $(LIBDIR)/caml/$$i; \
         done
+       cp ld.conf $(LIBDIR)/ld.conf
+
+ld.conf:
+       echo "$(STUBLIBDIR)" >ld.conf
+       echo "$(LIBDIR)" >>ld.conf
 
 libcamlrun.a: $(OBJS)
        ar rc libcamlrun.a $(OBJS)
@@ -66,7 +71,7 @@ libcamlrund.a: $(DOBJS)
 
 clean:
        rm -f ocamlrun$(EXE) ocamlrund$(EXE) *.o lib*.a
-       rm -f primitives prims.c opnames.h jumptbl.h
+       rm -f primitives prims.c opnames.h jumptbl.h ld.conf
 
 primitives : $(PRIMS)
        sed -n -e "s/CAMLprim value \([a-z0-9_][a-z0-9_]*\).*/\1/p" \
index cbbf5ea3767708371a41df2354b937b0c9d7fd27..d93aafbbd2920ef07cffd11150375de83b85a5b7 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id$ */
+/* $Id: dynlink.c,v 1.14 2004/02/22 15:07:51 xleroy Exp $ */
 
 /* Dynamic loading of C primitives. */
 
index ad4bfbadbacf39a90b86f5e376759405622066a0..6b4f3014fd942345cbf71b73b77b3ba81c5fa8b6 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id$ */
+/* $Id: dynlink.h,v 1.8 2004/02/22 15:07:51 xleroy Exp $ */
 
 /* Dynamic loading of C primitives. */
 
index 54d9c541daef33fd8c8b135487c183848501ae10..b1938aadddbaf901a4ac5e153855637316f18b5f 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: obj.c,v 1.34 2004/06/05 01:15:53 garrigue Exp $ */
+/* $Id: obj.c,v 1.34.2.1 2004/07/16 15:01:13 doligez Exp $ */
 
 /* Operations on objects */
 
@@ -66,11 +66,11 @@ CAMLprim value caml_obj_is_block(value arg)
 CAMLprim value caml_obj_tag(value arg)
 {
   if (Is_long (arg)){
-    return 1000;
-  }else if (Is_young (arg) || Is_in_heap (arg)){
+    return Val_int (1000);
+  }else if (Is_young (arg) || Is_in_heap (arg) || Is_atom (arg)){
     return Val_int(Tag_val(arg));
   }else{
-    return 1001;
+    return Val_int (1001);
   }
 }
 
@@ -169,15 +169,6 @@ CAMLprim value caml_obj_truncate (value v, value newsize)
    to the GC.
  */
 
-/* [lazy_is_forward] is obsolete.  Stays here to make bootstrapping
-   easier for patched versions of 3.07.  To be removed before 3.08. FIXME */
-/*
-CAMLxxprim value lazy_is_forward (value v)
-{
-  return Val_bool (Is_block (v) && Tag_val (v) == Forward_tag);
-}
-*/
-
 CAMLprim value caml_lazy_follow_forward (value v)
 {
   if (Is_block (v) && (Is_young (v) || Is_in_heap (v))
@@ -252,4 +243,4 @@ value caml_cache_public_method2 (value *meths, value tag, value *cache)
 }
 #endif /*CAML_JIT*/
 
-/* eof $Id: obj.c,v 1.34 2004/06/05 01:15:53 garrigue Exp $ */
+/* eof $Id: obj.c,v 1.34.2.1 2004/07/16 15:01:13 doligez Exp $ */
index beddd9b772f35b701f89f4c7adccdc0f6a41d22a..12c608c04f948533a3812ec94b610ba40a31cfa0 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id$ */
+/* $Id: osdeps.h,v 1.9 2004/01/02 19:23:25 doligez Exp $ */
 
 /* Operating system - specific stuff */
 
index 2f3e2ecc4c88b8ad6980a3a9496281160fc03b74..56c143cfbd4920188c971d2d05dfa31c9a0bbdaf 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: unix.c,v 1.21 2004/01/03 20:55:41 doligez Exp $ */
+/* $Id: unix.c,v 1.21.6.1 2004/08/18 05:01:22 garrigue Exp $ */
 
 /* Unix-specific stuff */
 
@@ -170,16 +170,57 @@ char * caml_search_dll_in_path(struct ext_table * path, char * name)
 
 static char *dlerror_string = "No error";
 
+/* Need to emulate dlopen behaviour by caching open libraries */
+typedef struct bundle_entry {
+  struct bundle_entry *next;
+  char *name;
+  void *handle;
+  int count;
+} entry_t;
+
+entry_t bundle_list = {NULL,NULL,NULL,0};
+
+entry_t *caml_lookup_bundle(const char *name)
+{
+  entry_t *current = bundle_list.next, *last = &bundle_list;
+
+  while (current !=NULL) {
+    if (!strcmp(name,current->name))
+      return current;
+    last = current;
+    current = current->next;
+  }
+  current = (entry_t*) malloc(sizeof(entry_t)+strlen(name)+1);
+  current->name = (char*)(current+1);
+  strcpy(current->name, name);
+  current->count = 0;
+  current->next = NULL;
+  last->next = current;
+  return current;
+}
+
 void * caml_dlopen(char * libname)
 {
   NSObjectFileImage image;
-  NSObjectFileImageReturnCode retCode =
-    NSCreateObjectFileImageFromFile(libname, &image);
+  entry_t *bentry = caml_lookup_bundle(libname);
+  NSObjectFileImageReturnCode retCode;
+  void *result = NULL;
+
+  if (bentry->count > 0)
+    return bentry->handle;
+
+  retCode = NSCreateObjectFileImageFromFile(libname, &image);
   switch (retCode) {
   case NSObjectFileImageSuccess:
     dlerror_string = NULL;
-    return (void*)NSLinkModule(image, libname, NSLINKMODULE_OPTION_BINDNOW
-                              | NSLINKMODULE_OPTION_RETURN_ON_ERROR);
+    result = (void*)NSLinkModule(image, libname, NSLINKMODULE_OPTION_BINDNOW
+                                 | NSLINKMODULE_OPTION_RETURN_ON_ERROR);
+    if (result != NULL) {
+      bentry->count++;
+      bentry->handle = result;
+    }
+    else NSDestroyObjectFileImage(image);
+    break;
   case NSObjectFileImageAccess:
     dlerror_string = "cannot access this bundle"; break;
   case NSObjectFileImageArch:
@@ -190,13 +231,25 @@ void * caml_dlopen(char * libname)
   default:
     dlerror_string = "could not read object file"; break;
   }
-  return NULL;
+  return result;
 }
 
 void caml_dlclose(void * handle)
 {
+  entry_t *current = bundle_list.next;
+  int close = 1;
+  
   dlerror_string = NULL;
-  NSUnLinkModule((NSModule)handle, NSUNLINKMODULE_OPTION_NONE);
+  while (current != NULL) {
+    if (current->handle == handle) {
+      current->count--;
+      close = (current->count == 0);
+      break;
+    }
+    current = current->next;
+  }
+  if (close)
+    NSUnLinkModule((NSModule)handle, NSUNLINKMODULE_OPTION_NONE);
 }
 
 void * caml_dlsym(void * handle, char * name)
index 40b3dae4295518955360b0f474f2cf328700b666..306bd5a7efbbd3689e9f3645a1c223e935d0aa62 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.20.2.5 2004/07/09 15:31:39 mauny Exp $
+# $Id: Makefile,v 1.20.2.7 2004/07/28 13:43:16 mauny Exp $
 
 include ../config/Makefile
 
@@ -31,7 +31,7 @@ $(CAMLP4): $(OBJS) ../odyl/odyl.cmo
        $(OCAMLC) -linkall -o $@ $(OBJS) $(CAMLP4M) ../odyl/odyl.cmo
 
 $(CAMLP4OPT): $(OBJS:.cma=.cmxa) ../odyl/odyl.cmx
-       $(OCAMLOPT) -o $@ $(OBJS:.cma=.cmxa) $(CAMLP4M) ../odyl/odyl.cmx
+       $(OCAMLOPT) -linkall -o $@ $(OBJS:.cma=.cmxa) $(CAMLP4M) ../odyl/odyl.cmx
 
 $(OTOP)/utils/config.cmx: $(OTOP)/utils/config.ml
        $(OCAMLOPT) -I $(OTOP)/utils -c $(OTOP)/utils/config.ml
@@ -75,8 +75,15 @@ install:
        cp mLast.mli quotation.mli ast2pt.mli pcaml.mli spretty.mli "$(LIBDIR)/camlp4/."
        cp mLast.cmi quotation.cmi ast2pt.cmi pcaml.cmi spretty.cmi "$(LIBDIR)/camlp4/."
        cp camlp4.cma $(LIBDIR)/camlp4/.
-       for f in  camlp4.$(A)  camlp4.p.$(A) camlp4.cmxa camlp4.p.cmxa; do \
-         test -f $$f && cp $$f "$(LIBDIR)/camlp4/." || true; \
+       for f in  camlp4.$(A)  camlp4.p.$(A) ; do \
+         if test -f $$f ; then \
+            cp $$f "$(LIBDIR)/camlp4/." && ( cd  "$(LIBDIR)/camlp4/." && $(RANLIB) $$f ) ; \
+         fi ; \
+       done
+       for f in camlp4.cmxa camlp4.p.cmxa ; do \
+         if test -f $$f ; then \
+            cp $$f "$(LIBDIR)/camlp4/." ; \
+         fi ; \
        done
 
 include .depend
index fbaf719f6998f343f7b015e516f44090a0e851d4..d627ae1bd797669cf127ac45f76764704b1ab8d4 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $Id: configure_batch,v 1.5 2003/08/29 12:15:15 xleroy Exp $
+# $Id: configure_batch,v 1.5.4.3 2004/07/30 14:59:15 mauny Exp $
 
 prefix=/usr/local
 bindir=''
@@ -70,6 +70,15 @@ echo "O=o" >> Makefile.cnf
 echo "A=a" >> Makefile.cnf
 echo "OPT=" >> Makefile.cnf
 echo "OTOP=$ocaml_top" >> Makefile.cnf
+if test -r ../../config/auto-aux/Makefile; then
+    grep '^RANLIB' ../../config/auto-aux/Makefile >> Makefile.cnf
+elif test -r ../../config/Makefile; then
+    grep '^RANLIB' ../../config/Makefile >> Makefile.cnf
+else
+    echo "Could not read OCaml config Makefile"
+    echo "Configuration script failed!"
+    exit 1
+fi
 
 if test "$ocaml_top" = "../ocaml_stuff"; then
     if ocamlc -v >/dev/null 2>&1; then
index 0b85954bbb5bcd9fce012c4ba42385695a30e3ac..651b6051faaa62e8e4ac6b3f0ff2e15caf3c6595 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: pa_o.ml,v 1.58 2004/05/25 11:38:31 mauny Exp $ *)
+(* $Id: pa_o.ml,v 1.58.2.1 2004/08/18 11:17:37 mauny Exp $ *)
 
 open Stdpp;
 open Pcaml;
@@ -554,7 +554,7 @@ EXTEND
           <:expr< let module $m$ = $mb$ in $e$ >>
       | "function"; OPT "|"; l = LIST1 match_case SEP "|" ->
           <:expr< fun [ $list:l$ ] >>
-      | "fun"; p = patt LEVEL "simple"; e = fun_def ->
+      | "fun"; p = simple_patt; e = fun_def ->
           <:expr< fun [$p$ -> $e$] >>
       | "match"; e = SELF; "with"; OPT "|"; l = LIST1 match_case SEP "|" ->
           <:expr< match $e$ with [ $list:l$ ] >>
@@ -715,7 +715,7 @@ EXTEND
   ;
   fun_binding:
     [ RIGHTA
-      [ p = patt LEVEL "simple"; e = SELF -> <:expr< fun $p$ -> $e$ >>
+      [ p = simple_patt; e = SELF -> <:expr< fun $p$ -> $e$ >>
       | "="; e = expr -> <:expr< $e$ >>
       | ":"; t = ctyp; "="; e = expr -> <:expr< ($e$ : $t$) >> ] ]
   ;
@@ -738,7 +738,7 @@ EXTEND
   ;
   fun_def:
     [ RIGHTA
-      [ p = patt LEVEL "simple"; e = SELF -> <:expr< fun $p$ -> $e$ >>
+      [ p = simple_patt; e = SELF -> <:expr< fun $p$ -> $e$ >>
       | "->"; e = expr -> <:expr< $e$ >> ] ]
   ;
   expr_ident:
@@ -789,7 +789,11 @@ EXTEND
     | LEFTA
       [ p1 = SELF; "."; p2 = SELF -> <:patt< $p1$ . $p2$ >> ]
     | "simple"
-      [ s = LIDENT -> <:patt< $lid:s$ >>
+      [ p = simple_patt -> p ] ]
+  ;
+
+  simple_patt:
+    [ [ s = LIDENT -> <:patt< $lid:s$ >>
       | s = UIDENT -> <:patt< $uid:s$ >>
       | s = INT -> <:patt< $int:s$ >>
       | s = INT32 -> MLast.PaInt32 loc s
@@ -814,9 +818,11 @@ EXTEND
       | "{"; lpl = lbl_patt_list; "}" -> <:patt< { $list:lpl$ } >>
       | "("; ")" -> <:patt< () >>
       | "("; op = operator_rparen -> <:patt< $lid:op$ >>
-      | "("; p = SELF; ":"; t = ctyp; ")" -> <:patt< ($p$ : $t$) >>
-      | "("; p = SELF; ")" -> <:patt< $p$ >>
+      | "("; p = patt; ":"; t = ctyp; ")" -> <:patt< ($p$ : $t$) >>
+      | "("; p = patt; ")" -> <:patt< $p$ >>
       | "_" -> <:patt< _ >>
+      | "`"; s = ident -> <:patt< ` $s$ >>
+      | "#"; t = mod_ident -> <:patt< # $list:t$ >>
       | x = LOCATE ->
           let x =
             try
@@ -841,6 +847,7 @@ EXTEND
           in
           Pcaml.handle_patt_quotation loc x ] ]
   ;
+
   patt_semi_list:
     [ [ p = patt; ";"; pl = SELF -> [p :: pl]
       | p = patt; ";" -> [p]
@@ -981,7 +988,7 @@ EXTEND
     [ [ "="; ce = class_expr -> ce
       | ":"; ct = class_type; "="; ce = class_expr ->
           <:class_expr< ($ce$ : $ct$) >>
-      | p = patt LEVEL "simple"; cfb = SELF ->
+      | p = simple_patt; cfb = SELF ->
           <:class_expr< fun $p$ -> $cfb$ >> ] ]
   ;
   class_type_parameters:
@@ -989,11 +996,11 @@ EXTEND
       | "["; tpl = LIST1 type_parameter SEP ","; "]" -> (loc, tpl) ] ]
   ;
   class_fun_def:
-    [ [ p = patt LEVEL "simple"; "->"; ce = class_expr ->
+    [ [ p = simple_patt; "->"; ce = class_expr ->
           <:class_expr< fun $p$ -> $ce$ >>
       | p = labeled_patt; "->"; ce = class_expr ->
           <:class_expr< fun $p$ -> $ce$ >>
-      | p = patt LEVEL "simple"; cfd = SELF ->
+      | p = simple_patt; cfd = SELF ->
           <:class_expr< fun $p$ -> $cfd$ >>
       | p = labeled_patt; cfd = SELF ->
           <:class_expr< fun $p$ -> $cfd$ >> ] ]
@@ -1215,12 +1222,8 @@ EXTEND
   fun_binding:
     [ [ p = labeled_patt; e = SELF -> <:expr< fun $p$ -> $e$ >> ] ]
   ;
-  patt: LEVEL "simple"
-    [ [ "`"; s = ident -> <:patt< ` $s$ >>
-      | "#"; t = mod_ident -> <:patt< # $list:t$ >> ] ]
-  ;
   labeled_patt:
-    [ [ i = LABEL; p = patt LEVEL "simple" ->
+    [ [ i = LABEL; p = simple_patt ->
            <:patt< ~ $i$ : $p$ >>
       | i = TILDEIDENT ->
            <:patt< ~ $i$ >>
index 5e26f419c58b1b8810e7e05c527f6e71e3ee3b74..f648e4aac0d8317014d16c26a1f23476786d79c4 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.8.2.4 2004/07/09 15:09:46 doligez Exp $
+# $Id: Makefile,v 1.8.2.6 2004/07/28 13:55:43 mauny Exp $
 
 include ../config/Makefile
 
@@ -48,11 +48,13 @@ install:
        test -f $(TARGET:.cma=.cmxa) && $(MAKE) installopt LIBDIR="$(LIBDIR)" || true
 
 installopt:
-       for f in $(TARGET:.cma=.cmxa) $(TARGET:.cma=.p.cmxa) ; do \
+       for f in $(TARGET:.cma=.cmxa) $(TARGET:.cma=.p.cmxa) *.cmx ; do \
                test -f $$f && cp $$f "$(LIBDIR)/camlp4/." || true ; \
        done
        # Special treatment for this one: some versions of make don't like $(A) in $(TARGET:.cma=.$(A)) 
        target="`echo $(TARGET) | sed -e 's/\.cma$$/.$(A)/'`" ; \
-          test -f $$target && cp $$target "$(LIBDIR)/camlp4/." || true
+          if test -f $$target ; then \
+             cp $$target "$(LIBDIR)/camlp4/." && ( cd "$(LIBDIR)/camlp4/." && $(RANLIB) $$target ) \
+         fi
 
 include .depend
index a1cd52315b9e4bdeac95dd8b08c8650b4e7b4c62..6acc85e00fef400fc17f79da20927eee810307ad 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: plexer.ml,v 1.20.2.1 2004/06/30 13:05:31 mauny Exp $ *)
+(* $Id: plexer.ml,v 1.20.2.2 2004/08/18 11:17:37 mauny Exp $ *)
 
 open Stdpp;
 open Token;
@@ -317,7 +317,7 @@ value next_token_fun dfa ssd find_kwd fname lnum bolpos glexr =
     parser
     [ [: `'"' :] -> len
     | [: `'\\'; `c; s :] ep  -> string bp (store (store len '\\') c) s
-    | [: `'\010'; s :] ep -> do { bolpos.val := ep; incr lnum; string bp len s }
+    | [: `'\010'; s :] ep -> do { bolpos.val := ep; incr lnum; string bp (store len '\010') s }
     | [: `'\013'; s :] ep ->
         let (len, ep) =
           match Stream.peek s with
index b40b5f9f0bb5501c4cad8d2afb693079b90e8629..ff8c65047631e770edddcbc9570963a62df736a3 100644 (file)
@@ -28,19 +28,10 @@ load-options
 other-options
 ]
 .br
-.B camlp4sch
-[
-load-options
-] [--] [
-other-options
-]
-.br
 .B camlp4o.cma
 .br
 .B camlp4r.cma
 .br
-.B camlp4sch.cma
-.br
 .B mkcamlp4
 .br
 .B ocpp
@@ -65,27 +56,23 @@ other-options
 is a Pre-Processor-Pretty-Printer for OCaml, parsing a source
 file and printing some result on standard output.
 .LP
-.B camlp4o,
-.B camlp4r
+.B camlp4o
 and
-.B camlp4sch
+.B camlp4r
 are versions of
 .B camlp4
-with some files already loaded (see further).
+with some files already loaded (see below).
 .LP
-.B camlp4o.cma,
-.B camlp4r.cma
+.B camlp4o.cma
 and
-.B camlp4sch.cma
-are files to be loaded in ocaml toplevel to use the camlp4 machinery
+.B camlp4r.cma
+are files to be loaded in ocaml toplevel to use the camlp4 machinery.
 .LP
 .B mkcamlp4
-creates camlp4 executables with almost the same options than ocamlmktop.
-See further.
+creates camlp4 executables with almost the same options as ocamlmktop (see below).
 .LP
 .B ocpp
-is an universal preprocessor, treating any kind of source file,
-generating the same text with the possible quotations expanded.
+is an universal preprocessor, expanding quotations in any kind of text file.
 .LP
 .B camlp4o.opt
 and
@@ -97,11 +84,11 @@ in all installations of camlp4.
 .SH LOAD OPTIONS
 
 The load options select parsing and printing actions recorded in OCaml
-object files (ending with .cmo or .cma). Several usage of these options
-are authorized. They must precede the other options.
+object files (ending with .cmo or .cma). They must precede other
+options.
 
 .LP
-An optionnal
+An optional
 .B \-\-
 may end the load options.
 
@@ -110,7 +97,7 @@ may end the load options.
 Add
 .I directory
 in the search path for files loaded. Unless the option \-nolib is used,
-the camlp4 library directory is appended to the path. Warning: there is
+the camlp4 library directory is appended to the path. Note that there is
 no automatic search in the current directory: add "\-I ." for this.
 .TP
 .B \-where
@@ -119,8 +106,10 @@ Print camlp4 library directory name and exit.
 .B \-nolib
 No automatic search for objects files in camlp4 library directory.
 .TP
-.BI object-file
-The file is loaded in camlp4 core.
+.I object-file
+Load
+.I object-file
+in the camlp4 core.
 
 .SH OTHER OPTIONS
 
@@ -138,12 +127,12 @@ if it ends with .ml.
 .BI \-intf\  file
 Treat
 .I file
-as an interface file, whatever its extension.
+as an interface file, whatever its extension is.
 .TP
 .BI \-impl\  file
 Treat
 .I file
-as an implementation file, whatever its extension.
+as an implementation file, whatever its extension is.
 .TP
 .B \-unsafe
 Generate unsafe accesses to arrays and strings.
@@ -160,14 +149,16 @@ Dump in
 in case of syntax error in the result of a quotation expansion.
 .TP
 .BI \-o\  out-file
-Print the result on out-file instead of standard output. File is opened
-with open_out_bin (see OCaml library Pervasives).
+Print the result in
+.I out-file
+instead of standard output. File is opened
+with open_out_bin (see the documentation of the Pervasives OCaml library).
 .TP
 .B \-v
 Print the version number and exit.
 .TP
 .B \-help
-Print the available options and exit. This print includes the options
+Print the available options and exit. The output includes the options
 possibly added by the loaded object files.
 
 .LP
@@ -192,7 +183,7 @@ Added by pa_macro.cmo: define the ident.
 Added by pa_macro.cmo: undefine the ident.
 
 .SH "PROVIDED FILES"
-These files are installed in the directory LIBDIR/camlp4.
+These files are installed in LIBDIR/camlp4.
 
 .LP
 Parsing files:
@@ -203,7 +194,6 @@ Parsing files:
        pa_oop.cmo: streams and parsers (without code optimization)
        pa_r.cmo: revised syntax
        pa_rp.cmo: streams and parsers
-       pa_scheme.cmo: scheme syntax
        pa_extend.cmo: syntax extension for grammars
        pa_extfold.cmo: extension of pa_extend with FOLD0 and FOLD1
        pa_extfun.cmo: syntax extension for extensible functions
@@ -220,8 +210,6 @@ Printing files:
        pr_op.cmo: try to rebuild streams and parsers syntax
        pr_r.cmo: revised syntax
        pr_rp.cmo: try to rebuild streams and parsers syntax
-       pr_scheme.cmo: scheme syntax
-       pr_schemep.cmo: try to rebuild streams and parsers syntax
        pr_extend.cmo: try to rebuild EXTEND statements
        pr_extfun.cmo: try to rebuild extfun statements
        pr_dump.cmo: syntax tree
@@ -252,14 +240,6 @@ is a shortcut for:
        camlp4 pa_r.cmo pa_rp.cmo pr_dump.cmo
 .fi
 .LP
-The command
-.B camlp4sch
-is a shortcut for:
-.nf
-.ta 1c
-       camlp4 pa_scheme.cmo pr_dump.cmo
-.fi
-.LP
 .LP
 The file
 .B camlp4o.cma
@@ -268,10 +248,6 @@ can be loaded in the toplevel to start camlp4 with OCaml syntax.
 The file
 .B camlp4r.cma
 can be loaded in the toplevel to start camlp4 with revised syntax.
-.LP
-The file
-.B camlp4sch.cma
-can be loaded in the toplevel to start camlp4 with Scheme syntax.
 
 .SH "MKCAMLP4"
 
@@ -280,6 +256,7 @@ creates camlp4 executables with almost the same options than ocamlmktop.
 The only difference is that the interfaces to be visible must be explicitly
 added in the command line as ".cmi" files. For example, how to add the
 the OCaml module "str":
+
 .nf
 .ta 1c 2c
        mkcamlp4 -custom str.cmi str.cma -cclib -lstr \\
@@ -287,7 +264,7 @@ the OCaml module "str":
 .fi
 
 .SH "FILES"
-Camlp4 library directory in the present installation:
+Camlp4 library directory in the current installation:
 .br
 LIBDIR/camlp4
 
index 94363f41d6a36339d7657289486aa64ae75cd45e..d77606597e9c35e633479786cf46709dc4132b1b 100644 (file)
@@ -31,7 +31,7 @@ $(CAMLP4): $(OBJS) ../odyl/odyl.cmo
        $(OCAMLC) -linkall -o $@ $(OBJS) $(CAMLP4M) ../odyl/odyl.cmo
 
 $(CAMLP4OPT): $(OBJS:.cma=.cmxa) ../odyl/odyl.cmx
-       $(OCAMLOPT) -o $@ $(OBJS:.cma=.cmxa) $(CAMLP4M) ../odyl/odyl.cmx
+       $(OCAMLOPT) -linkall -o $@ $(OBJS:.cma=.cmxa) $(CAMLP4M) ../odyl/odyl.cmx
 
 $(OTOP)/utils/config.cmx: $(OTOP)/utils/config.ml
        $(OCAMLOPT) -I $(OTOP)/utils -c $(OTOP)/utils/config.ml
@@ -75,8 +75,15 @@ install:
        cp mLast.mli quotation.mli ast2pt.mli pcaml.mli spretty.mli "$(LIBDIR)/camlp4/."
        cp mLast.cmi quotation.cmi ast2pt.cmi pcaml.cmi spretty.cmi "$(LIBDIR)/camlp4/."
        cp camlp4.cma $(LIBDIR)/camlp4/.
-       for f in  camlp4.$(A)  camlp4.p.$(A) camlp4.cmxa camlp4.p.cmxa; do \
-         test -f $$f && cp $$f "$(LIBDIR)/camlp4/." || true; \
+       for f in  camlp4.$(A)  camlp4.p.$(A) ; do \
+         if test -f $$f ; then \
+            cp $$f "$(LIBDIR)/camlp4/." && ( cd  "$(LIBDIR)/camlp4/." && $(RANLIB) $$f ) ; \
+         fi ; \
+       done
+       for f in camlp4.cmxa camlp4.p.cmxa ; do \
+         if test -f $$f ; then \
+            cp $$f "$(LIBDIR)/camlp4/." ; \
+         fi ; \
        done
 
 include .depend
index 722430e1ff0f22ae383bee31b5f6a722ccad111d..37fa4fbb1c406fa565b436b6cb1dba50a5235bb1 100644 (file)
@@ -48,11 +48,13 @@ install:
        test -f $(TARGET:.cma=.cmxa) && $(MAKE) installopt LIBDIR="$(LIBDIR)" || true
 
 installopt:
-       for f in $(TARGET:.cma=.cmxa) $(TARGET:.cma=.p.cmxa) ; do \
+       for f in $(TARGET:.cma=.cmxa) $(TARGET:.cma=.p.cmxa) *.cmx ; do \
                test -f $$f && cp $$f "$(LIBDIR)/camlp4/." || true ; \
        done
        # Special treatment for this one: some versions of make don't like $(A) in $(TARGET:.cma=.$(A)) 
-       target="`echo $(TARGET) | sed -e 's/\.cma$$/.$(A))/'`" ; \
-          test -f $$target && cp $$target "$(LIBDIR)/camlp4/." || true
+       target="`echo $(TARGET) | sed -e 's/\.cma$$/.$(A)/'`" ; \
+          if test -f $$target ; then \
+             cp $$target "$(LIBDIR)/camlp4/." && ( cd "$(LIBDIR)/camlp4/." && $(RANLIB) $$target ) \
+         fi
 
 include .depend
index e10448089ba2c2c590db3744938ec0659261fd62..163929bd4d54d511e91db00e02ba9c6ca94a2237 100644 (file)
@@ -448,7 +448,7 @@ let next_token_fun dfa ssd find_kwd fname lnum bolpos glexr =
         Stream.junk strm__;
         let s = strm__ in
         let ep = Stream.count strm__ in
-        bolpos := ep; incr lnum; string bp len s
+        bolpos := ep; incr lnum; string bp (store len '\010') s
     | Some '\013' ->
         Stream.junk strm__;
         let s = strm__ in
index d0b3cd519cc7561510bb23987789f283a8fb859b..a66dcd751f333f79704259d05baa6497f868ae9b 100644 (file)
@@ -49,7 +49,10 @@ install:
        cp camlp4r$(EXE) "$(BINDIR)/."
        if test -f camlp4r.opt; then \
          cp camlp4r.opt "$(BINDIR)/camlp4r.opt$(EXE)" ;\
-         cp $(OBJSX) $(OBJSX:.cmx=.$(O)) "$(LIBDIR)/camlp4/."; \
+         cp $(OBJSX) "$(LIBDIR)/camlp4/."; \
+         for file in $(OBJSX); do \
+           cp "`echo $$file | sed -e 's/\.cmx$$/.$(O)/'`" "$(LIBDIR)/camlp4/."; \
+         done ; \
        fi
 
 include .depend
index c09099d3e58e0c98c1472cb358b090cc762209bc..3f125b7d3a3b71dcb8f127b64d241e4f969f941e 100644 (file)
@@ -1,4 +1,4 @@
-odyl_main.cmo: odyl_config.cmo odyl_main.cmi 
-odyl_main.cmx: odyl_config.cmx odyl_main.cmi 
 odyl.cmo: odyl_config.cmo odyl_main.cmi 
 odyl.cmx: odyl_config.cmx odyl_main.cmx 
+odyl_main.cmo: odyl_config.cmo odyl_main.cmi 
+odyl_main.cmx: odyl_config.cmx odyl_main.cmi 
index 07d5c6b264e96624583a657ab2f5d404a3b56751..d165e6923e2c074ab0a4363d6c613b90b6494eaf 100644 (file)
@@ -68,8 +68,15 @@ compare:
 install:
        -$(MKDIR) "$(LIBDIR)/camlp4" "$(BINDIR)"
        cp odyl.cmo odyl.cma odyl_main.cmi $(LIBDIR)/camlp4/.
-       for f in odyl.$(A) odyl.p.$(A) odyl.cmx odyl.o odyl.p.cmx odyl.p.o odyl.cmxa odyl.p.cmxa ; do \
-          test -f $$f && cp $$f "$(LIBDIR)/camlp4/." || true; \
+       for f in odyl.$(A) odyl.p.$(A)  ; do \
+          if test -f $$f ; then \
+               cp $$f "$(LIBDIR)/camlp4/."  && ( cd "$(LIBDIR)/camlp4/." && $(RANLIB) $$f ) ; \
+          fi ; \
+       done
+       for f in odyl.cmx odyl.o odyl.p.cmx odyl.p.o odyl.cmxa odyl.p.cmxa ; do \
+           if test -f $$f ; then \
+              cp $$f "$(LIBDIR)/camlp4/." ; \
+           fi ; \
        done
 
 include .depend
index f9808ad9f33cade68c275315ea8e4f095b4c826a..37976743564d545fecd8329ecb71757195574bc4 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15.4.5 2004/07/02 14:43:31 mauny Exp $
+# $Id: Makefile,v 1.15.4.6 2004/07/28 13:11:07 mauny Exp $
 
 include ../config/Makefile
 
@@ -68,8 +68,15 @@ compare:
 install:
        -$(MKDIR) "$(LIBDIR)/camlp4" "$(BINDIR)"
        cp odyl.cmo odyl.cma odyl_main.cmi $(LIBDIR)/camlp4/.
-       for f in odyl.$(A) odyl.p.$(A) odyl.cmx odyl.o odyl.p.cmx odyl.p.o odyl.cmxa odyl.p.cmxa ; do \
-          test -f $$f && cp $$f "$(LIBDIR)/camlp4/." || true; \
+       for f in odyl.$(A) odyl.p.$(A)  ; do \
+          if test -f $$f ; then \
+               cp $$f "$(LIBDIR)/camlp4/."  && ( cd "$(LIBDIR)/camlp4/." && $(RANLIB) $$f ) ; \
+          fi ; \
+       done
+       for f in odyl.cmx odyl.o odyl.p.cmx odyl.p.o odyl.cmxa odyl.p.cmxa ; do \
+           if test -f $$f ; then \
+              cp $$f "$(LIBDIR)/camlp4/." ; \
+           fi ; \
        done
 
 include .depend
index 385676ab073020aa8c2a6384a058b2025379b8e0..ce50043616a38a46907c11194b50d0080610bc94 100755 (executable)
--- a/configure
+++ b/configure
@@ -13,7 +13,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: configure,v 1.215.2.3 2004/07/09 15:08:51 doligez Exp $
+# $Id: configure,v 1.215.2.6 2004/08/12 16:02:00 xleroy Exp $
 
 configure_options="$*"
 prefix=/usr/local
@@ -284,10 +284,10 @@ case "$bytecc,$host" in
   *,alpha*-*-unicos*)
     # For the Cray T3E
     bytecccompopts="-DUMK";;
-  gcc*,powerpc-*-aix4.3*)
+  gcc*,powerpc-*-aix*)
     # Avoid name-space pollution by requiring Unix98-conformant includes
     bytecccompopts="-fno-defer-pop $gcc_warnings -D_XOPEN_SOURCE=500";;
-  *,powerpc-*-aix4.3*)
+  *,powerpc-*-aix*)
     bytecccompopts="-D_XOPEN_SOURCE=500";;
   gcc*,*-*-cygwin*)
     bytecccompopts="-fno-defer-pop $gcc_warnings -U_WIN32"
@@ -1423,13 +1423,18 @@ else
   echo "Configuration failed, LablTk will not be built."
 fi
 
-# Camlp4
-
+# Begin Camlp4
 (
 cd ../../camlp4/config
-EXE=$exe ./configure_batch -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null
+EXE=$exe ./configure_batch -prefix "$prefix" -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null
 )
 
+case $? in
+    0) echo "Camlp4 correctly configured.";;
+    *) echo "Warning: Camlp4 configuration terminated with error code $?";;
+esac
+# End Camlp4
+
 # Final twiddling of compiler options to work around known bugs
 
 nativeccprofopts="$nativecccompopts"
diff --git a/emacs/COPYING b/emacs/COPYING
new file mode 100644 (file)
index 0000000..5b6e7c6
--- /dev/null
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
index 4ef434c3731f7580e5347329dba336390d2ba8d3..fdf07981455c77d613c45574a7d0f64b5087b58d 100644 (file)
@@ -1,4 +1,16 @@
-# $Id: Makefile,v 1.16 2003/10/10 13:25:38 remy Exp $
+#########################################################################
+#                                                                       #
+#                            Objective Caml                             #
+#                                                                       #
+#            Xavier Leroy, projet Cristal, INRIA Rocquencourt           #
+#                                                                       #
+#   Copyright 1997 Institut National de Recherche en Informatique et    #
+#   en Automatique.  All rights reserved.  This file is distributed     #
+#   under the terms of the GNU General Public License.                  #
+#                                                                       #
+#########################################################################
+
+# $Id: Makefile,v 1.16.4.1 2004/08/09 16:09:33 doligez Exp $
 
 include ../config/Makefile
 
index 63b4a480fd8cfc5e6893e058d4c77aaaf24618a5..d7bad84d2f3c825add0c615395e5248d3abe7ad0 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*           Xavier Leroy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 1998 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: caml-compat.el,v 1.2.18.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;; function definitions for old versions of emacs
 
 ;; indent-line-to
index 5f35c2451acc8efba94bfb2d1c7c0e1445031272..8b7ed3598f84884f7955dca7e9383d091a2965a7 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*            Didier Remy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 2003 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: caml-emacs.el,v 1.6.6.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;; for caml-help.el
 (defalias 'caml-info-other-window 'info-other-window)
 
index 628a757e5f8f607ed75f85a55b1bb00ba031abf4..8454aa35049305d250a098e5e55a31e10f136023 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: caml-font.el,v 1.18.2.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;; useful colors
 
 (cond
index ea082bf2420066d80e4acb7bc9ec70bd6027589f..92735acac2b2ac016ddd066bad7d92a60d69e3ad 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*            Didier Remy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 2001 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id$ *)
+
 ;; caml-info.el --- contextual completion and help to caml-mode
 
 ;; Didier Remy, November 2001.
index 7b48a8119f16e5bb06aeb778fb8fd92fa8b051b7..c4160d9553eb0051779d963631c3c9da91ced73f 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: caml-hilit.el,v 1.8.4.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ; Highlighting patterns for hilit19 under caml-mode
 
 ; defined also in caml.el
index 571d23871f6116e25eba877e92b047356071ff69..6870658fc4524a9540c93c365bd5e96a6e77f71a 100644 (file)
@@ -6,11 +6,11 @@
 ;(*                                                                     *)
 ;(*  Copyright 2003 Institut National de Recherche en Informatique et   *)
 ;(*  en Automatique.  All rights reserved.  This file is distributed    *)
-;(*  under the terms of the Q Public License version 1.0.               *)
+;(*  under the terms of the GNU General Public License.                 *)
 ;(*                                                                     *)
 ;(***********************************************************************)
 
-;(* $Id: caml-types.el,v 1.29 2003/10/21 07:36:06 remy Exp $ *)
+;(* $Id: caml-types.el,v 1.29.6.1 2004/08/09 16:09:33 doligez Exp $ *)
 
 ; An emacs-lisp complement to the "-dtypes" option of ocamlc and ocamlopt.
 
index ff493915768739f167cec5528b6845fd2c0169e4..aa5ef7f90671ead66ab0fbdd00ab0162acf3b585 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*            Didier Remy, projet Cristal, INRIA Rocquencourt          *)
+;(*                                                                     *)
+;(*  Copyright 2003 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: caml-xemacs.el,v 1.5.6.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 (require 'overlay)
 
 ;; for caml-help.el
index 8e6da6a251ad2edd21a863005c3c2549db4a1d8f..16958cb71ad24166083453be93049abcf6ddd8b9 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: caml.el,v 1.36.4.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;;; caml.el --- O'Caml code editing commands for Emacs
 
 ;; Xavier Leroy, july 1993.
index c66343a4e14c8cbcad7a93606da9aa33525c60f7..146a307a610572f8d1876196d057db596d9f4e1d 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: camldebug.el,v 1.8.4.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;;; Run camldebug under Emacs
 ;;; Derived from gdb.el.
 ;;; gdb.el is Copyright (C) 1988 Free Software Foundation, Inc, and is part
index f24a7a71fe2b919f8226715fa6c3f3977e1f7d82..b9da36f41a8101a2bd4b32eabcea3d3f15362e5b 100644 (file)
@@ -1,3 +1,17 @@
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*                   Xavier Leroy and Jacques Garrigue                 *)
+;(*                                                                     *)
+;(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: inf-caml.el,v 1.10.8.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;;; inf-caml.el --- run the Caml toplevel in an Emacs buffer
 
 ;; Xavier Leroy, july 1993.
index 79873c90c5d70d36c30caf3975f5afd151b408cd..2bcadf44f3960f955727322bbb5d32698e898a65 100644 (file)
@@ -1,5 +1,19 @@
 ":" ; @EMACS@ -batch -l $0 "$@" ; status=$? ; : '--*-Emacs-Lisp-*--' <<';'
 
+;(***********************************************************************)
+;(*                                                                     *)
+;(*                           Objective Caml                            *)
+;(*                                                                     *)
+;(*                Jacques Garrigue and Ian T Zimmerman                 *)
+;(*                                                                     *)
+;(*  Copyright 1998 Institut National de Recherche en Informatique et   *)
+;(*  en Automatique.  All rights reserved.  This file is distributed    *)
+;(*  under the terms of the GNU General Public License.                 *)
+;(*                                                                     *)
+;(***********************************************************************)
+
+;(* $Id: ocamltags.in,v 1.5.18.1 2004/08/09 16:09:33 doligez Exp $ *)
+
 ;; Copyright (C) 1998 Ian Zimmerman <itz@transbay.net>
 ;;  This program is free software; you can redistribute it and/or
 ;;  modify it under the terms of the GNU General Public License as
@@ -10,7 +24,7 @@
 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;;  General Public License for more details.
-;; $Id: ocamltags.in,v 1.5 1999/11/29 19:03:30 doligez Exp $
+;; $Id: ocamltags.in,v 1.5.18.1 2004/08/09 16:09:33 doligez Exp $
 
 (require 'caml)
 
index e87359fef5336163e865a52930fd75e59a8cbc1d..a877b4d9343338ea8568750b10533273560a4263 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: main.ml,v 1.21 2004/04/29 11:12:49 maranget Exp $ *)
+(* $Id: main.ml,v 1.21.2.1 2004/07/22 11:00:35 maranget Exp $ *)
 
 (* The lexer generator. Command-line parsing. *)
 
@@ -23,12 +23,19 @@ let output_name = ref None
 
 let usage = "usage: ocamlex [options] sourcefile"
 
+let print_version_string () =
+  print_string "The Objective Caml lexer generator, version ";
+  print_string Sys.ocaml_version ; print_newline();
+  exit 0
+
 let specs =
   ["-ml", Arg.Set ml_automata,
     " Output code that does not use the Lexing module built-in automata interpreter";
    "-o", Arg.String (fun x -> output_name := Some x),
     " <file>  Set output file name to <file>";
    "-q", Arg.Set Common.quiet_mode, " Do not display informational messages";
+   "-v",  Arg.Unit print_version_string, " Print version and exit";
+   "-version",  Arg.Unit print_version_string, " Print version and exit";
   ] 
 
 let _ =
index e4b6bfe5b4fd01b4e4778bb3cf46ba01f6767f5b..e7f1045b5fa736c935ef91249271b315c6b4bda7 100644 (file)
@@ -4,7 +4,13 @@ TODO:
  - utilisation nouvelles infos de Xavier: "début de rec", etc.
 
 =====
-Release 3.08:
+Release 3.08.1:
+ - add: new -intf and -impl options supported (PR#3036)
+ - fix: display of class parameters in HTML and LaTeX (PR#2994)
+ - fix: display of link to class page in html (PR#2994)
+
+=====
+Release 3.08.0:
  - fix: method parameters names in signature are now retrieved correctly
    (fix of Odoc_value.parameter_list_from_arrows to handle Tpoly for methods)
  - ajout Ã  la doc de Module_list et Index_list (utilisé dans le html seulement)
index 98cfb3ac8730eeff332eefcfc38571733c6ae410..84e37ba4936077e860a947b556bf7039c4f4deee 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_analyse.ml,v 1.8 2003/11/24 10:39:28 starynke Exp $ *)
+(* $Id: odoc_analyse.ml,v 1.8.6.1 2004/08/06 13:42:16 guesdon Exp $ *)
 
 (** Analysis of source files. This module is strongly inspired from driver/main.ml :-) *)
 
@@ -21,6 +21,7 @@ open Misc
 open Format
 open Typedtree
 
+
 (** Initialize the search path.
    The current directory is always searched first,
    then the directories specified with the -I option (in command-line order),
@@ -194,45 +195,49 @@ let process_error exn =
 let process_file ppf sourcefile =
   if !Odoc_args.verbose then 
     (
-     print_string (Odoc_messages.analysing sourcefile) ;
+     let f = match sourcefile with Odoc_args.Impl_file f | Odoc_args.Intf_file f -> f in
+     print_string (Odoc_messages.analysing f) ;
      print_newline ();
     );
-  if Filename.check_suffix sourcefile "ml" then
-    (
-     try
-       let (parsetree_typedtree_opt, input_file) = process_implementation_file ppf sourcefile in
-       match parsetree_typedtree_opt with
-         None ->
+  match sourcefile with
+    Odoc_args.Impl_file file ->
+      (
+       try
+        let (parsetree_typedtree_opt, input_file) = process_implementation_file ppf file in
+        match parsetree_typedtree_opt with
+           None ->
+             None
+        | Some (parsetree, typedtree) ->
+             let file_module = Ast_analyser.analyse_typed_tree file
+                !Location.input_name parsetree typedtree 
+            in
+             file_module.Odoc_module.m_top_deps <- Odoc_dep.impl_dependencies parsetree ;
+
+             if !Odoc_args.verbose then 
+               (
+               print_string Odoc_messages.ok;
+               print_newline ()
+               );
+             remove_preprocessed input_file;
+             Some file_module
+       with
+       | Sys_error s 
+       | Failure s ->
+           prerr_endline s ;
+           incr Odoc_global.errors ;
            None
-       | Some (parsetree, typedtree) ->
-           let file_module = Ast_analyser.analyse_typed_tree sourcefile !Location.input_name parsetree typedtree in
-
-           file_module.Odoc_module.m_top_deps <- Odoc_dep.impl_dependencies parsetree ;
-
-           if !Odoc_args.verbose then 
-             (
-              print_string Odoc_messages.ok;
-              print_newline ()
-             );
-           remove_preprocessed input_file;
-           Some file_module
-     with
-     | Sys_error s 
-     | Failure s ->
-         prerr_endline s ;
-         incr Odoc_global.errors ;
-         None
-     | e ->
-         process_error e ;
-         incr Odoc_global.errors ;
-         None
-    )
-  else
-    if Filename.check_suffix sourcefile "mli" then
+       | e ->
+           process_error e ;
+           incr Odoc_global.errors ;
+           None
+      )
+  | Odoc_args.Intf_file file ->
       (
        try
-         let (ast, signat, input_file) = process_interface_file ppf sourcefile in
-         let file_module = Sig_analyser.analyse_signature sourcefile !Location.input_name ast signat in
+         let (ast, signat, input_file) = process_interface_file ppf file in
+         let file_module = Sig_analyser.analyse_signature file
+            !Location.input_name ast signat 
+        in
 
          file_module.Odoc_module.m_top_deps <- Odoc_dep.intf_dependencies ast ;
 
@@ -254,10 +259,6 @@ let process_file ppf sourcefile =
            incr Odoc_global.errors ;
            None
       )
-    else
-      (
-       raise (Failure (Odoc_messages.unknown_extension sourcefile))
-      )
 
 (** Remove the class elements after the stop special comment. *)
 let rec remove_class_elements_after_stop eles =
@@ -445,4 +446,4 @@ let load_modules file =
       raise (Failure s)
 
 
-(* eof $Id: odoc_analyse.ml,v 1.8 2003/11/24 10:39:28 starynke Exp $ *)
+(* eof $Id: odoc_analyse.ml,v 1.8.6.1 2004/08/06 13:42:16 guesdon Exp $ *)
index c2b7165c2bbd6f93886c21a41dd4a64ad02b096e..c6ea20bce4dd955ddb7d91472608abeda4b9f687 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_analyse.mli,v 1.3 2003/11/24 10:39:28 starynke Exp $ *)
+(* $Id: odoc_analyse.mli,v 1.3.6.1 2004/08/06 13:42:16 guesdon Exp $ *)
 
 (** Analysis of source files. *)
 
@@ -19,7 +19,7 @@
 *)
 val analyse_files : 
     ?init: Odoc_module.t_module list -> 
-      string list -> 
+      Odoc_args.source_file list -> 
         Odoc_module.t_module list
 
 (** Dump of a list of modules into a file. 
index 4e7601ffea9e338d4f5d83eb380086c8e922d25b..9b79f5897f4126289a6a15b9eb545ef25057aa8d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* cvsid $Id: odoc_args.ml,v 1.15.6.1 2004/07/09 14:32:42 guesdon Exp $ *)
+(* cvsid $Id: odoc_args.ml,v 1.15.6.2 2004/08/06 13:42:16 guesdon Exp $ *)
 
 (** Command-line arguments. *)
 
@@ -17,6 +17,10 @@ open Clflags
 
 module M = Odoc_messages
 
+type source_file =
+    Impl_file of string
+  | Intf_file of string
+
 let include_dirs = Clflags.include_dirs
 
 let bytecode_mode = ref true
@@ -207,6 +211,8 @@ let options = ref [
   "-v", Arg.Unit (fun () -> verbose := true), M.verbose_mode ;
   "-I", Arg.String (fun s -> include_dirs := (Misc.expand_directory Config.standard_library s) :: !include_dirs), M.include_dirs ;
   "-pp", Arg.String (fun s -> preprocessor := Some s), M.preprocess ;
+  "-impl", Arg.String (fun s -> files := !files @ [Impl_file s]), M.option_impl ;
+  "-intf", Arg.String (fun s -> files := !files @ [Intf_file s]), M.option_intf ;
   "-rectypes", Arg.Set recursive_types, M.rectypes ;
   "-nolabels", Arg.Unit (fun () -> classic := true), M.nolabels ;
   "-warn-error", Arg.Set Odoc_global.warn_error, M.werr ;
@@ -302,13 +308,25 @@ let add_option o =
   options := iter !options
 
 let parse ~html_generator ~latex_generator ~texi_generator ~man_generator ~dot_generator =
+  let anonymous f =
+    let sf = 
+      if Filename.check_suffix f "ml" then
+       Impl_file f
+      else
+       if Filename.check_suffix f "mli" then
+         Intf_file f
+       else
+         failwith (Odoc_messages.unknown_extension f)
+    in
+    files := !files @ [sf]
+  in
   default_html_generator := Some html_generator ;
   default_latex_generator := Some latex_generator ;
   default_texi_generator := Some texi_generator ;
   default_man_generator := Some man_generator ;
   default_dot_generator := Some dot_generator ;
   let _ = Arg.parse !options
-      (fun s -> files := !files @ [s])
+      anonymous
       (M.usage^M.options_are)
   in
   (* we sort the hidden modules by name, to be sure that for example,
@@ -317,4 +335,4 @@ let parse ~html_generator ~latex_generator ~texi_generator ~man_generator ~dot_g
   hidden_modules := List.sort (fun a -> fun b -> - (compare a b)) !hidden_modules
 
 
-(* eof $Id: odoc_args.ml,v 1.15.6.1 2004/07/09 14:32:42 guesdon Exp $ *)
+(* eof $Id: odoc_args.ml,v 1.15.6.2 2004/08/06 13:42:16 guesdon Exp $ *)
index 64b839ec6d3b1211f80ef7c7ae8e28dc1019f8e3..d81ed0b9f09ef288c002a44ce3e5637dceec7989 100644 (file)
@@ -9,10 +9,15 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_args.mli,v 1.12 2003/11/24 10:39:29 starynke Exp $ *)
+(* $Id: odoc_args.mli,v 1.12.6.1 2004/08/06 13:42:16 guesdon Exp $ *)
 
 (** Analysis of the command line arguments. *)
 
+(** The kind of source file in arguments. *)
+type source_file =
+    Impl_file of string
+  | Intf_file of string
+
 (** The include_dirs in the OCaml compiler. *)
 val include_dirs : string list ref
 
@@ -161,7 +166,7 @@ val man_suffix : string ref
 val man_mini : bool ref
 
 (** The files to be analysed. *)
-val files : string list ref
+val files : source_file list ref
     
 (** To set the documentation generator. *)
 val set_doc_generator : doc_generator option -> unit
index 71ba1fc6252bba1dd8e05674e1e4f640c20b3335..135a6dff5bbd3b08cad44d5c5d1d1f0edf405b19 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_html.ml,v 1.52.4.1 2004/06/25 13:39:16 guesdon Exp $ *)
+(* $Id: odoc_html.ml,v 1.52.4.2 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** Generation of html documentation. *)
 
@@ -653,15 +653,6 @@ let newline_to_indented_br s =
   done;
   Buffer.contents b
 
-let remove_last_newline s =
-  let len = String.length s in
-  if len <= 0 then
-    s
-  else
-    match s.[len-1] with
-      '\n' -> String.sub s 0 (len-1)
-    | _ -> s
-
 (** This class is used to create objects which can generate a simple html documentation. *)
 class html =
   object (self)
@@ -1060,7 +1051,7 @@ class html =
 
     (** Print html code to display a [Types.type_expr]. *)
     method html_of_type_expr b m_name t =
-      let s = remove_last_newline (Odoc_info.string_of_type_expr t) in
+      let s = Odoc_info.remove_ending_newline (Odoc_info.string_of_type_expr t) in
       let s2 = newline_to_indented_br s in
       bs b "<code class=\"type\">";
       bs b (self#create_fully_qualified_idents_links m_name s2);
@@ -1086,6 +1077,14 @@ class html =
       bs b (self#create_fully_qualified_idents_links m_name s2);
       bs b "]</code>"
 
+    method html_of_class_parameter_list b father c =
+      let s = Odoc_info.string_of_class_params c in
+      let s = Odoc_info.remove_ending_newline s in
+      let s2 = newline_to_indented_br s in
+      bs b "<code class=\"type\">";
+      bs b (self#create_fully_qualified_idents_links father s2);
+      bs b "</code>"
+
     (** Print html code to display a list of type parameters for the given type.*)
     method html_of_type_expr_param_list b m_name t =
       let s = Odoc_info.string_of_type_param_list t in
@@ -1096,7 +1095,7 @@ class html =
 
     (** Print html code to display a [Types.module_type]. *)
     method html_of_module_type b ?code m_name t =
-      let s = remove_last_newline (Odoc_info.string_of_module_type ?code t) in
+      let s = Odoc_info.remove_ending_newline (Odoc_info.string_of_module_type ?code t) in
       bs b "<code class=\"type\">";
       bs b (self#create_fully_qualified_module_idents_links m_name s);
       bs b "</code>"
@@ -1216,12 +1215,12 @@ class html =
 
     (** Generate a file containing the module type in the given file name. *)
     method output_module_type in_title file mtyp =
-      let s = remove_last_newline (Odoc_info.string_of_module_type ~complete: true mtyp) in
+      let s = Odoc_info.remove_ending_newline (Odoc_info.string_of_module_type ~complete: true mtyp) in
       self#output_code in_title file s
 
     (** Generate a file containing the class type in the given file name. *)
     method output_class_type in_title file ctyp =
-      let s = remove_last_newline(Odoc_info.string_of_class_type ~complete: true ctyp) in
+      let s = Odoc_info.remove_ending_newline (Odoc_info.string_of_class_type ~complete: true ctyp) in
       self#output_code in_title file s
 
     (** Print html code for a value. *)
@@ -1696,8 +1695,9 @@ class html =
                self#html_of_class_type_param_expr_list b father l;
               bs b " "
          );
-         self#html_of_text b
-           [Code (self#create_fully_qualified_idents_links father cco.cco_name)]
+         bs b "<code class=\"type\">";
+         bs b (self#create_fully_qualified_idents_links father cco.cco_name);
+         bs b "</code>"
 
       | Class_constraint (ck, ctk) ->
           self#html_of_text b [Code "( "] ;
@@ -1716,8 +1716,9 @@ class html =
               self#html_of_class_type_param_expr_list b father l;
               bs b " "
           );
-          self#html_of_text b
-           [Code (self#create_fully_qualified_idents_links father cta.cta_name)]
+          bs b "<code class=\"type\">";
+         bs b (self#create_fully_qualified_idents_links father cta.cta_name);
+         bs b "</code>"
 
       | Class_signature (inh, eles) -> 
          self#html_of_text b [Code "object"];
@@ -1737,16 +1738,6 @@ class html =
          );
          self#html_of_text b [Code "end"]
 
-    method html_of_class_parameter b father p =
-      self#html_of_type_expr b father (Parameter.typ p)
-
-    method html_of_class_parameter_list b father params =
-      List.iter
-       (fun p -> 
-         self#html_of_class_parameter b father p;
-         bs b " -&gt; ")
-       params
-
     (** Print html code for a class. *)
     method html_of_class b ?(complete=true) ?(with_link=true) c =
       let father = Name.father c.cl_name in
@@ -1783,7 +1774,7 @@ class html =
       );
 
       bs b " : " ;
-      self#html_of_class_parameter_list b father c.cl_parameters ;
+      self#html_of_class_parameter_list b father c ;
       self#html_of_class_kind b father ~cl: c c.cl_kind;
       bs b "</pre>" ;
       print_DEBUG "html#html_of_class : info" ;
@@ -2439,4 +2430,4 @@ class html =
 
 
                              
-(* eof $Id: odoc_html.ml,v 1.52.4.1 2004/06/25 13:39:16 guesdon Exp $ *)
+(* eof $Id: odoc_html.ml,v 1.52.4.2 2004/08/06 12:35:07 guesdon Exp $ *)
index c0df8a76f765632c788190e704a305f7274e2ccd..1936d43ff7cc0fa8b0141e07280032073960a464 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_info.ml,v 1.20 2004/05/23 10:41:50 guesdon Exp $ *)
+(* $Id: odoc_info.ml,v 1.20.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** Interface for analysing documented OCaml source files and to the collected information. *)
 
@@ -118,6 +118,8 @@ let string_of_variance t (co,cn) = Odoc_str.string_of_variance t (co, cn)
 
 let string_of_type_expr t = Odoc_print.string_of_type_expr t
 
+let string_of_class_params = Odoc_str.string_of_class_params
+
 let string_of_type_list ?par sep type_list = Odoc_str.string_of_type_list ?par sep type_list
 
 let string_of_type_param_list t = Odoc_str.string_of_type_param_list t
@@ -148,10 +150,14 @@ let first_sentence_and_rest_of_text = Odoc_misc.first_sentence_and_rest_of_text
 
 let text_no_title_no_list = Odoc_misc.text_no_title_no_list
 
+let text_concat = Odoc_misc.text_concat
+
 let get_titles_in_text = Odoc_misc.get_titles_in_text
 
 let create_index_lists = Odoc_misc.create_index_lists
 
+let remove_ending_newline = Odoc_misc.remove_ending_newline
+
 let remove_option = Odoc_misc.remove_option
 
 let is_optional = Odoc_misc.is_optional
index e6a3f645089d804906ad4ae7eedb2a8e11ef143a..0dcfb4d4aaee6a57963c66fdb8bf5b79d3141dcd 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_info.mli,v 1.36 2004/05/23 10:41:50 guesdon Exp $ *)
+(* $Id: odoc_info.mli,v 1.36.4.2 2004/08/06 13:42:16 guesdon Exp $ *)
 
 (** Interface to the information collected in source files. *)
 
@@ -580,26 +580,6 @@ module Module :
     val module_type_comments : ?trans:bool-> t_module_type -> text list
   end
 
-(** Analysis of the given source files.
-   @param init is the list of modules already known from a previous analysis.
-   @return the list of analysed top modules. *)
-val analyse_files :
-    ?merge_options:Odoc_types.merge_option list ->
-      ?include_dirs:string list ->
-        ?labels:bool ->
-          ?sort_modules:bool ->
-            ?no_stop:bool ->
-              ?init: Odoc_module.t_module list ->
-                string list ->
-                  Module.t_module list
-
-(** Dump of a list of modules into a file. 
-   @raise Failure if an error occurs.*)
-val dump_modules : string -> Odoc_module.t_module list -> unit
-
-(** Load of a list of modules from a file. 
-   @raise Failure if an error occurs.*)
-val load_modules : string -> Odoc_module.t_module list
 
 (** {3 Getting strings from values} *)
     
@@ -619,6 +599,10 @@ val string_of_variance : Type.t_type -> (bool * bool) -> string
 (** This function returns a string representing a Types.type_expr. *)
 val string_of_type_expr : Types.type_expr -> string
 
+(** @return a string to display the parameters of the given class,
+   in the same form as the compiler. *)
+val string_of_class_params : Class.t_class -> string
+
 (** This function returns a string to represent the given list of types,
    with a given separator. *)
 val string_of_type_list : ?par: bool -> string -> Types.type_expr list -> string
@@ -685,6 +669,10 @@ val first_sentence_and_rest_of_text : text -> text * text
 (** Return the given [text] without any title or list. *)
 val text_no_title_no_list : text -> text
 
+(** [concat sep l] concats the given list of text [l], each separated with
+   the text [sep]. *)
+val text_concat : Odoc_types.text -> Odoc_types.text list -> Odoc_types.text
+
 (** Return the list of titles in a [text]. 
    A title is a title level, an optional label and a text.*)
 val get_titles_in_text : text -> (int * string option * text) list
@@ -765,6 +753,8 @@ val info_string_of_info : info -> string
 *)
 val info_of_comment_file : string -> info
 
+(** [remove_ending_newline s] returns [s] without the optional ending newline. *)
+val remove_ending_newline : string -> string
 
 (** Research in elements *)
 module Search :
@@ -925,6 +915,11 @@ module Dep :
 (**  You can use this module to create custom generators.*)
 module Args :
     sig
+      (** The kind of source file in arguments. *)
+      type source_file =
+         Impl_file of string
+       | Intf_file of string
+
       (** The class type of documentation generators. *)
       class type doc_generator =
        object method generate : Module.t_module list -> unit end
@@ -1036,7 +1031,7 @@ module Args :
       val man_mini : bool ref
 
       (** The files to be analysed. *)
-      val files : string list ref
+      val files : source_file list ref
     
       (** To set the documentation generator. *)
       val set_doc_generator : doc_generator option -> unit
@@ -1044,3 +1039,24 @@ module Args :
       (** Add an option specification. *)
       val add_option : string * Arg.spec * string -> unit
     end
+
+(** Analysis of the given source files.
+   @param init is the list of modules already known from a previous analysis.
+   @return the list of analysed top modules. *)
+val analyse_files :
+    ?merge_options:Odoc_types.merge_option list ->
+      ?include_dirs:string list ->
+        ?labels:bool ->
+          ?sort_modules:bool ->
+            ?no_stop:bool ->
+              ?init: Odoc_module.t_module list ->
+                Args.source_file list ->
+                  Module.t_module list
+
+(** Dump of a list of modules into a file. 
+   @raise Failure if an error occurs.*)
+val dump_modules : string -> Odoc_module.t_module list -> unit
+
+(** Load of a list of modules from a file. 
+   @raise Failure if an error occurs.*)
+val load_modules : string -> Odoc_module.t_module list
index 0d1ca1931ca4c38cd003a04b0d59274e120e6d33..35991a416a7ce624b60facd52a6a7077f678bbf3 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_latex.ml,v 1.36.2.1 2004/07/09 10:42:09 guesdon Exp $ *)
+(* $Id: odoc_latex.ml,v 1.36.2.2 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** Generation of LaTeX documentation. *)
 
@@ -456,6 +456,10 @@ class latex =
          print_concat fmt ", " print_one t.ty_parameters;
          ps fmt ")"
 
+    method latex_of_class_parameter_list fmt father c =
+      self#latex_of_text fmt 
+       (self#text_of_class_params father c)
+
     (** Print LaTeX code for a type. *)
     method latex_of_type fmt t =
       let s_name = Name.simple t.ty_name in
@@ -633,16 +637,6 @@ class latex =
          (* TODO: on affiche quoi ? *)
          self#latex_of_module_kind fmt father k
 
-    method latex_of_class_parameter fmt father p =
-      ps fmt (self#normal_type father (Parameter.typ p))
-
-    method latex_of_class_parameter_list fmt father params =
-      List.iter
-       (fun p -> 
-         self#latex_of_class_parameter fmt father p;
-         ps fmt " -> ")
-       params
-
     method latex_of_class_kind fmt father kind =
       match kind with
         Class_structure (inh, eles) -> 
@@ -881,12 +875,23 @@ class latex =
        ] 
       in
       self#latex_of_text fmt t;
-      self#latex_of_class_parameter_list fmt father c.cl_parameters;
+      self#latex_of_class_parameter_list fmt father c;
+      (* avoid a big gap if the kind is a consrt *)
+      (
+       match c.cl_kind with
+        Class.Class_constr _ ->
+          self#latex_of_class_kind fmt father c.cl_kind
+       | _ ->
+          ()
+      );
       self#latex_of_text fmt [ Latex "\\end{ocamldoccode}\n" ];
       self#latex_for_class_label fmt c;
       self#latex_for_class_index fmt c;
       p fmt "@[<h 4>";
-      self#latex_of_class_kind fmt father c.cl_kind;
+      (match c.cl_kind with
+       Class.Class_constr _ -> ()
+      |        _ -> self#latex_of_class_kind fmt father c.cl_kind
+      );
       self#latex_of_text fmt [Newline];
       self#latex_of_info fmt ~block: true c.cl_info;
       p fmt "@]"
@@ -1125,4 +1130,4 @@ class latex =
           incr Odoc_info.errors 
   end
 
-(* eof $Id: odoc_latex.ml,v 1.36.2.1 2004/07/09 10:42:09 guesdon Exp $ *)
+(* eof $Id: odoc_latex.ml,v 1.36.2.2 2004/08/06 12:35:07 guesdon Exp $ *)
index 1a7c337bd5c0a7c0dad8e66bf2e74bd98c32c72c..27369325c5a9bbd6ada878e5cf17099620fb7807 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_messages.ml,v 1.24.4.2 2004/07/09 14:32:42 guesdon Exp $ *)
+(* $Id: odoc_messages.ml,v 1.24.4.3 2004/08/06 13:42:16 guesdon Exp $ *)
 
 (** The messages of the application. *)
 
@@ -36,6 +36,8 @@ let verbose_mode = "\t\tverbose mode"
 let include_dirs = "<dir>\tAdd <dir> to the list of include directories"
 let rectypes = "\tAllow arbitrary recursive types"
 let preprocess = "<command>\tPipe sources through preprocessor <command>"
+let option_impl ="<file>\tConsider <file> as a .ml file"
+let option_intf ="<file>\tConsider <file> as a .mli file"
 let display_custom_generators_dir = "\tDisplay custom generators standard directory and exit"
 let add_load_dir = "<dir>\tAdd the given directory to the search path for custom\n"^
   "\t\tgenerators "^bytecode_only
index a50b86d5e13216ab6d8245eaa7d50cbaf89572b3..e3bc664f5762057c742c7abbc98a536769528da5 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_misc.ml,v 1.17 2004/05/23 10:41:50 guesdon Exp $ *)
+(* $Id: odoc_misc.ml,v 1.17.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
 
 let input_file_as_string nom =
   let chanin = open_in_bin nom in
@@ -297,6 +297,13 @@ let get_titles_in_text t =
   iter_text t;
   List.rev !l
 
+let text_concat (sep : Odoc_types.text) l = 
+  let rec iter = function
+      [] -> []
+    | [last] -> last
+    | h :: q -> h @ sep @ (iter q)
+  in
+  iter l
 
 (*********************************************************)
 let rec get_before_dot s =
@@ -384,6 +391,15 @@ let first_sentence_and_rest_of_text t =
   let (_,t1, t2) = first_sentence_text t in
   (t1, t2)
 
+let remove_ending_newline s =
+  let len = String.length s in
+  if len <= 0 then
+    s
+  else
+    match s.[len-1] with
+      '\n' -> String.sub s 0 (len-1)
+    | _ -> s
+
 (*********************************************************)
 
 let create_index_lists elements string_of_ele =
@@ -415,17 +431,8 @@ let label_name = Btype.label_name
 let remove_option typ =
   let rec iter t =
     match t with
-    | Types.Tconstr (p,tlist,_) ->
-        (
-         match p with
-           Path.Pident id when Ident.name id = "option" ->
-             (
-              match tlist with
-                [t2] -> t2.Types.desc
-              | _ -> t
-             )
-         | _ -> t
-        )
+    | Types.Tconstr(path, [ty], _) when Path.same path Predef.path_option -> ty.Types.desc
+    | Types.Tconstr _
     | Types.Tvar
     | Types.Tunivar
     | Types.Tpoly _
@@ -440,4 +447,4 @@ let remove_option typ =
   in
   { typ with Types.desc = iter typ.Types.desc }
 
-(* eof $Id: odoc_misc.ml,v 1.17 2004/05/23 10:41:50 guesdon Exp $ *)
+(* eof $Id: odoc_misc.ml,v 1.17.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
index 5083c35ca77c9f99e3014b491a0d4034d7995131..eab8b0c1172522755d24722fa809e1230ac62389 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_misc.mli,v 1.10 2004/05/23 10:41:50 guesdon Exp $ *)
+(* $Id: odoc_misc.mli,v 1.10.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** Miscelaneous functions *)
 
@@ -75,6 +75,10 @@ val first_sentence_and_rest_of_text :
 (** Return the given [text] without any title or list. *)
 val text_no_title_no_list : Odoc_types.text -> Odoc_types.text
 
+(** [concat sep l] concats the given list of text [l], each separated with
+   the text [sep]. *)
+val text_concat : Odoc_types.text -> Odoc_types.text list -> Odoc_types.text
+
 (** Return the list of titles in a [text]. 
    A title is a title level, an optional label and a text.*)
 val get_titles_in_text : Odoc_types.text -> (int * string option * Odoc_types.text) list
@@ -86,6 +90,9 @@ val get_titles_in_text : Odoc_types.text -> (int * string option * Odoc_types.te
    begin with a letter should be in the first returned list.*)
 val create_index_lists : 'a list -> ('a -> string) -> 'a list list
 
+(** [remove_ending_newline s] returns [s] without the optional ending newline. *)
+val remove_ending_newline : string -> string
+
 (** Take a type and remove the option top constructor. This is
    useful when printing labels, we we then remove the top option contructor
    for optional labels.*)
index ca8095e9e1cd6f7a3453cc7292d9751a0f765207..f59318052c033026c1646d5c8f7cc1f6caf9a4e5 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_str.ml,v 1.9 2004/03/22 15:06:31 guesdon Exp $ *)
+(* $Id: odoc_str.ml,v 1.9.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** The functions to get a string from different kinds of elements (types, modules, ...). *)
 
@@ -115,6 +115,30 @@ let string_of_class_type_param_list l =
     )
     (if par then "]" else "")
 
+let string_of_class_params c =
+  let b = Buffer.create 256 in
+  let rec iter = function
+      Types.Tcty_fun (label, t, ctype) ->
+       Printf.bprintf b "%s%s -> "
+         (
+          match label with
+            "" -> ""
+          | s -> s^":"
+         )
+         (Odoc_print.string_of_type_expr
+            (if Odoc_misc.is_optional label then
+              Odoc_misc.remove_option t
+            else
+              t
+            )
+         );
+       iter ctype
+    | Types.Tcty_signature _ 
+    | Types.Tcty_constr _ -> ()
+  in
+  iter c.Odoc_class.cl_type;
+  Buffer.contents b
+
 let string_of_type t =
   let module M = Odoc_type in
   "type "^
@@ -231,4 +255,4 @@ let string_of_method m =
     None -> ""
   | Some i -> Odoc_misc.string_of_info i)
 
-(* eof $Id: odoc_str.ml,v 1.9 2004/03/22 15:06:31 guesdon Exp $ *)
+(* eof $Id: odoc_str.ml,v 1.9.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
index df6609119f92d37dff7a4b826a072b8b0b42cb0a..686ed6e2bd4ff58ca1dfb039462dfe663af49ad6 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_str.mli,v 1.5 2004/03/22 15:06:31 guesdon Exp $ *)
+(* $Id: odoc_str.mli,v 1.5.4.1 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** The functions to get a string from different kinds of elements (types, modules, ...). *)
 
@@ -34,6 +34,10 @@ val string_of_class_type_param_list : Types.type_expr list -> string
 (** @return a string to describe the given type. *)
 val string_of_type : Odoc_type.t_type -> string
 
+(** @return a string to display the parameters of the given class,
+   in the same form as the compiler. *)
+val string_of_class_params : Odoc_class.t_class -> string
+
 (** @return a string to describe the given exception. *)
 val string_of_exception : Odoc_exception.t_exception -> string
 
index 1e7fcc777e8e0cc0708c7334889821c2ac41a6f6..a0ef47693f895da49cb93c6401bad48493931c9a 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_to_text.ml,v 1.14.4.1 2004/07/09 10:42:10 guesdon Exp $ *)
+(* $Id: odoc_to_text.ml,v 1.14.4.2 2004/08/06 12:35:07 guesdon Exp $ *)
 
 (** Text generation.
 
@@ -206,24 +206,30 @@ class virtual to_text =
 
     (** Get a string for a [Types.class_type] where all idents are relative. *)
     method normal_class_type m_name t =
-      (self#relative_idents m_name (Odoc_info.string_of_class_type t))
+      self#relative_idents m_name (Odoc_info.string_of_class_type t)
 
     (** Get a string for a [Types.module_type] where all idents are relative. *)
     method normal_module_type ?code m_name t =
-      (self#relative_module_idents m_name (Odoc_info.string_of_module_type ?code t))
+      self#relative_module_idents m_name (Odoc_info.string_of_module_type ?code t)
 
     (** Get a string for a type where all idents are relative. *)
     method normal_type m_name t =
-      (self#relative_idents m_name (Odoc_info.string_of_type_expr t))
+      self#relative_idents m_name (Odoc_info.string_of_type_expr t)
 
     (** Get a string for a list of types where all idents are relative. *)
     method normal_type_list ?par m_name sep t =
-      (self#relative_idents m_name (Odoc_info.string_of_type_list ?par sep t))
+      self#relative_idents m_name (Odoc_info.string_of_type_list ?par sep t)
 
     (** Get a string for a list of class or class type type parameters
        where all idents are relative. *)
     method normal_class_type_param_list m_name t =
-      (self#relative_idents m_name (Odoc_info.string_of_class_type_param_list t))
+      self#relative_idents m_name (Odoc_info.string_of_class_type_param_list t)
+
+    (** Get a string for the parameters of a class (with arrows) where all idents are relative. *)
+    method normal_class_params m_name c =
+      let s = Odoc_info.string_of_class_params c in
+      self#relative_idents m_name 
+       (Odoc_info.remove_ending_newline s)
 
     (** @return [text] value to represent a [Types.type_expr].*)
     method text_of_type_expr module_name t =
@@ -250,6 +256,17 @@ class virtual to_text =
     method text_of_class_type_param_expr_list module_name l =
       [ Code (self#normal_class_type_param_list module_name l) ]        
 
+    (** @return [text] value to represent parameters of a class (with arraows).*)
+    method text_of_class_params module_name c =
+      let t = Odoc_info.text_concat 
+         [Newline]
+          (List.map
+             (fun s -> [Code s])
+            (Str.split (Str.regexp "\n") 
+                (self#normal_class_params module_name c))
+         )
+      in
+      t
 
     (** @return [text] value to represent a [Types.module_type]. *)
     method text_of_module_type t =
index d07a647fd4fd7473636ef0823396ba1b810bb24b..ab9d344bcb6fbdd095f31f2f6cc1d6357bc7be74 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: hashtbl.mli,v 1.35 2004/03/23 12:37:06 starynke Exp $ *)
+(* $Id: hashtbl.mli,v 1.35.4.1 2004/08/10 15:30:29 doligez Exp $ *)
 
 (** Hash tables and hash functions.
 
@@ -118,7 +118,7 @@ module type HashedType =
           for comparing objects by structure and handling {!Pervasives.nan}
           correctly, and
           ([(==)], {!Hashtbl.hash}) for comparing objects by addresses
-          (e.g. for mutable or cyclic keys). *)
+          (e.g. for or cyclic keys). *)
    end
 (** The input signature of the functor {!Hashtbl.Make}. *)
 
index d45848173dff6b2165cbef0a1338233212c77a85..0c20f087341f6b2cc21dc6b54ba57c84464e7d11 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: sys.ml,v 1.101.2.5 2004/07/13 08:21:54 xleroy Exp $ *)
+(* $Id: sys.ml,v 1.101.2.7 2004/08/19 12:52:17 doligez Exp $ *)
 
 (* System interface *)
 
@@ -78,4 +78,4 @@ let catch_break on =
 
 (* OCaml version string, must be in the format described in sys.mli. *)
 
-let ocaml_version = "3.08.0";;
+let ocaml_version = "3.08.1";;
index 38b8dc9ce52bfe8af97f97a0e27396af9af5903c..4324234dc44f95ed1cffae871a208d497a19b555 100644 (file)
@@ -14,7 +14,7 @@
 /* Began 14 Sept 2003 - watford@uiuc.edu                               */
 /***********************************************************************/
 
-/* $Id: ocaml.c,v 1.7 2004/06/17 07:33:44 xleroy Exp $ */
+/* $Id: ocaml.c,v 1.7.2.1 2004/08/09 08:51:09 xleroy Exp $ */
 
 /*@@ Wedit generated application. Written Sat Jun 02 18:22:38 2001
 @@header: D:\lcc\inria\inriares.h
@@ -951,13 +951,17 @@ Output:
 Errors:
 --------------------------------------------------------------------------
 Edit History:
+     7 Aug  2004 - Chris Watford christopher.watford@gmail.com
+               - Fixed error where SendLastEditBuffer sent waaaay too many
+               newlines which completely broke the underlying connection to the
+               ocaml.exe pipe
        15 Sept 2003 - Chris Watford watford@uiuc.edu
                - Sends line to the pipe and adds newline to the end
 ------------------------------------------------------------------------*/
 void SendLastEditBuffer(HWND hwndChild)
 {
        char* line = editbuffer_getasbuffer(CurrentEditBuffer);
-       int l = strlen(line);
+       int l = strlen(line) - 1;
        char* linebuffer = (char*)SafeMalloc(l+2);
 
        // save current edit buffer to history and create a new blank edit buffer
@@ -967,10 +971,15 @@ void SendLastEditBuffer(HWND hwndChild)
        CurrentEditBuffer->LineCount = 0;
        CurrentEditBuffer->Lines = NULL;
 
-       // add the newline to the end
-       strncpy(linebuffer, line, l);
-       linebuffer[l] = '\n';
-       linebuffer[l+1] = '\0';
+       // trim and add the newline to the end
+       strncpy(linebuffer, line, l+1);
+       while((linebuffer[l] == '\n' || linebuffer[l] == '\r') && (l >= 0))
+       {
+               linebuffer[l--] = '\0';
+       }
+
+       linebuffer[l+1] = '\n';
+       linebuffer[l+2] = '\0';
 
        // save line to the pipe
        WriteToPipe(linebuffer);
@@ -985,6 +994,10 @@ Output:        None explicit
 Errors:        None
 --------------------------------------------------------------------------
 Edit History:
+        7 Aug  2004 - Chris Watford christopher.watford@gmail.com
+               - Fixed bug #2932 where many carraige returns were sent and it came
+               back with a null pointer error due to a fault of not checking if
+               the line returned was NULL
        13 Oct  2003 - Chris Watford watford@uiuc.edu
                - Solved the error when you have a malformed comment in the buffer
 ------------------------------------------------------------------------*/
@@ -992,7 +1005,16 @@ BOOL SendingFullCommand(void)
 {
        // if there is a ;; on the line, return true
        char *line = editbuffer_getasline(CurrentEditBuffer);
-       char *firstComment = strstr(line, "(*"), *firstSemiColonSemiColon = strstr(line, ";;");
+       char *firstComment, *firstSemiColonSemiColon, *firstQuote;
+
+       if(line == NULL)
+       {
+               return FALSE;
+       }
+
+       firstComment = strstr(line, "(*");
+       firstSemiColonSemiColon = strstr(line, ";;");
+       firstQuote = strstr(line, "\"");
 
        // easy case :D
        if(firstSemiColonSemiColon == NULL)
@@ -1004,9 +1026,51 @@ BOOL SendingFullCommand(void)
        // if there are no comments
        if(firstComment == NULL)
        {
-               BOOL r = (firstSemiColonSemiColon != NULL);
-               free(line);
-               return r;
+               // if there are no quotations used
+               if(firstQuote == NULL)
+               {
+                       BOOL r = (firstSemiColonSemiColon != NULL);
+                       free(line);
+                       return r;
+               } else {
+                       // we need to first check if the ;; is before the \", since the \"
+                       // won't matter if its before the semicolonsemicolon
+                       if(firstQuote < firstSemiColonSemiColon)
+                       {
+                               // the quote is before the ;;, we need to make sure its terminated
+                               // also we have to check for escaped quotes, le sigh!
+                               char *c = firstQuote+1;
+                               BOOL in_quote = TRUE;
+                               
+                               // in-quote determiner loop
+                               while(c[0] != '\0')
+                               {
+                                       // are we a backslash?
+                                       if(c[0] == '\\')
+                                       {
+                                               // ignore the next character
+                                               c++;
+                                       }
+                                       else
+                                       {
+                                                       // are we a quote?
+                                               if(c[0] == '"')
+                                               {
+                                                       in_quote = !in_quote;
+                                               }
+                                       }
+
+                                       c++;
+                               }
+
+                               free(line);
+                               return !in_quote;
+                       } else {
+                               BOOL r = (firstSemiColonSemiColon != NULL);
+                               free(line);
+                               return r;
+                       }
+               }
        } else {
                // we have to search through finding all comments