-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 "*" )
* 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 $
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
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.
----------------------------------------------------------------------
# #
#########################################################################
-# $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
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
(* *)
(***********************************************************************)
-(* $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. *)
"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")
*)
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 =
opnames.h
ocamlrun
ocamlrund
+ld.conf
libcamlrun.x
libcamlrun-gui.x
*.c.x
# #
#########################################################################
-# $Id: Makefile,v 1.48 2004/05/09 10:37:27 xleroy Exp $
+# $Id: Makefile,v 1.48.4.1 2004/07/16 16:11:33 doligez Exp $
include ../config/Makefile
PUBLIC_INCLUDES=alloc.h callback.h config.h custom.h fail.h intext.h \
memory.h misc.h mlvalues.h signals.h compatibility.h
-all: ocamlrun$(EXE)
+all: ocamlrun$(EXE) ld.conf
ocamlrun$(EXE): libcamlrun.a prims.o
$(BYTECC) $(BYTECCCOMPOPTS) $(BYTECCLINKOPTS) -o ocamlrun$(EXE) \
for i in $(PUBLIC_INCLUDES); do \
sed -f ../tools/cleanup-header $$i > $(LIBDIR)/caml/$$i; \
done
+ cp ld.conf $(LIBDIR)/ld.conf
+
+ld.conf:
+ echo "$(STUBLIBDIR)" >ld.conf
+ echo "$(LIBDIR)" >>ld.conf
libcamlrun.a: $(OBJS)
ar rc libcamlrun.a $(OBJS)
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" \
/* */
/***********************************************************************/
-/* $Id$ */
+/* $Id: dynlink.c,v 1.14 2004/02/22 15:07:51 xleroy Exp $ */
/* Dynamic loading of C primitives. */
/* */
/***********************************************************************/
-/* $Id$ */
+/* $Id: dynlink.h,v 1.8 2004/02/22 15:07:51 xleroy Exp $ */
/* Dynamic loading of C primitives. */
/* */
/***********************************************************************/
-/* $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 */
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);
}
}
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))
}
#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 $ */
/* */
/***********************************************************************/
-/* $Id$ */
+/* $Id: osdeps.h,v 1.9 2004/01/02 19:23:25 doligez Exp $ */
/* Operating system - specific stuff */
/* */
/***********************************************************************/
-/* $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 */
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:
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)
-# $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
$(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
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
#! /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=''
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
(* *)
(***********************************************************************)
-(* $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;
<: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$ ] >>
;
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$) >> ] ]
;
;
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:
| 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
| "{"; 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
in
Pcaml.handle_patt_quotation loc x ] ]
;
+
patt_semi_list:
[ [ p = patt; ";"; pl = SELF -> [p :: pl]
| p = patt; ";" -> [p]
[ [ "="; 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:
| "["; 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$ >> ] ]
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$ >>
-# $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
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
(* *)
(***********************************************************************)
-(* $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;
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
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
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
.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.
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
.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
.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.
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
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:
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
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
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
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"
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 \\
.fi
.SH "FILES"
-Camlp4 library directory in the present installation:
+Camlp4 library directory in the current installation:
.br
LIBDIR/camlp4
$(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
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
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
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
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
-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
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
-# $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
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
# #
#########################################################################
-# $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
*,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"
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"
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
-# $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
+;(***********************************************************************)
+;(* *)
+;(* 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
+;(***********************************************************************)
+;(* *)
+;(* 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)
+;(***********************************************************************)
+;(* *)
+;(* 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
+;(***********************************************************************)
+;(* *)
+;(* 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.
+;(***********************************************************************)
+;(* *)
+;(* 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
;(* *)
;(* 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.
+;(***********************************************************************)
+;(* *)
+;(* 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
+;(***********************************************************************)
+;(* *)
+;(* 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.
+;(***********************************************************************)
+;(* *)
+;(* 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
+;(***********************************************************************)
+;(* *)
+;(* 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.
":" ; @EMACS@ -batch -l $0 "$@" ; status=$? ; : '--*-Emacs-Lisp-*--' <<';'
+;(***********************************************************************)
+;(* *)
+;(* Objective Caml *)
+;(* *)
+;(* Jacques Garrigue and Ian T Zimmerman *)
+;(* *)
+;(* Copyright 1998 Institut National de Recherche en Informatique et *)
+;(* en Automatique. All rights reserved. This file is distributed *)
+;(* under the terms of the GNU General Public License. *)
+;(* *)
+;(***********************************************************************)
+
+;(* $Id: ocamltags.in,v 1.5.18.1 2004/08/09 16:09:33 doligez Exp $ *)
+
;; Copyright (C) 1998 Ian Zimmerman <itz@transbay.net>
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; 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)
(* *)
(***********************************************************************)
-(* $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. *)
let usage = "usage: ocamlex [options] sourcefile"
+let print_version_string () =
+ print_string "The Objective Caml lexer generator, version ";
+ print_string Sys.ocaml_version ; print_newline();
+ exit 0
+
let specs =
["-ml", Arg.Set ml_automata,
" Output code that does not use the Lexing module built-in automata interpreter";
"-o", Arg.String (fun x -> output_name := Some x),
" <file> Set output file name to <file>";
"-q", Arg.Set Common.quiet_mode, " Do not display informational messages";
+ "-v", Arg.Unit print_version_string, " Print version and exit";
+ "-version", Arg.Unit print_version_string, " Print version and exit";
]
let _ =
- 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)
(* *)
(***********************************************************************)
-(* $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 :-) *)
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),
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 ;
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 =
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 $ *)
(* *)
(***********************************************************************)
-(* $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. *)
*)
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.
(* *)
(***********************************************************************)
-(* 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. *)
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
"-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 ;
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,
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 $ *)
(* *)
(***********************************************************************)
-(* $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
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
(* *)
(***********************************************************************)
-(* $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. *)
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)
(** Print html code to display a [Types.type_expr]. *)
method html_of_type_expr b m_name t =
- let s = remove_last_newline (Odoc_info.string_of_type_expr t) in
+ let s = Odoc_info.remove_ending_newline (Odoc_info.string_of_type_expr t) in
let s2 = newline_to_indented_br s in
bs b "<code class=\"type\">";
bs b (self#create_fully_qualified_idents_links m_name s2);
bs b (self#create_fully_qualified_idents_links m_name s2);
bs b "]</code>"
+ method html_of_class_parameter_list b father c =
+ let s = Odoc_info.string_of_class_params c in
+ let s = Odoc_info.remove_ending_newline s in
+ let s2 = newline_to_indented_br s in
+ bs b "<code class=\"type\">";
+ bs b (self#create_fully_qualified_idents_links father s2);
+ bs b "</code>"
+
(** Print html code to display a list of type parameters for the given type.*)
method html_of_type_expr_param_list b m_name t =
let s = Odoc_info.string_of_type_param_list t in
(** Print html code to display a [Types.module_type]. *)
method html_of_module_type b ?code m_name t =
- let s = remove_last_newline (Odoc_info.string_of_module_type ?code t) in
+ let s = Odoc_info.remove_ending_newline (Odoc_info.string_of_module_type ?code t) in
bs b "<code class=\"type\">";
bs b (self#create_fully_qualified_module_idents_links m_name s);
bs b "</code>"
(** 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. *)
self#html_of_class_type_param_expr_list b father l;
bs b " "
);
- self#html_of_text b
- [Code (self#create_fully_qualified_idents_links father cco.cco_name)]
+ bs b "<code class=\"type\">";
+ bs b (self#create_fully_qualified_idents_links father cco.cco_name);
+ bs b "</code>"
| Class_constraint (ck, ctk) ->
self#html_of_text b [Code "( "] ;
self#html_of_class_type_param_expr_list b father l;
bs b " "
);
- self#html_of_text b
- [Code (self#create_fully_qualified_idents_links father cta.cta_name)]
+ bs b "<code class=\"type\">";
+ bs b (self#create_fully_qualified_idents_links father cta.cta_name);
+ bs b "</code>"
| Class_signature (inh, eles) ->
self#html_of_text b [Code "object"];
);
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
);
bs b " : " ;
- self#html_of_class_parameter_list b father c.cl_parameters ;
+ self#html_of_class_parameter_list b father c ;
self#html_of_class_kind b father ~cl: c c.cl_kind;
bs b "</pre>" ;
print_DEBUG "html#html_of_class : info" ;
-(* 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 $ *)
(* *)
(***********************************************************************)
-(* $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. *)
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
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
(* *)
(***********************************************************************)
-(* $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. *)
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} *)
(** 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
(** 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
*)
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 :
(** 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
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
(** 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
(* *)
(***********************************************************************)
-(* $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. *)
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
(* 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) ->
]
in
self#latex_of_text fmt t;
- self#latex_of_class_parameter_list fmt father c.cl_parameters;
+ self#latex_of_class_parameter_list fmt father c;
+ (* avoid a big gap if the kind is a consrt *)
+ (
+ match c.cl_kind with
+ Class.Class_constr _ ->
+ self#latex_of_class_kind fmt father c.cl_kind
+ | _ ->
+ ()
+ );
self#latex_of_text fmt [ Latex "\\end{ocamldoccode}\n" ];
self#latex_for_class_label fmt c;
self#latex_for_class_index fmt c;
p fmt "@[<h 4>";
- self#latex_of_class_kind fmt father c.cl_kind;
+ (match c.cl_kind with
+ Class.Class_constr _ -> ()
+ | _ -> self#latex_of_class_kind fmt father c.cl_kind
+ );
self#latex_of_text fmt [Newline];
self#latex_of_info fmt ~block: true c.cl_info;
p fmt "@]"
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 $ *)
(* *)
(***********************************************************************)
-(* $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. *)
let include_dirs = "<dir>\tAdd <dir> to the list of include directories"
let rectypes = "\tAllow arbitrary recursive types"
let preprocess = "<command>\tPipe sources through preprocessor <command>"
+let option_impl ="<file>\tConsider <file> as a .ml file"
+let option_intf ="<file>\tConsider <file> as a .mli file"
let display_custom_generators_dir = "\tDisplay custom generators standard directory and exit"
let add_load_dir = "<dir>\tAdd the given directory to the search path for custom\n"^
"\t\tgenerators "^bytecode_only
(* *)
(***********************************************************************)
-(* $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
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 =
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 =
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 _
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 $ *)
(* *)
(***********************************************************************)
-(* $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 *)
(** 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
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.*)
(* *)
(***********************************************************************)
-(* $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, ...). *)
)
(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 "^
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 $ *)
(* *)
(***********************************************************************)
-(* $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, ...). *)
(** @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
(* *)
(***********************************************************************)
-(* $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.
(** 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 =
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 =
(* *)
(***********************************************************************)
-(* $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.
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}. *)
(* *)
(***********************************************************************)
-(* $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 *)
(* OCaml version string, must be in the format described in sys.mli. *)
-let ocaml_version = "3.08.0";;
+let ocaml_version = "3.08.1";;
/* 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
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
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);
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
------------------------------------------------------------------------*/
{
// 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)
// 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