From d6c51c2a46bb2fdeab5554e735682eb84b386472 Mon Sep 17 00:00:00 2001 From: Sven Luther Date: Thu, 19 Aug 2004 15:12:25 +0000 Subject: [PATCH] Imported Upstream version 3.08.1 --- Changes | 31 ++- LICENSE | 18 +- Makefile | 6 +- asmcomp/asmpackager.ml | 15 +- boot/ocamlc | Bin 967072 -> 967058 bytes boot/ocamllex | Bin 152462 -> 152776 bytes byterun/.cvsignore | 1 + byterun/Makefile | 11 +- byterun/dynlink.c | 2 +- byterun/dynlink.h | 2 +- byterun/obj.c | 19 +- byterun/osdeps.h | 2 +- byterun/unix.c | 67 +++++- camlp4/camlp4/Makefile | 15 +- camlp4/config/configure_batch | 11 +- camlp4/etc/pa_o.ml | 33 +-- camlp4/lib/Makefile | 8 +- camlp4/lib/plexer.ml | 4 +- camlp4/man/camlp4.1.tpl | 75 +++---- camlp4/ocaml_src/camlp4/Makefile | 13 +- camlp4/ocaml_src/lib/Makefile | 8 +- camlp4/ocaml_src/lib/plexer.ml | 2 +- camlp4/ocaml_src/meta/Makefile | 5 +- camlp4/ocaml_src/odyl/.depend | 4 +- camlp4/ocaml_src/odyl/Makefile | 11 +- camlp4/odyl/Makefile | 13 +- configure | 17 +- emacs/COPYING | 340 +++++++++++++++++++++++++++++++ emacs/Makefile | 14 +- emacs/caml-compat.el | 14 ++ emacs/caml-emacs.el | 14 ++ emacs/caml-font.el | 14 ++ emacs/caml-help.el | 14 ++ emacs/caml-hilit.el | 14 ++ emacs/caml-types.el | 4 +- emacs/caml-xemacs.el | 14 ++ emacs/caml.el | 14 ++ emacs/camldebug.el | 14 ++ emacs/inf-caml.el | 14 ++ emacs/ocamltags.in | 16 +- lex/main.ml | 9 +- ocamldoc/Changes.txt | 8 +- ocamldoc/odoc_analyse.ml | 81 ++++---- ocamldoc/odoc_analyse.mli | 4 +- ocamldoc/odoc_args.ml | 24 ++- ocamldoc/odoc_args.mli | 9 +- ocamldoc/odoc_html.ml | 51 ++--- ocamldoc/odoc_info.ml | 8 +- ocamldoc/odoc_info.mli | 60 ++++-- ocamldoc/odoc_latex.ml | 33 +-- ocamldoc/odoc_messages.ml | 4 +- ocamldoc/odoc_misc.ml | 33 +-- ocamldoc/odoc_misc.mli | 9 +- ocamldoc/odoc_str.ml | 28 ++- ocamldoc/odoc_str.mli | 6 +- ocamldoc/odoc_to_text.ml | 29 ++- stdlib/hashtbl.mli | 4 +- stdlib/sys.ml | 4 +- win32caml/ocaml.c | 84 +++++++- 59 files changed, 1086 insertions(+), 295 deletions(-) create mode 100644 emacs/COPYING diff --git a/Changes b/Changes index 1d26ffcb..c8c2fd74 100644 --- 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 bd3dbe83..fce2fad2 100644 --- 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. ---------------------------------------------------------------------- diff --git a/Makefile b/Makefile index 7a368ecb..09050168 100644 --- 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 diff --git a/asmcomp/asmpackager.ml b/asmcomp/asmpackager.ml index ea2db5d9..2617de5a 100644 --- a/asmcomp/asmpackager.ml +++ b/asmcomp/asmpackager.ml @@ -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 = diff --git a/boot/ocamlc b/boot/ocamlc index 5ff5ffc9631e210b674b62fbfe4c5d84a7360666..93fa1f8875c43a8bb9583f9ab2f856a02238d204 100755 GIT binary patch delta 374 zcmZ3`Y(1&jx}k-!g{g(Pg{6hHg{_6Xg`pBlRGo#`5MYnh+vvP7fUSI%&?RF1%a+#HV)02}Gbkp+kbyHH)Qj2s8@(UDnfxP5` z0^Ne5)a3l!g6RfNc(lz`Knjg?bCOGoic^afbaM(yGKx|YQ#c*LCWI&EpBlRGo!)wMYnh+vvTqVhX1dP~r4*k9o9xu^FZUGDZ__fLcz9f^Lxlj4DdZ%gIdA)-NqC(of3F)6dH_ zfU&2~d%{yGu99hNVWtjrb7E;uiDph_UTH;qYED|a)>EGCT2FcVZ5Vl`?^5J@!^pFJ zxe}j_D9qy@?5E!`=Tid;Gh6Vj(-eY+#|L{jWBTDlz8FrPeM=0Z+(WP0Z`VlT^Nd%# k9USTF#K6EF;T+@~%)r1k9~g}6&WX7>hL)C=5e5bp0B!Gow*UYD diff --git a/boot/ocamllex b/boot/ocamllex index e41b767ccfa08f1a53146aa356b177852cb85720..4144bdd978c1ab3d9b90c1d9350a5d3aadfee62e 100755 GIT binary patch delta 678 zcmeBM&Us=bXTui8LqAyOFfuTRP0v2gD8K#L55_mFuBHqO42yw+7C>4Bh^2s75s1x! z*c*uDff!vb8A(hI$X1-Z{=YaQ)AaNI7`5w{01e{=3Tgu}2;BPr|9=LMHUr|NKsg>D zZ4bmC01{gU6mtag7#JL&G)R0o7PTvIs9gyZ2RYK0k)fV}9moJ#zy!n~gI3|tv>GVR z2b2dn6v$*)33Mn(9}5tJ^sT|6Z!J(<04R@a$2z!LX@oC8KII2um<3(aSN~^}p6oYI zhLL^xbwV;y75tO3Qj<$E%Tg7b z6LWJEa#AZ&ixkpR^HPfvOY)0!6v|SIiZk=`6sAA(W>U2=R|qJ|%qxM5Cg!Cmq*i2> zXy`)K;ZmTaTQ;5Bhv^98#_1P)nEo)XpMKVtX+PtJ?Y(|XVN3#9^(U()&RD~3@{sGj foa+0H+dl^|MKUol%1rkQW|CvF@|d0%%%lJS-(7`v delta 352 zcmX@HlCy6)XTui8LqAws7#SGEre_~#l;8gB2jd&o=~0=C64Sl@GYar721;cxFff<_ z@sjE1|1(NwE(HoX0=XdI045>Q%Yfp%K)yB*1DOoB|NsAQ52RUu7^HnU4t* $(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" \ diff --git a/byterun/dynlink.c b/byterun/dynlink.c index cbbf5ea3..d93aafbb 100644 --- a/byterun/dynlink.c +++ b/byterun/dynlink.c @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id$ */ +/* $Id: dynlink.c,v 1.14 2004/02/22 15:07:51 xleroy Exp $ */ /* Dynamic loading of C primitives. */ diff --git a/byterun/dynlink.h b/byterun/dynlink.h index ad4bfbad..6b4f3014 100644 --- a/byterun/dynlink.h +++ b/byterun/dynlink.h @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id$ */ +/* $Id: dynlink.h,v 1.8 2004/02/22 15:07:51 xleroy Exp $ */ /* Dynamic loading of C primitives. */ diff --git a/byterun/obj.c b/byterun/obj.c index 54d9c541..b1938aad 100644 --- a/byterun/obj.c +++ b/byterun/obj.c @@ -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 $ */ diff --git a/byterun/osdeps.h b/byterun/osdeps.h index beddd9b7..12c608c0 100644 --- a/byterun/osdeps.h +++ b/byterun/osdeps.h @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id$ */ +/* $Id: osdeps.h,v 1.9 2004/01/02 19:23:25 doligez Exp $ */ /* Operating system - specific stuff */ diff --git a/byterun/unix.c b/byterun/unix.c index 2f3e2ecc..56c143cf 100644 --- a/byterun/unix.c +++ b/byterun/unix.c @@ -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) diff --git a/camlp4/camlp4/Makefile b/camlp4/camlp4/Makefile index 40b3dae4..306bd5a7 100644 --- a/camlp4/camlp4/Makefile +++ b/camlp4/camlp4/Makefile @@ -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 diff --git a/camlp4/config/configure_batch b/camlp4/config/configure_batch index fbaf719f..d627ae1b 100755 --- a/camlp4/config/configure_batch +++ b/camlp4/config/configure_batch @@ -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 diff --git a/camlp4/etc/pa_o.ml b/camlp4/etc/pa_o.ml index 0b85954b..651b6051 100644 --- a/camlp4/etc/pa_o.ml +++ b/camlp4/etc/pa_o.ml @@ -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$ >> diff --git a/camlp4/lib/Makefile b/camlp4/lib/Makefile index 5e26f419..f648e4aa 100644 --- a/camlp4/lib/Makefile +++ b/camlp4/lib/Makefile @@ -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 diff --git a/camlp4/lib/plexer.ml b/camlp4/lib/plexer.ml index a1cd5231..6acc85e0 100644 --- a/camlp4/lib/plexer.ml +++ b/camlp4/lib/plexer.ml @@ -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 diff --git a/camlp4/man/camlp4.1.tpl b/camlp4/man/camlp4.1.tpl index b40b5f9f..ff8c6504 100644 --- a/camlp4/man/camlp4.1.tpl +++ b/camlp4/man/camlp4.1.tpl @@ -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 diff --git a/camlp4/ocaml_src/camlp4/Makefile b/camlp4/ocaml_src/camlp4/Makefile index 94363f41..d7760659 100644 --- a/camlp4/ocaml_src/camlp4/Makefile +++ b/camlp4/ocaml_src/camlp4/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 diff --git a/camlp4/ocaml_src/lib/Makefile b/camlp4/ocaml_src/lib/Makefile index 722430e1..37fa4fbb 100644 --- a/camlp4/ocaml_src/lib/Makefile +++ b/camlp4/ocaml_src/lib/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 + 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 diff --git a/camlp4/ocaml_src/lib/plexer.ml b/camlp4/ocaml_src/lib/plexer.ml index e1044808..163929bd 100644 --- a/camlp4/ocaml_src/lib/plexer.ml +++ b/camlp4/ocaml_src/lib/plexer.ml @@ -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 diff --git a/camlp4/ocaml_src/meta/Makefile b/camlp4/ocaml_src/meta/Makefile index d0b3cd51..a66dcd75 100644 --- a/camlp4/ocaml_src/meta/Makefile +++ b/camlp4/ocaml_src/meta/Makefile @@ -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 diff --git a/camlp4/ocaml_src/odyl/.depend b/camlp4/ocaml_src/odyl/.depend index c09099d3..3f125b7d 100644 --- a/camlp4/ocaml_src/odyl/.depend +++ b/camlp4/ocaml_src/odyl/.depend @@ -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 diff --git a/camlp4/ocaml_src/odyl/Makefile b/camlp4/ocaml_src/odyl/Makefile index 07d5c6b2..d165e692 100644 --- a/camlp4/ocaml_src/odyl/Makefile +++ b/camlp4/ocaml_src/odyl/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 diff --git a/camlp4/odyl/Makefile b/camlp4/odyl/Makefile index f9808ad9..37976743 100644 --- a/camlp4/odyl/Makefile +++ b/camlp4/odyl/Makefile @@ -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 diff --git a/configure b/configure index 385676ab..ce500436 100755 --- 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 index 00000000..5b6e7c66 --- /dev/null +++ b/emacs/COPYING @@ -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. + + 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.) + +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. + + 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. + + 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 + + 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. + + + Copyright (C) + + 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. + + , 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. diff --git a/emacs/Makefile b/emacs/Makefile index 4ef434c3..fdf07981 100644 --- a/emacs/Makefile +++ b/emacs/Makefile @@ -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 diff --git a/emacs/caml-compat.el b/emacs/caml-compat.el index 63b4a480..d7bad84d 100644 --- a/emacs/caml-compat.el +++ b/emacs/caml-compat.el @@ -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 diff --git a/emacs/caml-emacs.el b/emacs/caml-emacs.el index 5f35c245..8b7ed359 100644 --- a/emacs/caml-emacs.el +++ b/emacs/caml-emacs.el @@ -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) diff --git a/emacs/caml-font.el b/emacs/caml-font.el index 628a757e..8454aa35 100644 --- a/emacs/caml-font.el +++ b/emacs/caml-font.el @@ -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 diff --git a/emacs/caml-help.el b/emacs/caml-help.el index ea082bf2..92735aca 100644 --- a/emacs/caml-help.el +++ b/emacs/caml-help.el @@ -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. diff --git a/emacs/caml-hilit.el b/emacs/caml-hilit.el index 7b48a811..c4160d95 100644 --- a/emacs/caml-hilit.el +++ b/emacs/caml-hilit.el @@ -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 diff --git a/emacs/caml-types.el b/emacs/caml-types.el index 571d2387..6870658f 100644 --- a/emacs/caml-types.el +++ b/emacs/caml-types.el @@ -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. diff --git a/emacs/caml-xemacs.el b/emacs/caml-xemacs.el index ff493915..aa5ef7f9 100644 --- a/emacs/caml-xemacs.el +++ b/emacs/caml-xemacs.el @@ -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 diff --git a/emacs/caml.el b/emacs/caml.el index 8e6da6a2..16958cb7 100644 --- a/emacs/caml.el +++ b/emacs/caml.el @@ -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. diff --git a/emacs/camldebug.el b/emacs/camldebug.el index c66343a4..146a307a 100644 --- a/emacs/camldebug.el +++ b/emacs/camldebug.el @@ -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 diff --git a/emacs/inf-caml.el b/emacs/inf-caml.el index f24a7a71..b9da36f4 100644 --- a/emacs/inf-caml.el +++ b/emacs/inf-caml.el @@ -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. diff --git a/emacs/ocamltags.in b/emacs/ocamltags.in index 79873c90..2bcadf44 100644 --- a/emacs/ocamltags.in +++ b/emacs/ocamltags.in @@ -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 ;; 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) diff --git a/lex/main.ml b/lex/main.ml index e87359fe..a877b4d9 100644 --- a/lex/main.ml +++ b/lex/main.ml @@ -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), " Set output file name to "; "-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 _ = diff --git a/ocamldoc/Changes.txt b/ocamldoc/Changes.txt index e4b6bfe5..e7f1045b 100644 --- a/ocamldoc/Changes.txt +++ b/ocamldoc/Changes.txt @@ -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) diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml index 98cfb3ac..84e37ba4 100644 --- a/ocamldoc/odoc_analyse.ml +++ b/ocamldoc/odoc_analyse.ml @@ -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 $ *) diff --git a/ocamldoc/odoc_analyse.mli b/ocamldoc/odoc_analyse.mli index c2b7165c..c6ea20bc 100644 --- a/ocamldoc/odoc_analyse.mli +++ b/ocamldoc/odoc_analyse.mli @@ -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. diff --git a/ocamldoc/odoc_args.ml b/ocamldoc/odoc_args.ml index 4e7601ff..9b79f589 100644 --- a/ocamldoc/odoc_args.ml +++ b/ocamldoc/odoc_args.ml @@ -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 $ *) diff --git a/ocamldoc/odoc_args.mli b/ocamldoc/odoc_args.mli index 64b839ec..d81ed0b9 100644 --- a/ocamldoc/odoc_args.mli +++ b/ocamldoc/odoc_args.mli @@ -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 diff --git a/ocamldoc/odoc_html.ml b/ocamldoc/odoc_html.ml index 71ba1fc6..135a6dff 100644 --- a/ocamldoc/odoc_html.ml +++ b/ocamldoc/odoc_html.ml @@ -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 ""; 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 "]" + 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 ""; + bs b (self#create_fully_qualified_idents_links father s2); + bs b "" + (** 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 ""; bs b (self#create_fully_qualified_module_idents_links m_name s); bs b "" @@ -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 ""; + bs b (self#create_fully_qualified_idents_links father cco.cco_name); + bs b "" | 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 ""; + bs b (self#create_fully_qualified_idents_links father cta.cta_name); + bs b "" | 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 " -> ") - 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 "" ; 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 $ *) diff --git a/ocamldoc/odoc_info.ml b/ocamldoc/odoc_info.ml index c0df8a76..1936d43f 100644 --- a/ocamldoc/odoc_info.ml +++ b/ocamldoc/odoc_info.ml @@ -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 diff --git a/ocamldoc/odoc_info.mli b/ocamldoc/odoc_info.mli index e6a3f645..0dcfb4d4 100644 --- a/ocamldoc/odoc_info.mli +++ b/ocamldoc/odoc_info.mli @@ -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 diff --git a/ocamldoc/odoc_latex.ml b/ocamldoc/odoc_latex.ml index 0d1ca193..35991a41 100644 --- a/ocamldoc/odoc_latex.ml +++ b/ocamldoc/odoc_latex.ml @@ -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 "@["; - 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 $ *) diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml index 1a7c337b..27369325 100644 --- a/ocamldoc/odoc_messages.ml +++ b/ocamldoc/odoc_messages.ml @@ -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 = "\tAdd to the list of include directories" let rectypes = "\tAllow arbitrary recursive types" let preprocess = "\tPipe sources through preprocessor " +let option_impl ="\tConsider as a .ml file" +let option_intf ="\tConsider as a .mli file" let display_custom_generators_dir = "\tDisplay custom generators standard directory and exit" let add_load_dir = "\tAdd the given directory to the search path for custom\n"^ "\t\tgenerators "^bytecode_only diff --git a/ocamldoc/odoc_misc.ml b/ocamldoc/odoc_misc.ml index a50b86d5..e3bc664f 100644 --- a/ocamldoc/odoc_misc.ml +++ b/ocamldoc/odoc_misc.ml @@ -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 $ *) diff --git a/ocamldoc/odoc_misc.mli b/ocamldoc/odoc_misc.mli index 5083c35c..eab8b0c1 100644 --- a/ocamldoc/odoc_misc.mli +++ b/ocamldoc/odoc_misc.mli @@ -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.*) diff --git a/ocamldoc/odoc_str.ml b/ocamldoc/odoc_str.ml index ca8095e9..f5931805 100644 --- a/ocamldoc/odoc_str.ml +++ b/ocamldoc/odoc_str.ml @@ -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 $ *) diff --git a/ocamldoc/odoc_str.mli b/ocamldoc/odoc_str.mli index df660911..686ed6e2 100644 --- a/ocamldoc/odoc_str.mli +++ b/ocamldoc/odoc_str.mli @@ -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 diff --git a/ocamldoc/odoc_to_text.ml b/ocamldoc/odoc_to_text.ml index 1e7fcc77..a0ef4769 100644 --- a/ocamldoc/odoc_to_text.ml +++ b/ocamldoc/odoc_to_text.ml @@ -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 = diff --git a/stdlib/hashtbl.mli b/stdlib/hashtbl.mli index d07a647f..ab9d344b 100644 --- a/stdlib/hashtbl.mli +++ b/stdlib/hashtbl.mli @@ -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}. *) diff --git a/stdlib/sys.ml b/stdlib/sys.ml index d4584817..0c20f087 100644 --- a/stdlib/sys.ml +++ b/stdlib/sys.ml @@ -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";; diff --git a/win32caml/ocaml.c b/win32caml/ocaml.c index 38b8dc9c..4324234d 100644 --- a/win32caml/ocaml.c +++ b/win32caml/ocaml.c @@ -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 -- 2.30.2