Imported Upstream version 4.00.1
authorStephane Glondu <steph@glondu.net>
Wed, 14 Nov 2012 12:02:46 +0000 (13:02 +0100)
committerStephane Glondu <steph@glondu.net>
Wed, 14 Nov 2012 12:02:46 +0000 (13:02 +0100)
304 files changed:
Changes
Makefile
VERSION
asmcomp/amd64/emit.mlp
asmcomp/amd64/emit_nt.mlp
asmcomp/amd64/proc.ml
asmcomp/arm/emit.mlp
asmcomp/closure.ml
asmcomp/cmmgen.ml
asmcomp/cmx_format.mli
asmcomp/debuginfo.ml
asmcomp/emitaux.ml
asmcomp/i386/emit.mlp
asmcomp/i386/emit_nt.mlp
asmcomp/power/emit.mlp
asmcomp/schedgen.ml
asmcomp/sparc/emit.mlp
asmrun/amd64.S
asmrun/amd64nt.asm
asmrun/arm.S
asmrun/i386.S
asmrun/i386nt.asm
asmrun/power-elf.S
asmrun/power-rhapsody.S
asmrun/roots.c
asmrun/sparc.S
boot/ocamlc
boot/ocamldep
boot/ocamllex
bytecomp/bytepackager.ml
bytecomp/matching.ml
bytecomp/translcore.ml
bytecomp/translcore.mli
bytecomp/translmod.ml
byterun/compact.c
byterun/extern.c
byterun/freelist.c
byterun/freelist.h
byterun/hash.h
byterun/intern.c
byterun/major_gc.c
byterun/md5.c
byterun/md5.h
byterun/memory.c
camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
camlp4/Camlp4/Struct/Lexer.mll
camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
camlp4/Camlp4Top/Rprint.ml
camlp4/examples/arith.ml
camlp4/man/camlp4.1.tpl
debugger/command_line.ml
emacs/caml-types.el
emacs/caml.el
emacs/camldebug.el
emacs/ocamltags.in
man/ocamlc.m
man/ocamldoc.m
man/ocamlopt.m
ocamlbuild/ChangeLog
ocamlbuild/my_std.ml
ocamlbuild/ocaml_specific.ml
ocamlbuild/ocamlbuild.odocl
ocamlbuild/ocamlbuild_pack.mlpack
ocamlbuild/param_tags.ml
ocamlbuild/signatures.mli
ocamldoc/Changes.txt
ocamldoc/generators/odoc_todo.ml
ocamldoc/odoc_analyse.ml
ocamldoc/odoc_ast.ml
ocamldoc/odoc_class.ml
ocamldoc/odoc_dot.ml
ocamldoc/odoc_env.ml
ocamldoc/odoc_global.ml
ocamldoc/odoc_html.ml
ocamldoc/odoc_info.mli
ocamldoc/odoc_latex.ml
ocamldoc/odoc_lexer.mll
ocamldoc/odoc_man.ml
ocamldoc/odoc_merge.mli
ocamldoc/odoc_misc.ml
ocamldoc/odoc_name.ml
ocamldoc/odoc_print.ml
ocamldoc/odoc_scan.ml
ocamldoc/odoc_sig.ml
ocamldoc/odoc_texi.ml
ocamldoc/odoc_text_lexer.mll
otherlibs/bigarray/bigarray_stubs.c
otherlibs/bigarray/mmap_unix.c
otherlibs/graph/.depend
otherlibs/labltk/frx/README
otherlibs/labltk/lib/Makefile
otherlibs/labltk/lib/Makefile.nt
otherlibs/labltk/lib/labltk.bat
otherlibs/labltk/support/cltkVar.c
otherlibs/num/nat_stubs.c
otherlibs/str/str.mli
otherlibs/systhreads/st_posix.h
otherlibs/systhreads/st_stubs.c
otherlibs/systhreads/st_win32.h
otherlibs/threads/Makefile
otherlibs/unix/select.c
otherlibs/win32unix/close_on.c
otherlibs/win32unix/select.c
otherlibs/win32unix/times.c
otherlibs/win32unix/windbug.c
parsing/location.mli
parsing/parser.mly
parsing/printast.ml
stdlib/array.ml
stdlib/format.mli
stdlib/stdLabels.mli
stdlib/stream.ml
testsuite/interactive/lib-gc/alloc.ml
testsuite/lib/testing.ml
testsuite/tests/asmcomp/amd64.S
testsuite/tests/asmcomp/arith.cmm
testsuite/tests/asmcomp/arm.S
testsuite/tests/asmcomp/checkbound.cmm
testsuite/tests/asmcomp/hppa.S
testsuite/tests/asmcomp/i386nt.asm
testsuite/tests/asmcomp/m68k.S
testsuite/tests/asmcomp/main.ml
testsuite/tests/asmcomp/mainarith.c
testsuite/tests/asmcomp/parsecmm.mly
testsuite/tests/asmcomp/tagged-fib.cmm
testsuite/tests/asmcomp/tagged-integr.cmm
testsuite/tests/basic-float/tfloat_record.ml
testsuite/tests/basic-more/bounds.ml
testsuite/tests/basic-more/morematch.ml
testsuite/tests/basic-more/tbuffer.ml
testsuite/tests/basic-more/tbuffer.reference
testsuite/tests/basic-more/testrandom.ml
testsuite/tests/basic-more/testrandom.reference
testsuite/tests/basic-more/tformat.reference
testsuite/tests/basic-more/tprintf.ml
testsuite/tests/basic-more/tprintf.reference
testsuite/tests/basic/arrays.ml
testsuite/tests/basic/boxedints.ml
testsuite/tests/basic/equality.ml
testsuite/tests/basic/includestruct.ml
testsuite/tests/basic/maps.ml
testsuite/tests/basic/patmatch.ml
testsuite/tests/basic/patmatch.reference
testsuite/tests/basic/recvalues.ml
testsuite/tests/basic/tailcalls.ml
testsuite/tests/callback/Makefile
testsuite/tests/callback/tcallback.ml
testsuite/tests/embedded/Makefile
testsuite/tests/gc-roots/globrootsprim.c
testsuite/tests/lib-bigarray-2/bigarrf.f
testsuite/tests/lib-bigarray-2/bigarrfml.ml
testsuite/tests/lib-bigarray-2/bigarrfstub.c
testsuite/tests/lib-bigarray/bigarrays.ml
testsuite/tests/lib-bigarray/fftba.ml
testsuite/tests/lib-bigarray/pr5115.ml
testsuite/tests/lib-dynlink-bytecode/Makefile
testsuite/tests/lib-dynlink-bytecode/main.ml
testsuite/tests/lib-dynlink-csharp/main.ml
testsuite/tests/lib-dynlink-csharp/plugin.ml
testsuite/tests/lib-dynlink-native/api.ml
testsuite/tests/lib-dynlink-native/b.ml
testsuite/tests/lib-dynlink-native/bug.ml
testsuite/tests/lib-dynlink-native/main.ml
testsuite/tests/lib-dynlink-native/packed1.ml
testsuite/tests/lib-dynlink-native/plugin.ml
testsuite/tests/lib-dynlink-native/plugin4.ml
testsuite/tests/lib-dynlink-native/plugin_ref.ml
testsuite/tests/lib-dynlink-native/plugin_thread.ml
testsuite/tests/lib-dynlink-native/sub/plugin.ml
testsuite/tests/lib-dynlink-native/sub/plugin3.ml
testsuite/tests/lib-hashtbl/hfun.ml
testsuite/tests/lib-hashtbl/htbl.ml
testsuite/tests/lib-marshal/intext.ml
testsuite/tests/lib-marshal/intextaux.c
testsuite/tests/lib-num/test_big_ints.ml
testsuite/tests/lib-num/test_nats.ml
testsuite/tests/lib-num/test_nums.ml
testsuite/tests/lib-printf/tprintf.ml
testsuite/tests/lib-printf/tprintf.reference
testsuite/tests/lib-scanf/tscanf.ml
testsuite/tests/lib-scanf/tscanf.reference
testsuite/tests/lib-set/testmap.ml
testsuite/tests/lib-set/testset.ml
testsuite/tests/lib-str/t01.ml
testsuite/tests/lib-stream/count_concat_bug.reference
testsuite/tests/lib-systhreads/testfork.ml
testsuite/tests/lib-threads/test3.runner
testsuite/tests/lib-threads/test4.runner
testsuite/tests/lib-threads/test5.runner
testsuite/tests/lib-threads/test7.checker
testsuite/tests/lib-threads/testsignal.checker
testsuite/tests/lib-threads/testsignal.runner
testsuite/tests/lib-threads/torture.ml
testsuite/tests/lib-threads/torture.reference
testsuite/tests/lib-threads/torture.runner
testsuite/tests/misc-kb/equations.ml
testsuite/tests/misc-kb/equations.mli
testsuite/tests/misc-kb/kb.ml
testsuite/tests/misc-kb/kbmain.ml
testsuite/tests/misc-kb/orderings.ml
testsuite/tests/misc-kb/orderings.mli
testsuite/tests/misc-kb/terms.ml
testsuite/tests/misc-kb/terms.mli
testsuite/tests/misc-unsafe/almabench.ml
testsuite/tests/misc-unsafe/fft.ml
testsuite/tests/misc/bdd.ml
testsuite/tests/misc/boyer.ml
testsuite/tests/misc/fib.ml
testsuite/tests/misc/nucleic.ml
testsuite/tests/misc/sieve.ml
testsuite/tests/misc/sieve.reference
testsuite/tests/misc/takc.ml
testsuite/tests/regression/pr5757/Makefile [new file with mode: 0644]
testsuite/tests/regression/pr5757/pr5757.ml [new file with mode: 0644]
testsuite/tests/regression/pr5757/pr5757.reference [new file with mode: 0644]
testsuite/tests/tool-lexyacc/gram_aux.ml
testsuite/tests/tool-lexyacc/grammar.mly
testsuite/tests/tool-lexyacc/input
testsuite/tests/tool-lexyacc/input.ml
testsuite/tests/tool-lexyacc/lexgen.ml
testsuite/tests/tool-lexyacc/main.reference
testsuite/tests/tool-lexyacc/output.ml
testsuite/tests/tool-lexyacc/scan_aux.ml
testsuite/tests/tool-lexyacc/scanner.mll
testsuite/tests/tool-ocaml/t301-object.ml
testsuite/tests/tool-ocamldoc/odoc_test.ml
testsuite/tests/tool-ocamldoc/t01.ml
testsuite/tests/tool-ocamldoc/t03.ml
testsuite/tests/typing-fstclassmod/fstclassmod.ml
testsuite/tests/typing-gadts/Makefile
testsuite/tests/typing-gadts/dynamic_frisch.ml
testsuite/tests/typing-gadts/test.ml
testsuite/tests/typing-gadts/test.ml.principal.reference
testsuite/tests/typing-gadts/test.ml.reference
testsuite/tests/typing-implicit_unpack/Makefile
testsuite/tests/typing-implicit_unpack/implicit_unpack.ml
testsuite/tests/typing-misc/Makefile
testsuite/tests/typing-modules-bugs/pr5164_ok.ml
testsuite/tests/typing-modules/Makefile
testsuite/tests/typing-objects-bugs/pr3968_bad.ml
testsuite/tests/typing-objects-bugs/pr4018_bad.ml
testsuite/tests/typing-objects-bugs/pr4766_ok.ml
testsuite/tests/typing-objects-bugs/yamagata021012_ok.ml
testsuite/tests/typing-objects/Makefile
testsuite/tests/typing-objects/Tests.ml
testsuite/tests/typing-objects/Tests.ml.principal.reference
testsuite/tests/typing-objects/Tests.ml.reference
testsuite/tests/typing-objects/pr5619_bad.ml
testsuite/tests/typing-poly-bugs/pr5322_ok.ml
testsuite/tests/typing-poly/Makefile
testsuite/tests/typing-poly/poly.ml
testsuite/tests/typing-poly/poly.ml.principal.reference
testsuite/tests/typing-poly/poly.ml.reference
testsuite/tests/typing-polyvariants-bugs/pr5057_ok.ml
testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml
testsuite/tests/typing-private-bugs/pr5026_bad.ml
testsuite/tests/typing-private/Makefile
testsuite/tests/typing-private/private.ml
testsuite/tests/typing-private/private.ml.reference
testsuite/tests/typing-recmod/t02bad.ml
testsuite/tests/typing-recmod/t08bad.ml
testsuite/tests/typing-recmod/t13ok.ml
testsuite/tests/typing-recmod/t14bad.ml
testsuite/tests/typing-recmod/t16ok.ml
testsuite/tests/typing-recmod/t17ok.ml
testsuite/tests/typing-recmod/t18ok.ml
testsuite/tests/typing-recmod/t19ok.ml
testsuite/tests/typing-recmod/t22ok.ml
testsuite/tests/typing-signatures/Makefile
testsuite/tests/typing-signatures/els.ml
testsuite/tests/typing-sigsubst/Makefile
testsuite/tests/typing-typeparam/Makefile
tools/depend.ml
tools/make-package-macosx
tools/pprintast.ml
tools/read_cmt.ml
tools/typedtreeIter.ml
tools/typedtreeIter.mli
tools/untypeast.ml
toplevel/expunge.ml
toplevel/genprintval.ml
typing/btype.ml
typing/cmt_format.ml
typing/ctype.mli
typing/datarepr.ml
typing/env.ml
typing/env.mli
typing/includecore.ml
typing/parmatch.ml
typing/parmatch.mli
typing/printtyp.ml
typing/printtyped.ml
typing/subst.ml
typing/typeclass.ml
typing/typecore.ml
typing/typedecl.ml
typing/typemod.ml
typing/types.mli
typing/typetexp.ml
utils/clflags.mli
utils/misc.ml
yacc/main.c
yacc/skeleton.c

diff --git a/Changes b/Changes
index 3f876233166aad27b551d49fd17f582e78ba0f2d..0b06ed945a95196e44aa817923ffc36d039b4a2f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,33 @@
+OCaml 4.00.1:
+-------------
+
+Bug fixes:
+- PR#4019: better documentation of Str.matched_string
+- PR#5111: ocamldoc, heading tags inside spans tags is illegal in html
+- PR#5278: better error message when typing "make"
+- PR#5468: ocamlbuild should preserve order of parametric tags
+- PR#5563: harden Unix.select against file descriptors above FD_SETSIZE
+- PR#5690: "ocamldoc ... -text README" raises exception
+- PR#5700: crash with native-code stack backtraces under MacOS 10.8 x86-64
+- PR#5707: AMD64 code generator: do not use r10 and r11 for parameter passing,
+  as these registers can be destroyed by the dynamic loader
+- PR#5712: some documentation problems
+- PR#5715: configuring with -no-shared-libs breaks under cygwin
+- PR#5718: false positive on 'unused constructor' warning
+- PR#5719: ocamlyacc generates code that is not warning 33-compliant
+- PR#5725: ocamldoc output of preformatted code
+- PR#5727: emacs caml-mode indents shebang line in toplevel scripts
+- PR#5729: tools/untypeast.ml creates unary Pexp_tuple
+- PR#5731: instruction scheduling forgot to account for destroyed registers
+- PR#5735: %apply and %revapply not first class citizens
+- PR#5738: first class module patterns not handled by ocamldep
+- PR#5742: missing bound checks in Array.sub
+- PR#5744: ocamldoc error on "val virtual"
+- PR#5757: GC compaction bug (crash)
+- PR#5758: Compiler bug when matching on floats
+- PR#5761: Incorrect bigarray custom block size
+
+
 OCaml 4.00.0:
 -------------
 
@@ -6,7 +36,7 @@ OCaml 4.00.0:
 - The official name of the language is now OCaml.
 
 Language features:
-- Added Generalized Abstract Data Types (GADTs) to the language.
+- Added Generalized Algebraic Data Types (GADTs) to the language.
   See chapter "Language extensions" of the reference manual for documentation.
 - It is now possible to omit type annotations when packing and unpacking
   first-class modules. The type-checker attempts to infer it from the context.
@@ -142,6 +172,7 @@ Bug Fixes:
 - PR#5261, PR#5497: Ocaml source-code examples are not "copy-paste-able"
 * PR#5279: executable name is not initialized properly in caml_startup_code
 - PR#5290: added hash functions for channels, nats, mutexes, conditions
+- PR#5291: undetected loop in class initialization
 - PR#5295: OS threads: problem with caml_c_thread_unregister()
 - PR#5301: camlp4r and exception equal to another one with parameters
 - PR#5305: prevent ocamlbuild from complaining about links to _build/
@@ -208,8 +239,8 @@ Bug Fixes:
 - PR#5518: segfault with lazy empty array
 - PR#5531: Allow ocamlbuild to add ocamldoc flags through -docflag
   and -docflags switches
-- PR#5543: in Bigarray.map_file, try to avoid using lseek() when growing file
 - PR#5538: combining -i and -annot in ocamlc
+- PR#5543: in Bigarray.map_file, try to avoid using lseek() when growing file
 - PR#5648: (probably fixed) test failures in tests/lib-threads
 - PR#5551: repeated calls to find_in_path degrade performance
 - PR#5552: Mac OS X: unrecognized gcc option "-no-cpp-precomp"
index e53fd0d70c9807e6676287d28fc61c447af63758..c2003d34e57cb8369f9e09faa70386f59d7790f3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile 12750 2012-07-20 08:06:01Z doligez $
+# $Id: Makefile 12929 2012-09-17 16:23:06Z doligez $
 
 # The main Makefile
 
@@ -109,8 +109,7 @@ defaultentry:
        @echo "Please refer to the installation instructions in file INSTALL."
        @echo "If you've just unpacked the distribution, something like"
        @echo " ./configure"
-       @echo " make world"
-       @echo " make opt"
+       @echo " make world.opt"
        @echo " make install"
        @echo "should work.  But see the file INSTALL for more details."
 
@@ -127,7 +126,6 @@ world:
 world.opt:
        $(MAKE) coldstart
        $(MAKE) opt.opt
-       $(MAKE) ocamltoolsopt
 
 # Hard bootstrap how-to:
 # (only necessary in some cases, for example if you remove some primitive)
@@ -252,8 +250,9 @@ opt:
 # Native-code versions of the tools
 opt.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
         $(DEBUGGER) ocamldoc ocamlbuild.byte $(CAMLP4OUT) \
-        ocamlopt.opt otherlibrariesopt ocamllex.opt ocamltoolsopt.opt \
-        ocamldoc.opt ocamlbuild.native $(CAMLP4OPT)
+        ocamlopt.opt otherlibrariesopt ocamllex.opt \
+        ocamltoolsopt ocamltoolsopt.opt ocamldoc.opt ocamlbuild.native \
+        $(CAMLP4OPT)
 
 base.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
         ocamlbuild.byte $(CAMLP4OUT) $(DEBUGGER) ocamldoc ocamlopt.opt \
@@ -801,7 +800,7 @@ distclean:
 .PHONY: partialclean beforedepend alldepend cleanboot coldstart
 .PHONY: compare core coreall
 .PHONY: coreboot defaultentry depend distclean install installopt
-.PHONY: library library-cross libraryopt ocamlbuild-mixed-boot
+.PHONY: library library-cross libraryopt
 .PHONY: ocamlbuild.byte ocamlbuild.native ocamldebugger ocamldoc
 .PHONY: ocamldoc.opt ocamllex ocamllex.opt ocamltools ocamltoolsopt
 .PHONY: ocamltoolsopt.opt ocamlyacc opt-core opt opt.opt otherlibraries
diff --git a/VERSION b/VERSION
index f79807ce51c58cb7b2449bc2286bbc187044a3c6..5457d75b881f7b1a68daaa60dee206e41c2b07e9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
-4.00.0
+4.00.1
 
 # The version string is the first line of this file.
 # It must be in the format described in stdlib/sys.mli
 
-# $Id: VERSION 12779 2012-07-26 09:34:15Z doligez $
+# $Id: VERSION 12983 2012-10-03 15:11:00Z doligez $
index 47f652d02ede6af7abdd6b17694d56d376b0c366..0f476e73754fbe48e8574aef7f7de3f54ff7a2ba 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 12664 2012-07-09 08:35:23Z lefessan $ *)
+(* $Id: emit.mlp 12907 2012-09-08 16:51:03Z xleroy $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code *)
 
@@ -110,13 +110,13 @@ let emit_reg = function
 
 let reg_low_8_name =
   [| "%al"; "%bl"; "%dil"; "%sil"; "%dl"; "%cl"; "%r8b"; "%r9b";
-     "%r10b"; "%r11b"; "%bpl"; "%r12b"; "%r13b" |]
+     "%r12b"; "%r13b"; "%bpl"; "%r10b"; "%r11b" |]
 let reg_low_16_name =
   [| "%ax"; "%bx"; "%di"; "%si"; "%dx"; "%cx"; "%r8w"; "%r9w";
-     "%r10w"; "%r11w"; "%bp"; "%r12w"; "%r13w" |]
+     "%r12w"; "%r13w"; "%bp"; "%r10w"; "%r11w" |]
 let reg_low_32_name =
   [| "%eax"; "%ebx"; "%edi"; "%esi"; "%edx"; "%ecx"; "%r8d"; "%r9d";
-     "%r10d"; "%r11d"; "%ebp"; "%r12d"; "%r13d" |]
+     "%r12d"; "%r13d"; "%ebp"; "%r10d"; "%r11d" |]
 
 let emit_subreg tbl r =
   match r.loc with
@@ -670,14 +670,13 @@ let emit_profile () =
   match Config.system with
   | "linux" | "gnu" ->
       (* mcount preserves rax, rcx, rdx, rsi, rdi, r8, r9 explicitly
-         and rbx, rbp, r12-r15 like all C functions.
-         We need to preserve r10 and r11 ourselves, since OCaml can
-         use them for argument passing. *)
+         and rbx, rbp, r12-r15 like all C functions.  This includes
+         all the registers used for argument passing, so we don't
+         need to preserve other regs.  We do need to initialize rbp
+         like mcount expects it, though. *)
       `        pushq   %r10\n`;
       `        movq    %rsp, %rbp\n`;
-      `        pushq   %r11\n`;
       `        {emit_call "mcount"}\n`;
-      `        popq    %r11\n`;
       `        popq    %r10\n`
   | _ ->
       () (*unsupported yet*)
index 48646b7722b7863ccbac89741d24b2b028be6d8b..9980efb949f226a7156d9da86abf35e4d6ac5691 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
+(* $Id: emit_nt.mlp 12907 2012-09-08 16:51:03Z xleroy $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code, MASM syntax *)
 
@@ -110,13 +110,13 @@ let emit_reg = function
 
 let reg_low_8_name =
   [| "al"; "bl"; "dil"; "sil"; "dl"; "cl"; "r8b"; "r9b";
-     "r10b"; "r11b"; "bpl"; "r12b"; "r13b" |]
+     "r12b"; "r13b"; "bpl"; "r10b"; "r11b" |]
 let reg_low_16_name =
   [| "ax"; "bx"; "di"; "si"; "dx"; "cx"; "r8w"; "r9w";
-     "r10w"; "r11w"; "bp"; "r12w"; "r13w" |]
+     "r12w"; "r13w"; "bp"; "r10w"; "r11w" |]
 let reg_low_32_name =
   [| "eax"; "ebx"; "edi"; "esi"; "edx"; "ecx"; "r8d"; "r9d";
-     "r10d"; "r11d"; "ebp"; "r12d"; "r13d" |]
+     "r12d"; "r13d"; "ebp"; "r10d"; "r11d" |]
 
 let emit_subreg tbl pref r =
   match r.loc with
index d3082139c932cb232c853c2577b45e1a4b8ba32b..bc95fe6806ede61853c07be227db6b956722cec9 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: proc.ml 12149 2012-02-10 16:15:24Z doligez $ *)
+(* $Id: proc.ml 12907 2012-09-08 16:51:03Z xleroy $ *)
 
 (* Description of the AMD64 processor *)
 
@@ -45,18 +45,18 @@ let masm =
     rcx         5
     r8          6
     r9          7
-    r10         8
-    r11         9
+    r12         8
+    r13         9
     rbp         10
-    r12         11
-    r13         12
+    r10         11
+    r11         12
     r14         trap pointer
     r15         allocation pointer
 
   xmm0 - xmm15  100 - 115  *)
 
 (* Conventions:
-     rax - r11: OCaml function arguments
+     rax - r13: OCaml function arguments
      rax: OCaml and C function results
      xmm0 - xmm9: OCaml function arguments
      xmm0: OCaml and C function results
@@ -70,16 +70,19 @@ let masm =
      xmm0 - xmm3: C function arguments
      rbx, rbp, rsi, rdi r12-r15 are preserved by C
      xmm6-xmm15 are preserved by C
+   Note (PR#5707): r11 should not be used for parameter passing, as it
+     can be destroyed by the dynamic loader according to SVR4 ABI.
+     Linux's dynamic loader also destroys r10.
 *)
 
 let int_reg_name =
   match Config.ccomp_type with
   | "msvc" ->
       [| "rax"; "rbx"; "rdi"; "rsi"; "rdx"; "rcx"; "r8"; "r9";
-         "r10"; "r11"; "rbp"; "r12"; "r13" |]
+         "r12"; "r13"; "rbp"; "r10"; "r11" |]
   | _ ->
       [| "%rax"; "%rbx"; "%rdi"; "%rsi"; "%rdx"; "%rcx"; "%r8"; "%r9";
-         "%r10"; "%r11"; "%rbp"; "%r12"; "%r13" |]
+         "%r12"; "%r13"; "%rbp"; "%r10"; "%r11" |]
 
 let float_reg_name =
   match Config.ccomp_type with
@@ -188,7 +191,7 @@ let loc_results res =
      return value in rax or xmm0.
   C calling conventions under Win64:
      first integer args in rcx, rdx, r8, r9
-     first float args in xmm0 ... xmm3     
+     first float args in xmm0 ... xmm3
      each integer arg consumes a float reg, and conversely
      remaining args on stack
      always 32 bytes reserved at bottom of stack.
@@ -241,12 +244,12 @@ let destroyed_at_c_call =
   if win64 then
     (* Win64: rbx, rbp, rsi, rdi, r12-r15, xmm6-xmm15 preserved *)
     Array.of_list(List.map phys_reg
-      [0;4;5;6;7;8;9;
+      [0;4;5;6;7;11;12;
        100;101;102;103;104;105])
   else
     (* Unix: rbp, rbx, r12-r15 preserved *)
     Array.of_list(List.map phys_reg
-      [0;2;3;4;5;6;7;8;9;
+      [0;2;3;4;5;6;7;11;12;
        100;101;102;103;104;105;106;107;
        108;109;110;111;112;113;114;115])
 
index 0310b4a72ee16210e312cc7e7300176524a917be..8bec173015f051492b564a71e2915d6ce864dc53 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 12547 2012-06-02 18:00:43Z bmeurer $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of ARM assembly code *)
 
index 1984ee05b8b2cac6535aa4c6f5455e0d9c9a854d..f0e23fa8a73524f5d556370a0e6728eae258454a 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: closure.ml 12179 2012-02-21 17:41:02Z xleroy $ *)
+(* $Id: closure.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Introduction of closures, uncurrying, recognition of direct calls *)
 
@@ -121,7 +121,7 @@ let lambda_smaller lam threshold =
     match lam with
       Uvar v -> ()
     | Uconst(
-       (Const_base(Const_int _ | Const_char _ | Const_float _ |
+        (Const_base(Const_int _ | Const_char _ | Const_float _ |
                         Const_int32 _ | Const_int64 _ | Const_nativeint _) |
              Const_pointer _), _) -> incr size
 (* Structured Constants are now emitted during closure conversion. *)
@@ -496,7 +496,7 @@ let rec close fenv cenv = function
   | Lfunction(kind, params, body) as funct ->
       close_one_function fenv cenv (Ident.create "fun") funct
 
-    (* We convert [f a] to [let a' = a in fun b c -> f a' b c] 
+    (* We convert [f a] to [let a' = a in fun b c -> f a' b c]
        when fun_arity > nargs *)
   | Lapply(funct, args, loc) ->
       let nargs = List.length args in
@@ -513,27 +513,27 @@ let rec close fenv cenv = function
 
       | ((ufunct, Value_closure(fundesc, approx_res)), uargs)
           when nargs < fundesc.fun_arity ->
-       let first_args = List.map (fun arg ->
-         (Ident.create "arg", arg) ) uargs in
-       let final_args = Array.to_list (Array.init (fundesc.fun_arity - nargs) (fun _ ->
-         Ident.create "arg")) in
-       let rec iter args body =
-         match args with
-             [] -> body
-           | (arg1, arg2) :: args ->
-             iter args
-               (Ulet ( arg1, arg2, body))
-       in
-       let internal_args =
-         (List.map (fun (arg1, arg2) -> Lvar arg1) first_args)
-         @ (List.map (fun arg -> Lvar arg ) final_args)
-       in
-       let (new_fun, approx) = close fenv cenv
-         (Lfunction(
-           Curried, final_args, Lapply(funct, internal_args, loc)))
-       in
-       let new_fun = iter first_args new_fun in
-       (new_fun, approx)
+        let first_args = List.map (fun arg ->
+          (Ident.create "arg", arg) ) uargs in
+        let final_args = Array.to_list (Array.init (fundesc.fun_arity - nargs) (fun _ ->
+          Ident.create "arg")) in
+        let rec iter args body =
+          match args with
+              [] -> body
+            | (arg1, arg2) :: args ->
+              iter args
+                (Ulet ( arg1, arg2, body))
+        in
+        let internal_args =
+          (List.map (fun (arg1, arg2) -> Lvar arg1) first_args)
+          @ (List.map (fun arg -> Lvar arg ) final_args)
+        in
+        let (new_fun, approx) = close fenv cenv
+          (Lfunction(
+            Curried, final_args, Lapply(funct, internal_args, loc)))
+        in
+        let new_fun = iter first_args new_fun in
+        (new_fun, approx)
 
       | ((ufunct, Value_closure(fundesc, approx_res)), uargs)
         when fundesc.fun_arity > 0 && nargs > fundesc.fun_arity ->
index eea15f5e623764aa097bb5c8cce95ec599f2bf8b..3f54da0eafcfc76f011cfbf9c8ae1369d9a80ff8 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: cmmgen.ml 12237 2012-03-14 09:26:54Z xleroy $ *)
+(* $Id: cmmgen.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Translation from closed lambda to C-- *)
 
@@ -1273,7 +1273,7 @@ and transl_prim_2 p arg1 arg2 dbg =
           bind "header" (header arr) (fun hdr ->
             if wordsize_shift = numfloat_shift then
               Csequence(make_checkbound dbg [addr_array_length hdr; idx],
-                        Cifthenelse(is_addr_array_hdr hdr, 
+                        Cifthenelse(is_addr_array_hdr hdr,
                                     addr_array_ref arr idx,
                                     float_array_ref arr idx))
             else
@@ -1390,7 +1390,7 @@ and transl_prim_3 p arg1 arg2 arg3 dbg =
           bind "header" (header arr) (fun hdr ->
             if wordsize_shift = numfloat_shift then
               Csequence(make_checkbound dbg [addr_array_length hdr; idx],
-                        Cifthenelse(is_addr_array_hdr hdr, 
+                        Cifthenelse(is_addr_array_hdr hdr,
                                     addr_array_set arr idx newval,
                                     float_array_set arr idx
                                                     (unbox_float newval)))
@@ -1774,12 +1774,12 @@ let emit_constant_closure symb fundecls cont =
 let emit_all_constants cont =
   let c = ref cont in
   List.iter
-    (fun (lbl, global, cst) -> 
+    (fun (lbl, global, cst) ->
        let cst = emit_constant lbl cst [] in
-       let cst = if global then 
-        Cglobal_symbol lbl :: cst
+       let cst = if global then
+         Cglobal_symbol lbl :: cst
        else cst in
-        c:= Cdata(cst):: !c)
+         c:= Cdata(cst):: !c)
     (Compilenv.structured_constants());
 (*  structured_constants := []; done in Compilenv.reset() *)
   Hashtbl.clear immstrings;   (* PR#3979 *)
@@ -1992,15 +1992,15 @@ let final_curry_function arity =
           args @ [Cvar last_arg; Cvar clos])
     else
       if n = arity - 1 then
-       begin
+        begin
       let newclos = Ident.create "clos" in
       Clet(newclos,
            get_field (Cvar clos) 3,
            curry_fun (get_field (Cvar clos) 2 :: args) newclos (n-1))
-       end else
-       begin
-         let newclos = Ident.create "clos" in
-         Clet(newclos,
+        end else
+        begin
+          let newclos = Ident.create "clos" in
+          Clet(newclos,
                get_field (Cvar clos) 4,
                curry_fun (get_field (Cvar clos) 3 :: args) newclos (n-1))
     end in
@@ -2023,15 +2023,15 @@ let rec intermediate_curry_functions arity num =
      {fun_name = name2;
       fun_args = [arg, typ_addr; clos, typ_addr];
       fun_body =
-        if arity - num > 2 then
-          Cop(Calloc,
+         if arity - num > 2 then
+           Cop(Calloc,
                [alloc_closure_header 5;
                 Cconst_symbol(name1 ^ "_" ^ string_of_int (num+1));
                 int_const (arity - num - 1);
                 Cconst_symbol(name1 ^ "_" ^ string_of_int (num+1) ^ "_app");
-               Cvar arg; Cvar clos])
-        else
-          Cop(Calloc,
+                Cvar arg; Cvar clos])
+         else
+           Cop(Calloc,
                      [alloc_closure_header 4;
                       Cconst_symbol(name1 ^ "_" ^ string_of_int (num+1));
                       int_const 1; Cvar arg; Cvar clos]);
@@ -2039,35 +2039,35 @@ let rec intermediate_curry_functions arity num =
       fun_dbg  = Debuginfo.none }
     ::
       (if arity - num > 2 then
-         let rec iter i =
-           if i <= arity then
-             let arg = Ident.create (Printf.sprintf "arg%d" i) in
-             (arg, typ_addr) :: iter (i+1)
-           else []
-         in
-         let direct_args = iter (num+2) in
-         let rec iter i args clos =
-           if i = 0 then
-             Cop(Capply(typ_addr, Debuginfo.none),
-                 (get_field (Cvar clos) 2) :: args @ [Cvar clos])
-           else
-             let newclos = Ident.create "clos" in
-             Clet(newclos,
-                  get_field (Cvar clos) 4,
-                  iter (i-1) (get_field (Cvar clos) 3 :: args) newclos)
-         in
-         let cf =
-           Cfunction
-             {fun_name = name1 ^ "_" ^ string_of_int (num+1) ^ "_app";
-              fun_args = direct_args @ [clos, typ_addr];
-              fun_body = iter (num+1)
-                 (List.map (fun (arg,_) -> Cvar arg) direct_args) clos;
-              fun_fast = true;
+          let rec iter i =
+            if i <= arity then
+              let arg = Ident.create (Printf.sprintf "arg%d" i) in
+              (arg, typ_addr) :: iter (i+1)
+            else []
+          in
+          let direct_args = iter (num+2) in
+          let rec iter i args clos =
+            if i = 0 then
+              Cop(Capply(typ_addr, Debuginfo.none),
+                  (get_field (Cvar clos) 2) :: args @ [Cvar clos])
+            else
+              let newclos = Ident.create "clos" in
+              Clet(newclos,
+                   get_field (Cvar clos) 4,
+                   iter (i-1) (get_field (Cvar clos) 3 :: args) newclos)
+          in
+          let cf =
+            Cfunction
+              {fun_name = name1 ^ "_" ^ string_of_int (num+1) ^ "_app";
+               fun_args = direct_args @ [clos, typ_addr];
+               fun_body = iter (num+1)
+                  (List.map (fun (arg,_) -> Cvar arg) direct_args) clos;
+               fun_fast = true;
                fun_dbg = Debuginfo.none }
-         in
-         cf :: intermediate_curry_functions arity (num+1)
+          in
+          cf :: intermediate_curry_functions arity (num+1)
        else
-         intermediate_curry_functions arity (num+1))
+          intermediate_curry_functions arity (num+1))
   end
 
 let curry_function arity =
index d64fc2fd6e76c3a50570d5664edb99e656c4bdb3..b7debe1ea74cf916f387ea86863ab63ffcaf3603 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: cmx_format.mli 12210 2012-03-08 19:52:03Z doligez $ *)
+(* $Id: cmx_format.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Format of .cmx, .cmxa and .cmxs files *)
 
@@ -60,4 +60,3 @@ type dynheader = {
   dynu_magic: string;
   dynu_units: dynunit list;
 }
-
index 19986f83788e4683698d2f1f0fdfa2551358d513..3f96049eee08b17682111e72f403761ccd0164b1 100644 (file)
@@ -54,4 +54,3 @@ let from_location kind loc =
 
 let from_call ev = from_location Dinfo_call ev.Lambda.lev_loc
 let from_raise ev = from_location Dinfo_raise ev.Lambda.lev_loc
-
index a0659794a8adf087f07813e57731e0addd753dde..f45fc162ca31b8fcca84c41c8775e2cbbf516641 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emitaux.ml 12699 2012-07-11 15:26:15Z lefessan $ *)
+(* $Id: emitaux.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Common functions for emitting assembly code *)
 
@@ -197,16 +197,16 @@ let is_cfi_enabled () =
 
 let cfi_startproc () =
   if is_cfi_enabled () then
-    emit_string "      .cfi_startproc\n"
+    emit_string "\t.cfi_startproc\n"
 
 let cfi_endproc () =
   if is_cfi_enabled () then
-    emit_string "      .cfi_endproc\n"
+    emit_string "\t.cfi_endproc\n"
 
 let cfi_adjust_cfa_offset n =
   if is_cfi_enabled () then
   begin
-    emit_string "      .cfi_adjust_cfa_offset  "; emit_int n; emit_string "\n";
+    emit_string "\t.cfi_adjust_cfa_offset\t"; emit_int n; emit_string "\n";
   end
 
 (* Emit debug information *)
@@ -236,12 +236,12 @@ let emit_debug_info dbg =
       with Not_found ->
         let file_num = !file_pos_num_cnt in
         incr file_pos_num_cnt;
-        emit_string "  .file   ";
-        emit_int file_num; emit_char ' ';
+        emit_string "\t.file\t";
+        emit_int file_num; emit_char '\t';
         emit_string_literal file_name; emit_char '\n';
         file_pos_nums := (file_name,file_num) :: !file_pos_nums;
         file_num in
-    emit_string "      .loc    ";
-    emit_int file_num; emit_char '     ';
+    emit_string "\t.loc\t";
+    emit_int file_num; emit_char '\t';
     emit_int line; emit_char '\n'
   end
index e7694d07ed37219c8294570b03e5c8486c0e00d4..ace363b51170265b86db8bcfdd704e95e58479df 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 12448 2012-05-12 09:49:40Z xleroy $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of Intel 386 assembly code *)
 
index 6f4f83093c7f38729c3dcfcea248fe7edaba0a49..db4e7b4074fcf21f594ff22f70f5a86ff6690237 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp 12166 2012-02-18 16:56:29Z xleroy $ *)
+(* $Id: emit_nt.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of Intel 386 assembly code, MASM syntax. *)
 
index 1d83ce4d72476df5aafe5492435afebe48273d74..55ad9830b653a1e7766ffcf9804634389c4fe2a5 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of PowerPC assembly code *)
 
index 956531cf5a936751e1337a14668b1c74bc4d2c8b..c81b2c5540e7c56770d243a6d8c9da6d37d926ba 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: schedgen.ml 12179 2012-02-21 17:41:02Z xleroy $ *)
+(* $Id: schedgen.ml 12876 2012-08-24 08:14:30Z xleroy $ *)
 
 (* Instruction scheduling *)
 
@@ -65,6 +65,33 @@ let add_edge ancestor son delay =
 
 let add_edge_after son ancestor = add_edge ancestor son 0
 
+(* Add edges from all instructions that define a pseudoregister [arg] being used
+   as argument to node [node] (RAW dependencies *)
+
+let add_RAW_dependencies node arg =
+  try
+    let ancestor = Hashtbl.find code_results arg.loc in
+    add_edge ancestor node ancestor.delay
+  with Not_found ->
+    ()
+
+(* Add edges from all instructions that use a pseudoregister [res] that is
+   defined by node [node] (WAR dependencies). *)
+
+let add_WAR_dependencies node res =
+  let ancestors = Hashtbl.find_all code_uses res.loc in
+  List.iter (add_edge_after node) ancestors
+
+(* Add edges from all instructions that have already defined a pseudoregister
+   [res] that is defined by node [node] (WAW dependencies). *)
+
+let add_WAW_dependencies node res =
+  try
+    let ancestor = Hashtbl.find code_results res.loc in
+    add_edge ancestor node 0
+  with Not_found ->
+    ()
+
 (* Compute length of longest path to a result.
    For leafs of the DAG, see whether their result is used in the instruction
    immediately following the basic block (a "critical" output). *)
@@ -200,10 +227,19 @@ method private instr_issue_cycles instr =
   | Lreloadretaddr -> self#reload_retaddr_issue_cycles
   | _ -> assert false
 
+(* Pseudoregisters destroyed by an instruction *)
+
+method private destroyed_by_instr instr =
+  match instr.desc with
+  | Lop op -> Proc.destroyed_at_oper (Iop op)
+  | Lreloadretaddr -> [||]
+  | _ -> assert false
+
 (* Add an instruction to the code dag *)
 
 method private add_instruction ready_queue instr =
   let delay = self#instr_latency instr in
+  let destroyed = self#destroyed_by_instr instr in
   let node =
     { instr = instr;
       delay = delay;
@@ -214,28 +250,17 @@ method private add_instruction ready_queue instr =
       emitted_ancestors = 0 } in
   (* Add edges from all instructions that define one of the registers used
      (RAW dependencies) *)
-  for i = 0 to Array.length instr.arg - 1 do
-    try
-      let ancestor = Hashtbl.find code_results instr.arg.(i).loc in
-      add_edge ancestor node ancestor.delay
-    with Not_found ->
-      ()
-  done;
+  Array.iter (add_RAW_dependencies node) instr.arg;
   (* Also add edges from all instructions that use one of the result regs
-     of this instruction (WAR dependencies). *)
-  for i = 0 to Array.length instr.res - 1 do
-    let ancestors = Hashtbl.find_all code_uses instr.res.(i).loc in
-    List.iter (add_edge_after node) ancestors
-  done;
+     of this instruction, or a reg destroyed by this instruction
+     (WAR dependencies). *)
+  Array.iter (add_WAR_dependencies node) instr.res;
+  Array.iter (add_WAR_dependencies node) destroyed;   (* PR#5731 *)
   (* Also add edges from all instructions that have already defined one
-     of the results of this instruction (WAW dependencies). *)
-  for i = 0 to Array.length instr.res - 1 do
-    try
-      let ancestor = Hashtbl.find code_results instr.res.(i).loc in
-      add_edge ancestor node 0
-    with Not_found ->
-      ()
-  done;
+     of the results of this instruction, or a reg destroyed by
+     this instruction (WAW dependencies). *)
+  Array.iter (add_WAW_dependencies node) instr.res;
+  Array.iter (add_WAW_dependencies node) destroyed;   (* PR#5731 *)
   (* If this is a load, add edges from the most recent store viewed so
      far (if any) and remember the load.  Also add edges from the most
      recent checkbound and forget that checkbound. *)
@@ -264,6 +289,9 @@ method private add_instruction ready_queue instr =
   for i = 0 to Array.length instr.res - 1 do
     Hashtbl.add code_results instr.res.(i).loc node
   done;
+  for i = 0 to Array.length destroyed - 1 do
+    Hashtbl.add code_results destroyed.(i).loc node  (* PR#5731 *)
+  done;
   for i = 0 to Array.length instr.arg - 1 do
     Hashtbl.add code_uses instr.arg.(i).loc node
   done;
index e0d1590eae1bd35884905485f0bf6139f527238f..4d891b5ce6a544d9f9b44707c67213c4cc22f5b3 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of Sparc assembly code *)
 
index fd26e19857aece321a96e829b791b320b5c07b11..3ed88abb178a63645c9ce555772f991bd0ea752a 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: amd64.S 12664 2012-07-09 08:35:23Z lefessan $ */
+/* $Id: amd64.S 12907 2012-09-08 16:51:03Z xleroy $ */
 
 /* Asm part of the runtime system, AMD64 processor */
 /* Must be preprocessed by cpp */
 
 /* Record lowest stack address and return address.  Clobbers %rax. */
 #define RECORD_STACK_FRAME(OFFSET) \
-       pushq   %r11 ; \
+        pushq   %r11 ; \
         movq    8+OFFSET(%rsp), %rax ; \
-       STORE_VAR(%rax,caml_last_return_address) ; \
+        STORE_VAR(%rax,caml_last_return_address) ; \
         leaq    16+OFFSET(%rsp), %rax ; \
-       STORE_VAR(%rax,caml_bottom_of_stack) ; \
-       popq    %r11
+        STORE_VAR(%rax,caml_bottom_of_stack) ; \
+        popq    %r11
 
 #else
 
 
 #define RECORD_STACK_FRAME(OFFSET) \
         movq    OFFSET(%rsp), %rax ; \
-       STORE_VAR(%rax,caml_last_return_address) ; \
+        STORE_VAR(%rax,caml_last_return_address) ; \
         leaq    8+OFFSET(%rsp), %rax ; \
-       STORE_VAR(%rax,caml_bottom_of_stack)
+        STORE_VAR(%rax,caml_bottom_of_stack)
 
 #endif
 
         pushq   %r13; \
         pushq   %r14; \
         pushq   %r15; \
-       subq    $(8+10*16), %rsp; \
-       movupd  %xmm6, 0*16(%rsp); \
+        subq    $(8+10*16), %rsp; \
+        movupd  %xmm6, 0*16(%rsp); \
         movupd  %xmm7, 1*16(%rsp); \
         movupd  %xmm8, 2*16(%rsp); \
         movupd  %xmm9, 3*16(%rsp); \
         pushq   %r13; \
         pushq   %r14; \
         pushq   %r15; \
-       subq    $8, %rsp
+        subq    $8, %rsp
 
 #define POP_CALLEE_SAVE_REGS \
-       addq    $8, %rsp; \
+        addq    $8, %rsp; \
         popq    %r15; \
         popq    %r14; \
         popq    %r13; \
@@ -249,11 +249,11 @@ LBL(caml_call_gc):
         addq    $32768, %rsp
 #endif
     /* Build array of registers, save it into caml_gc_regs */
-        pushq   %r13
-        pushq   %r12
-        pushq   %rbp
         pushq   %r11
         pushq   %r10
+        pushq   %rbp
+        pushq   %r13
+        pushq   %r12
         pushq   %r9
         pushq   %r8
         pushq   %rcx
@@ -264,8 +264,8 @@ LBL(caml_call_gc):
         pushq   %rax
         STORE_VAR(%rsp, caml_gc_regs)
     /* Save caml_young_ptr, caml_exception_pointer */
-       STORE_VAR(%r15, caml_young_ptr)
-       STORE_VAR(%r14, caml_exception_pointer)
+        STORE_VAR(%r15, caml_young_ptr)
+        STORE_VAR(%r14, caml_exception_pointer)
     /* Save floating-point registers */
         subq    $(16*8), %rsp
         CFI_ADJUST(232)
@@ -286,12 +286,12 @@ LBL(caml_call_gc):
         movsd   %xmm14, 14*8(%rsp)
         movsd   %xmm15, 15*8(%rsp)
     /* Call the garbage collector */
-       PREPARE_FOR_C_CALL
+        PREPARE_FOR_C_CALL
         call    GCALL(caml_garbage_collection)
-       CLEANUP_AFTER_C_CALL
+        CLEANUP_AFTER_C_CALL
     /* Restore caml_young_ptr, caml_exception_pointer */
-       LOAD_VAR(caml_young_ptr, %r15)
-       LOAD_VAR(caml_exception_pointer, %r14)
+        LOAD_VAR(caml_young_ptr, %r15)
+        LOAD_VAR(caml_exception_pointer, %r14)
     /* Restore all regs used by the code generator */
         movsd   0*8(%rsp), %xmm0
         movsd   1*8(%rsp), %xmm1
@@ -318,11 +318,11 @@ LBL(caml_call_gc):
         popq    %rcx
         popq    %r8
         popq    %r9
-        popq    %r10
-        popq    %r11
-        popq    %rbp
         popq    %r12
         popq    %r13
+        popq    %rbp
+        popq    %r10
+        popq    %r11
         CFI_ADJUST(-232)
     /* Return to caller */
         ret
@@ -336,9 +336,9 @@ LBL(caml_alloc1):
         ret
 LBL(100):
         RECORD_STACK_FRAME(0)
-       subq    $8, %rsp
+        subq    $8, %rsp
         call    LBL(caml_call_gc)
-       addq    $8, %rsp
+        addq    $8, %rsp
         jmp     LBL(caml_alloc1)
 
 FUNCTION(G(caml_alloc2))
@@ -349,9 +349,9 @@ LBL(caml_alloc2):
         ret
 LBL(101):
         RECORD_STACK_FRAME(0)
-       subq    $8, %rsp
+        subq    $8, %rsp
         call    LBL(caml_call_gc)
-       addq    $8, %rsp
+        addq    $8, %rsp
         jmp     LBL(caml_alloc2)
 
 FUNCTION(G(caml_alloc3))
@@ -362,9 +362,9 @@ LBL(caml_alloc3):
         ret
 LBL(102):
         RECORD_STACK_FRAME(0)
-       subq    $8, %rsp
+        subq    $8, %rsp
         call    LBL(caml_call_gc)
-       addq    $8, %rsp
+        addq    $8, %rsp
         jmp     LBL(caml_alloc3)
 
 FUNCTION(G(caml_allocN))
@@ -398,8 +398,8 @@ LBL(caml_c_call):
         addq    $32768, %rsp
 #endif
     /* Make the exception handler and alloc ptr available to the C code */
-       STORE_VAR(%r15, caml_young_ptr)
-       STORE_VAR(%r14, caml_exception_pointer)
+        STORE_VAR(%r15, caml_young_ptr)
+        STORE_VAR(%r14, caml_exception_pointer)
     /* Call the function (address in %rax) */
     /* No need to PREPARE_FOR_C_CALL since the caller already
        reserved the stack space if needed (cf. amd64/proc.ml) */
@@ -417,14 +417,14 @@ FUNCTION(G(caml_start_program))
     /* Common code for caml_start_program and caml_callback* */
 LBL(caml_start_program):
     /* Build a callback link */
-       subq    $8, %rsp        /* stack 16-aligned */
+        subq    $8, %rsp        /* stack 16-aligned */
         PUSH_VAR(caml_gc_regs)
         PUSH_VAR(caml_last_return_address)
         PUSH_VAR(caml_bottom_of_stack)
         CFI_ADJUST(32)
     /* Setup alloc ptr and exception ptr */
-       LOAD_VAR(caml_young_ptr, %r15)
-       LOAD_VAR(caml_exception_pointer, %r14)
+        LOAD_VAR(caml_young_ptr, %r15)
+        LOAD_VAR(caml_exception_pointer, %r14)
     /* Build an exception handler */
         lea     LBL(108)(%rip), %r13
         pushq   %r13
@@ -440,13 +440,13 @@ LBL(107):
         CFI_ADJUST(-16)
 LBL(109):
     /* Update alloc ptr and exception ptr */
-       STORE_VAR(%r15,caml_young_ptr)
-       STORE_VAR(%r14,caml_exception_pointer)
+        STORE_VAR(%r15,caml_young_ptr)
+        STORE_VAR(%r14,caml_exception_pointer)
     /* Pop the callback link, restoring the global variables */
-       POP_VAR(caml_bottom_of_stack)
+        POP_VAR(caml_bottom_of_stack)
         POP_VAR(caml_last_return_address)
         POP_VAR(caml_gc_regs)
-       addq    $8, %rsp
+        addq    $8, %rsp
     /* Restore callee-save registers. */
         POP_CALLEE_SAVE_REGS
     /* Return to caller. */
@@ -483,10 +483,11 @@ FUNCTION(G(caml_raise_exn))
 LBL(110):
         movq    %rax, %r12            /* Save exception bucket */
         movq    %rax, C_ARG_1         /* arg 1: exception bucket */
-        movq    0(%rsp), C_ARG_2      /* arg 2: pc of raise */
-        leaq    8(%rsp), C_ARG_3      /* arg 3: sp of raise */
+        popq    C_ARG_2               /* arg 2: pc of raise */
+        movq    %rsp, C_ARG_3         /* arg 3: sp at raise */
         movq    %r14, C_ARG_4         /* arg 4: sp of handler */
-       PREPARE_FOR_C_CALL            /* no need to cleanup after */
+       /* PR#5700: thanks to popq above, stack is now 16-aligned */
+        PREPARE_FOR_C_CALL            /* no need to cleanup after */
         call    GCALL(caml_stash_backtrace)
         movq    %r12, %rax            /* Recover exception bucket */
         movq    %r14, %rsp
@@ -506,15 +507,16 @@ FUNCTION(G(caml_raise_exception))
 LBL(111):
         movq    C_ARG_1, %r12            /* Save exception bucket */
                                       /* arg 1: exception bucket */
-       LOAD_VAR(caml_last_return_address,C_ARG_2)   /* arg 2: pc of raise */
+        LOAD_VAR(caml_last_return_address,C_ARG_2)   /* arg 2: pc of raise */
         LOAD_VAR(caml_bottom_of_stack,C_ARG_3)       /* arg 3: sp of raise */
         LOAD_VAR(caml_exception_pointer,C_ARG_4)     /* arg 4: sp of handler */
-       PREPARE_FOR_C_CALL            /* no need to cleanup after */
+        subq    $8, %rsp              /* PR#5700: maintain stack alignment */
+        PREPARE_FOR_C_CALL            /* no need to cleanup after */
         call    GCALL(caml_stash_backtrace)
         movq    %r12, %rax            /* Recover exception bucket */
-       LOAD_VAR(caml_exception_pointer,%rsp)
+        LOAD_VAR(caml_exception_pointer,%rsp)
         popq    %r14                  /* Recover previous exception handler */
-       LOAD_VAR(caml_young_ptr,%r15)  /* Reload alloc ptr */
+        LOAD_VAR(caml_young_ptr,%r15)  /* Reload alloc ptr */
         ret
 
 /* Callback from C to OCaml */
@@ -567,20 +569,20 @@ G(caml_system__frametable):
         .align  EIGHT_ALIGN
 
 #if defined(SYS_macosx)
-       .literal16
+        .literal16
 #elif defined(SYS_mingw64)
-       .section .rdata,"dr"
+        .section .rdata,"dr"
 #else
-       .section    .rodata.cst8,"a",@progbits
+        .section    .rodata.cst8,"a",@progbits
 #endif
         .globl  G(caml_negf_mask)
         .align  SIXTEEN_ALIGN
 G(caml_negf_mask):
-       .quad   0x8000000000000000, 0
+        .quad   0x8000000000000000, 0
         .globl  G(caml_absf_mask)
         .align  SIXTEEN_ALIGN
 G(caml_absf_mask):
-       .quad   0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF
+        .quad   0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF
 
 #if defined(SYS_linux)
     /* Mark stack as non-executable, PR#4564 */
index 76a4732bc15ffc17cc1056ffed5028745b457d69..59697150378475b0b6429e4aa86f4aab3f5f28f6 100644 (file)
@@ -11,7 +11,7 @@
 ;*                                                                     *
 ;***********************************************************************
 
-; $Id: amd64nt.asm 12149 2012-02-10 16:15:24Z doligez $
+; $Id: amd64nt.asm 12907 2012-09-08 16:51:03Z xleroy $
 
 ; Asm part of the runtime system, AMD64 processor, Intel syntax
 
@@ -30,7 +30,7 @@
         EXTRN  caml_bottom_of_stack: QWORD
         EXTRN  caml_last_return_address: QWORD
         EXTRN  caml_gc_regs: QWORD
-       EXTRN  caml_exception_pointer: QWORD
+        EXTRN  caml_exception_pointer: QWORD
         EXTRN  caml_backtrace_active: DWORD
         EXTRN  caml_stash_backtrace: NEAR
 
@@ -48,14 +48,14 @@ caml_call_gc:
         mov     caml_bottom_of_stack, rax
 L105:
     ; Save caml_young_ptr, caml_exception_pointer
-       mov     caml_young_ptr, r15
-       mov     caml_exception_pointer, r14
+        mov     caml_young_ptr, r15
+        mov     caml_exception_pointer, r14
     ; Build array of registers, save it into caml_gc_regs
-        push    r13
-        push    r12
-        push    rbp
         push    r11
         push    r10
+        push    rbp
+        push    r13
+        push    r12
         push    r9
         push    r8
         push    rcx
@@ -113,14 +113,14 @@ L105:
         pop     rcx
         pop     r8
         pop     r9
-        pop     r10
-        pop     r11
-        pop     rbp
         pop     r12
         pop     r13
+        pop     rbp
+        pop     r10
+        pop     r11
     ; Restore caml_young_ptr, caml_exception_pointer
-       mov     r15, caml_young_ptr
-       mov     r14, caml_exception_pointer
+        mov     r15, caml_young_ptr
+        mov     r14, caml_exception_pointer
     ; Return to caller
         ret
 
@@ -136,9 +136,9 @@ L100:
         mov     caml_last_return_address, rax
         lea     rax, [rsp + 8]
         mov     caml_bottom_of_stack, rax
-       sub     rsp, 8
+        sub     rsp, 8
         call    L105
-       add     rsp, 8
+        add     rsp, 8
         jmp     caml_alloc1
 
         PUBLIC  caml_alloc2
@@ -153,9 +153,9 @@ L101:
         mov     caml_last_return_address, rax
         lea     rax, [rsp + 8]
         mov     caml_bottom_of_stack, rax
-       sub     rsp, 8
+        sub     rsp, 8
         call    L105
-       add     rsp, 8
+        add     rsp, 8
         jmp     caml_alloc2
 
         PUBLIC  caml_alloc3
@@ -170,9 +170,9 @@ L102:
         mov     caml_last_return_address, rax
         lea     rax, [rsp + 8]
         mov     caml_bottom_of_stack, rax
-       sub     rsp, 8
+        sub     rsp, 8
         call    L105
-       add     rsp, 8
+        add     rsp, 8
         jmp     caml_alloc3
 
         PUBLIC  caml_allocN
@@ -202,15 +202,15 @@ caml_c_call:
         mov     caml_last_return_address, r12
         mov     caml_bottom_of_stack, rsp
     ; Make the exception handler and alloc ptr available to the C code
-       mov     caml_young_ptr, r15
-       mov     caml_exception_pointer, r14
+        mov     caml_young_ptr, r15
+        mov     caml_exception_pointer, r14
     ; Call the function (address in rax)
         call    rax
     ; Reload alloc ptr
-       mov     r15, caml_young_ptr
+        mov     r15, caml_young_ptr
     ; Return to caller
-       push    r12
-       ret
+        push    r12
+        ret
 
 ; Start the OCaml program
 
@@ -242,13 +242,13 @@ caml_start_program:
     ; Common code for caml_start_program and caml_callback*
 L106:
     ; Build a callback link
-       sub     rsp, 8  ; stack 16-aligned
+        sub     rsp, 8  ; stack 16-aligned
         push    caml_gc_regs
         push    caml_last_return_address
         push    caml_bottom_of_stack
     ; Setup alloc ptr and exception ptr
-       mov     r15, caml_young_ptr
-       mov     r14, caml_exception_pointer
+        mov     r15, caml_young_ptr
+        mov     r14, caml_exception_pointer
     ; Build an exception handler
         lea     r13, L108
         push    r13
@@ -262,13 +262,13 @@ L107:
         pop     r12    ; dummy register
 L109:
     ; Update alloc ptr and exception ptr
-       mov     caml_young_ptr, r15
-       mov     caml_exception_pointer, r14
+        mov     caml_young_ptr, r15
+        mov     caml_exception_pointer, r14
     ; Pop the callback restoring, link the global variables
         pop     caml_bottom_of_stack
         pop     caml_last_return_address
         pop     caml_gc_regs
-       add     rsp, 8
+        add     rsp, 8
     ; Restore callee-save registers.
         movapd  xmm6, OWORD PTR [rsp + 0*16]
         movapd  xmm7, OWORD PTR [rsp + 1*16]
@@ -441,8 +441,8 @@ caml_callback3_exn:
         PUBLIC  caml_ml_array_bound_error
         ALIGN   16
 caml_ml_array_bound_error:
-       lea     rax, caml_array_bound_error
-       jmp     caml_c_call
+        lea     rax, caml_array_bound_error
+        jmp     caml_c_call
 
         .DATA
         PUBLIC  caml_system__frametable
@@ -456,11 +456,11 @@ caml_system__frametable LABEL QWORD
         PUBLIC  caml_negf_mask
         ALIGN   16
 caml_negf_mask LABEL QWORD
-       QWORD   8000000000000000H, 0
+        QWORD   8000000000000000H, 0
 
         PUBLIC  caml_absf_mask
         ALIGN   16
 caml_absf_mask LABEL QWORD
-       QWORD   7FFFFFFFFFFFFFFFH, 0FFFFFFFFFFFFFFFFH
+        QWORD   7FFFFFFFFFFFFFFFH, 0FFFFFFFFFFFFFFFFH
 
         END
index d6f59a20d4b4f63bc86071903774b59436cff3af..cb390e45afcc06bcd309ba5a5d34898d10bae7d3 100644 (file)
@@ -12,7 +12,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: arm.S 12210 2012-03-08 19:52:03Z doligez $ */
+/* $Id: arm.S 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* Asm part of the runtime system, ARM processor */
 /* Must be preprocessed by cpp */
@@ -60,7 +60,7 @@ alloc_limit     .req    r11
 
         .globl  caml_system__code_begin
 caml_system__code_begin:
-        
+
         .align  2
         .globl  caml_call_gc
         .type caml_call_gc, %function
index e8e00a44cf82d118cfe45a2c2bd54cbe96b4bec9..f276587151f449415f407dfc5d2a53a6a8b85d05 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: i386.S 12179 2012-02-21 17:41:02Z xleroy $ */
+/* $Id: i386.S 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* Asm part of the runtime system, Intel 386 processor */
 /* Must be preprocessed by cpp */
@@ -281,9 +281,9 @@ LBL(107):
     /* Pop the exception handler */
         popl    G(caml_exception_pointer)
 #ifdef SYS_macosx
-        addl   $12, %esp
+        addl    $12, %esp
 #else
-        addl   $4, %esp
+        addl    $4, %esp
 #endif
         CFI_ADJUST(-8)
 LBL(109):
@@ -339,7 +339,7 @@ LBL(110):
         .align  FUNCTION_ALIGN
 G(caml_raise_exception):
         PROFILE_C
-       testl   $1, G(caml_backtrace_active)
+        testl   $1, G(caml_backtrace_active)
         jne     LBL(111)
         movl    4(%esp), %eax
         movl    G(caml_exception_pointer), %esp
@@ -429,7 +429,7 @@ G(caml_ml_array_bound_error):
         movl    %edx, G(caml_bottom_of_stack)
     /* For MacOS X: re-align the stack */
 #ifdef SYS_macosx
-        andl   $-16, %esp
+        andl    $-16, %esp
 #endif
     /* Branch to [caml_array_bound_error] (never returns) */
         call    G(caml_array_bound_error)
index 41d77bc53dd33d2124924e512bc16b4a431c5ad6..6a6098a1e063d110f23bef0ba5726231abb31b12 100644 (file)
 ;*                                                                     *
 ;***********************************************************************
 
-; $Id: i386nt.asm 12149 2012-02-10 16:15:24Z doligez $
+; $Id: i386nt.asm 12800 2012-07-30 18:59:07Z doligez $
 
 ; Asm part of the runtime system, Intel 386 processor, Intel syntax
 
-       .386
-       .MODEL FLAT
+        .386
+        .MODEL FLAT
 
         EXTERN  _caml_garbage_collection: PROC
         EXTERN  _caml_apply2: PROC
         EXTERN  _caml_array_bound_error: PROC
         EXTERN  _caml_young_limit: DWORD
         EXTERN  _caml_young_ptr: DWORD
-        EXTERN _caml_bottom_of_stack: DWORD
-        EXTERN _caml_last_return_address: DWORD
-        EXTERN _caml_gc_regs: DWORD
-       EXTERN  _caml_exception_pointer: DWORD
+        EXTERN  _caml_bottom_of_stack: DWORD
+        EXTERN  _caml_last_return_address: DWORD
+        EXTERN  _caml_gc_regs: DWORD
+        EXTERN  _caml_exception_pointer: DWORD
         EXTERN  _caml_backtrace_active: DWORD
         EXTERN  _caml_stash_backtrace: PROC
 
         PUBLIC  _caml_alloc2
         PUBLIC  _caml_alloc3
         PUBLIC  _caml_allocN
-       PUBLIC  _caml_call_gc
+        PUBLIC  _caml_call_gc
 
 _caml_call_gc:
     ; Record lowest stack address and return address
-        mov    eax, [esp]
+        mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
@@ -57,9 +57,9 @@ L105:   push    ebp
         push    eax
         mov     _caml_gc_regs, esp
     ; Call the garbage collector
-        call   _caml_garbage_collection
+        call    _caml_garbage_collection
     ; Restore all regs used by the code generator
-       pop     eax
+        pop     eax
         pop     ebx
         pop     ecx
         pop     edx
@@ -71,13 +71,13 @@ L105:   push    ebp
 
         ALIGN  4
 _caml_alloc1:
-        mov    eax, _caml_young_ptr
-        sub    eax, 8
-        mov    _caml_young_ptr, eax
-        cmp    eax, _caml_young_limit
-        jb     L100
+        mov     eax, _caml_young_ptr
+        sub     eax, 8
+        mov     _caml_young_ptr, eax
+        cmp     eax, _caml_young_limit
+        jb      L100
         ret
-L100:   mov    eax, [esp]
+L100:   mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
@@ -86,13 +86,13 @@ L100:   mov eax, [esp]
 
         ALIGN  4
 _caml_alloc2:
-        mov    eax, _caml_young_ptr
-        sub    eax, 12
-        mov    _caml_young_ptr, eax
-        cmp    eax, _caml_young_limit
-        jb     L101
+        mov     eax, _caml_young_ptr
+        sub     eax, 12
+        mov     _caml_young_ptr, eax
+        cmp     eax, _caml_young_limit
+        jb      L101
         ret
-L101:   mov    eax, [esp]
+L101:   mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
@@ -101,13 +101,13 @@ L101:   mov       eax, [esp]
 
         ALIGN  4
 _caml_alloc3:
-        mov    eax, _caml_young_ptr
-        sub    eax, 16
-        mov    _caml_young_ptr, eax
-        cmp    eax, _caml_young_limit
-        jb     L102
+        mov     eax, _caml_young_ptr
+        sub     eax, 16
+        mov     _caml_young_ptr, eax
+        cmp     eax, _caml_young_limit
+        jb      L102
         ret
-L102:   mov    eax, [esp]
+L102:   mov     eax, [esp]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+4]
         mov     _caml_bottom_of_stack, eax
@@ -126,7 +126,7 @@ L103:   sub     eax, _caml_young_ptr         ; eax = - size
         neg     eax                     ; eax = size
         push    eax                     ; save desired size
         sub     _caml_young_ptr, eax         ; must update young_ptr
-        mov    eax, [esp+4]
+        mov     eax, [esp+4]
         mov     _caml_last_return_address, eax
         lea     eax, [esp+8]
         mov     _caml_bottom_of_stack, eax
@@ -140,12 +140,12 @@ L103:   sub     eax, _caml_young_ptr         ; eax = - size
         ALIGN  4
 _caml_c_call:
     ; Record lowest stack address and return address
-        mov    edx, [esp]
-        mov    _caml_last_return_address, edx
-        lea    edx, [esp+4]
-        mov    _caml_bottom_of_stack, edx
+        mov     edx, [esp]
+        mov     _caml_last_return_address, edx
+        lea     edx, [esp+4]
+        mov     _caml_bottom_of_stack, edx
     ; Call the function (address in %eax)
-        jmp    eax
+        jmp     eax
 
 ; Start the OCaml program
 
@@ -153,10 +153,10 @@ _caml_c_call:
         ALIGN  4
 _caml_start_program:
     ; Save callee-save registers
-        push   ebx
-        push   esi
-        push   edi
-        push   ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial code pointer is caml_program
         mov     esi, offset _caml_program
 
@@ -165,29 +165,29 @@ _caml_start_program:
 L106:
     ; Build a callback link
         push    _caml_gc_regs
-        push   _caml_last_return_address
-        push   _caml_bottom_of_stack
+        push    _caml_last_return_address
+        push    _caml_bottom_of_stack
     ; Build an exception handler
-        push   L108
-        push   _caml_exception_pointer
-        mov    _caml_exception_pointer, esp
+        push    L108
+        push    _caml_exception_pointer
+        mov     _caml_exception_pointer, esp
     ; Call the OCaml code
-        call   esi
+        call    esi
 L107:
     ; Pop the exception handler
-        pop    _caml_exception_pointer
-        pop    esi             ; dummy register
+        pop     _caml_exception_pointer
+        pop     esi             ; dummy register
 L109:
     ; Pop the callback link, restoring the global variables
     ; used by caml_c_call
-        pop    _caml_bottom_of_stack
-        pop    _caml_last_return_address
+        pop     _caml_bottom_of_stack
+        pop     _caml_last_return_address
         pop     _caml_gc_regs
     ; Restore callee-save registers.
-        pop    ebp
-        pop    edi
-        pop    esi
-        pop    ebx
+        pop     ebp
+        pop     edi
+        pop     esi
+        pop     ebx
     ; Return to caller.
         ret
 L108:
@@ -203,8 +203,8 @@ L108:
 _caml_raise_exn:
         test    _caml_backtrace_active, 1
         jne     L110
-        mov    esp, _caml_exception_pointer
-        pop    _caml_exception_pointer
+        mov     esp, _caml_exception_pointer
+        pop     _caml_exception_pointer
         ret
 L110:
         mov     esi, eax                ; Save exception bucket in esi
@@ -228,9 +228,9 @@ L110:
 _caml_raise_exception:
         test    _caml_backtrace_active, 1
         jne     L111
-        mov    eax, [esp+4]
-        mov    esp, _caml_exception_pointer
-        pop    _caml_exception_pointer
+        mov     eax, [esp+4]
+        mov     esp, _caml_exception_pointer
+        pop     _caml_exception_pointer
         ret
 L111:
         mov     esi, [esp+4]            ; Save exception bucket in esi
@@ -250,46 +250,46 @@ L111:
         ALIGN  4
 _caml_callback_exn:
     ; Save callee-save registers
-        push   ebx
-        push   esi
-        push   edi
-        push   ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial loading of arguments
-        mov    ebx, [esp+20]   ; closure
-        mov    eax, [esp+24]   ; argument
-        mov    esi, [ebx]      ; code pointer
+        mov     ebx, [esp+20]   ; closure
+        mov     eax, [esp+24]   ; argument
+        mov     esi, [ebx]      ; code pointer
         jmp     L106
 
         PUBLIC  _caml_callback2_exn
         ALIGN  4
 _caml_callback2_exn:
     ; Save callee-save registers
-        push   ebx
-        push   esi
-        push   edi
-        push   ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial loading of arguments
-        mov    ecx, [esp+20]   ; closure
-        mov    eax, [esp+24]   ; first argument
-        mov    ebx, [esp+28]   ; second argument
-        mov    esi, offset _caml_apply2   ; code pointer
-        jmp    L106
+        mov     ecx, [esp+20]   ; closure
+        mov     eax, [esp+24]   ; first argument
+        mov     ebx, [esp+28]   ; second argument
+        mov     esi, offset _caml_apply2   ; code pointer
+        jmp     L106
 
         PUBLIC  _caml_callback3_exn
-        ALIGN  4
+        ALIGN   4
 _caml_callback3_exn:
     ; Save callee-save registers
-        push   ebx
-        push   esi
-        push   edi
-        push   ebp
+        push    ebx
+        push    esi
+        push    edi
+        push    ebp
     ; Initial loading of arguments
-        mov    edx, [esp+20]   ; closure
-        mov    eax, [esp+24]   ; first argument
-        mov    ebx, [esp+28]   ; second argument
-        mov    ecx, [esp+32]   ; third argument
-        mov    esi, offset _caml_apply3   ; code pointer
-        jmp    L106
+        mov     edx, [esp+20]   ; closure
+        mov     eax, [esp+24]   ; first argument
+        mov     ebx, [esp+28]   ; second argument
+        mov     ecx, [esp+32]   ; third argument
+        mov     esi, offset _caml_apply3   ; code pointer
+        jmp     L106
 
         PUBLIC  _caml_ml_array_bound_error
         ALIGN   4
index 9183fc7f0bd7afd45d2f7e75b18cb99b4dfc20d2..fa18242161314b9f12c4c0f7946987e17d5a5fb1 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: power-elf.S 12160 2012-02-17 10:43:50Z xleroy $ */
+/* $Id: power-elf.S 12800 2012-07-30 18:59:07Z doligez $ */
 
 #define Addrglobal(reg,glob) \
         addis   reg, 0, glob@ha; \
@@ -29,7 +29,7 @@
 
         .globl  caml_system__code_begin
 caml_system__code_begin:
-        
+
         .globl  caml_call_gc
         .type   caml_call_gc, @function
 caml_call_gc:
index a42652b688688f81c6280f5905c5941b174775fc..eab18095b2b0a57d33c97de2554d42024636f973 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: power-rhapsody.S 12159 2012-02-17 10:12:09Z xleroy $ */
+/* $Id: power-rhapsody.S 12800 2012-07-30 18:59:07Z doligez $ */
 
 #ifdef __ppc64__
 #define X(a,b) b
@@ -43,7 +43,7 @@
 
         .globl  _caml_system__code_begin
 _caml_system__code_begin:
-        
+
 /* Invoke the garbage collector. */
 
         .globl  _caml_call_gc
@@ -287,8 +287,8 @@ L113:
 L112:
         mr      r28, r3        /* preserve exn bucket in callee-save */
                                /* arg 1: exception bucket (already in r3) */
-       Loadglobal r4, _caml_last_return_address, r11 /* arg 2: PC of raise */
-       Loadglobal r5, _caml_bottom_of_stack, r11 /* arg 3: SP of raise */
+        Loadglobal r4, _caml_last_return_address, r11 /* arg 2: PC of raise */
+        Loadglobal r5, _caml_bottom_of_stack, r11 /* arg 3: SP of raise */
         Loadglobal r6, _caml_exception_pointer, r11 /* arg 4: SP of handler */
         addi    r1, r1, -(16*WORD)    /* reserve stack space for C call */
         bl      _caml_stash_backtrace
@@ -487,4 +487,4 @@ _caml_system__frametable:
         gdata   L105 + 4       /* return address into callback */
         .short  -1              /* negative size count => use callback link */
         .short  0               /* no roots here */
-       .align  X(2,3)
+        .align  X(2,3)
index 720bcae4324c368ebc23942253d126aaea063807..0df8a24d0345f6c3342e1253ac5e18b04ef77ecc 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: roots.c 12149 2012-02-10 16:15:24Z doligez $ */
+/* $Id: roots.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* To walk the memory roots for garbage collection */
 
@@ -369,5 +369,3 @@ uintnat caml_stack_usage (void)
     sz += (*caml_stack_usage_hook)();
   return sz;
 }
-
-
index 918a02a72f4581621b817ccd6ad238b17f828def..19cb6d83fd8079fdd57d475a5c41254c68ee1345 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: sparc.S 12159 2012-02-17 10:12:09Z xleroy $ */
+/* $Id: sparc.S 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* Asm part of the runtime system for the Sparc processor.  */
 /* Must be preprocessed by cpp */
@@ -351,10 +351,10 @@ caml_system__frametable:
         .half   0               /* no roots */
 
 #ifdef SYS_solaris
-       .type caml_allocN, #function
-       .type caml_call_gc, #function
+        .type caml_allocN, #function
+        .type caml_call_gc, #function
         .type caml_c_call, #function
         .type caml_start_program, #function
         .type caml_raise_exception, #function
-       .type caml_system__frametable, #object
+        .type caml_system__frametable, #object
 #endif
index a586202281913937739e98dc763f4d4b4ed5755c..bc99e6c184b9fb11453615a4c12602461e9f534a 100755 (executable)
Binary files a/boot/ocamlc and b/boot/ocamlc differ
index 9f54a439fe9059342ac30d952068347727668992..468fff359acb7f4d8293d4cfe64625324833c8ec 100755 (executable)
Binary files a/boot/ocamldep and b/boot/ocamldep differ
index 79ca85f840ce3c3619df3fde6a68feb2950f0064..105cb698d048f8c6a924d2abf2cee85416ddb0de 100755 (executable)
Binary files a/boot/ocamllex and b/boot/ocamllex differ
index 459dce029355e864cb4416a5034f5827088a3cea..821883a3af6dcb9ac41768d95aa8814c265befbc 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: bytepackager.ml 12202 2012-03-07 17:50:17Z frisch $ *)
+(* $Id: bytepackager.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* "Package" a set of .cmo files into one .cmo file having the
    original compilation units as sub-modules. *)
@@ -68,7 +68,7 @@ let rename_relocation packagename objfile mapping defined base (rel, ofs) =
           (* PR#5276, as above *)
           let name = Ident.name id in
           if String.contains name '.' then
-           Reloc_setglobal (Ident.create_persistent (packagename ^ "." ^ name))
+            Reloc_setglobal (Ident.create_persistent (packagename ^ "." ^ name))
           else
             rel
         end
@@ -235,10 +235,10 @@ let package_object_files ppf files targetfile targetname coercion =
 let package_files ppf files targetfile =
     let files =
     List.map
-       (fun f ->
+        (fun f ->
         try find_in_path !Config.load_path f
         with Not_found -> raise(Error(File_not_found f)))
-       files in
+        files in
     let prefix = chop_extensions targetfile in
     let targetcmi = prefix ^ ".cmi" in
     let targetname = String.capitalize(Filename.basename prefix) in
index 3ff157a3507ed8f101292e5535192ab26aa9e9aa..8dd21aeba377865a0c5a085df637ba3ee8cac226 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: matching.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: matching.ml 12961 2012-09-27 13:30:07Z garrigue $ *)
 
 (* Compilation of pattern matching *)
 
@@ -170,7 +170,7 @@ let ctx_matcher p =
       | _ -> raise NoMatch)
   | Tpat_constant cst ->
       (fun q rem -> match q.pat_desc with
-      | Tpat_constant cst' when cst=cst' ->
+      | Tpat_constant cst' when const_compare cst cst' = 0 ->
           p,rem
       | Tpat_any -> p,rem
       | _ -> raise NoMatch)
@@ -321,7 +321,7 @@ let jumps_add i pss jumps = match pss with
     add jumps
 
 
-let rec jumps_union env1 env2 = match env1,env2 with
+let rec jumps_union (env1:(int*ctx list)list) env2 = match env1,env2 with
 | [],_ -> env2
 | _,[] -> env1
 | ((i1,pss1) as x1::rem1), ((i2,pss2) as x2::rem2) ->
@@ -433,7 +433,7 @@ let pretty_precompiled_res first nexts =
 (* A slight attempt to identify semantically equivalent lambda-expressions *)
 exception Not_simple
 
-let rec raw_rec env = function
+let rec raw_rec env : lambda -> lambda = function
   | Llet(Alias,x,ex, body) -> raw_rec ((x,raw_rec env ex)::env) body
   | Lvar id as l ->
       begin try List.assoc id env with
@@ -549,7 +549,8 @@ let rec simplify_cases args cls = match args with
               simplify rem
           | Tpat_record (lbls, closed) ->
               let all_lbls = all_record_args lbls in
-              let full_pat = {pat with pat_desc=Tpat_record (all_lbls, closed)} in
+              let full_pat =
+                {pat with pat_desc=Tpat_record (all_lbls, closed)} in
               (full_pat::patl,action)::
               simplify rem
           | Tpat_or _ ->
@@ -1023,9 +1024,9 @@ type cell =
   ctx : ctx list ;
   pat : pattern}
 
-let add make_matching_fun division key patl_action args =
+let add make_matching_fun division eq_key key patl_action args =
   try
-    let cell = List.assoc key division in
+    let (_,cell) = List.find (fun (k,_) -> eq_key key k) division in
     cell.pm.cases <- patl_action :: cell.pm.cases;
     division
   with Not_found ->
@@ -1034,14 +1035,14 @@ let add make_matching_fun division key patl_action args =
     (key, cell) :: division
 
 
-let divide make get_key get_args ctx pm =
+let divide make eq_key get_key get_args ctx pm =
 
   let rec divide_rec = function
     | (p::patl,action) :: rem ->
         let this_match = divide_rec rem in
         add
           (make p pm.default ctx)
-          this_match (get_key p) (get_args p patl,action) pm.args
+          this_match eq_key (get_key p) (get_args p patl,action) pm.args
     | _ -> [] in
 
   divide_rec pm.cases
@@ -1084,8 +1085,8 @@ let rec matcher_const cst p rem = match p.pat_desc with
       matcher_const cst p1 rem with
     | NoMatch -> matcher_const cst p2 rem
     end
-| Tpat_constant c1 when c1=cst -> rem
-| Tpat_any                     -> rem
+| Tpat_constant c1 when const_compare c1 cst = 0 -> rem
+| Tpat_any    -> rem
 | _ -> raise NoMatch
 
 let get_key_constant caller = function
@@ -1114,7 +1115,8 @@ let make_constant_matching p def ctx = function
 
 let divide_constant ctx m =
   divide
-    make_constant_matching (get_key_constant "divide")
+    make_constant_matching
+    (fun c d -> const_compare c d = 0) (get_key_constant "divide")
     get_args_constant
     ctx m
 
@@ -1167,13 +1169,13 @@ let matcher_constr cstr = match cstr.cstr_arity with
         | None, Some r2 -> r2
         | Some (a1::rem1), Some (a2::_) ->
             {a1 with
-pat_loc = Location.none ;
-pat_desc = Tpat_or (a1, a2, None)}::
+             pat_loc = Location.none ;
+             pat_desc = Tpat_or (a1, a2, None)}::
             rem
         | _, _ -> assert false
         end
-    | Tpat_construct (_, _, cstr1, [arg],_) when cstr.cstr_tag = cstr1.cstr_tag ->
-        arg::rem
+    | Tpat_construct (_, _, cstr1, [arg],_)
+      when cstr.cstr_tag = cstr1.cstr_tag -> arg::rem
     | Tpat_any -> omega::rem
     | _ -> raise NoMatch in
     matcher_rec
@@ -1181,7 +1183,7 @@ pat_desc = Tpat_or (a1, a2, None)}::
     fun q rem -> match q.pat_desc with
     | Tpat_or (_,_,_) -> raise OrPat
     | Tpat_construct (_, _, cstr1, args,_)
-        when cstr.cstr_tag = cstr1.cstr_tag -> args @ rem
+      when cstr.cstr_tag = cstr1.cstr_tag -> args @ rem
     | Tpat_any -> Parmatch.omegas cstr.cstr_arity @ rem
     | _        -> raise NoMatch
 
@@ -1205,7 +1207,7 @@ let make_constr_matching p def ctx = function
 let divide_constructor ctx pm =
   divide
     make_constr_matching
-    get_key_constr get_args_constr
+    (=) get_key_constr get_args_constr
     ctx pm
 
 (* Matching against a variant *)
@@ -1269,10 +1271,10 @@ let divide_variant row ctx {cases = cl; args = al; default=def} =
           match pato with
             None ->
               add (make_variant_matching_constant p lab def ctx) variants
-                (Cstr_constant tag) (patl, action) al
+                (=) (Cstr_constant tag) (patl, action) al
           | Some pat ->
               add (make_variant_matching_nonconst p lab def ctx) variants
-                (Cstr_block tag) (pat :: patl, action) al
+                (=) (Cstr_block tag) (pat :: patl, action) al
         end
     | cl -> []
   in
@@ -1524,20 +1526,12 @@ let make_array_matching kind p def ctx = function
 let divide_array kind ctx pm =
   divide
     (make_array_matching kind)
-    get_key_array get_args_array ctx pm
+    (=) get_key_array get_args_array ctx pm
 
 (* To combine sub-matchings together *)
 
-let float_compare s1 s2 =
-  let f1 = float_of_string s1 and f2 = float_of_string s2 in
-  Pervasives.compare f1 f2
-
 let sort_lambda_list l =
-  List.sort
-    (fun (x,_) (y,_) -> match x,y with
-    | Const_float f1, Const_float f2 -> float_compare f1 f2
-    | _, _ -> Pervasives.compare x y)
-    l
+  List.sort (fun (x,_) (y,_) -> const_compare x y) l
 
 let rec cut n l =
   if n = 0 then [],l
@@ -2329,7 +2323,8 @@ let rec comp_exit ctx m = match m.default with
 
 
 
-let rec comp_match_handlers comp_fun partial ctx arg first_match next_matchs = match next_matchs with
+let rec comp_match_handlers comp_fun partial ctx arg first_match next_matchs =
+  match next_matchs with
   | [] -> comp_fun partial ctx arg first_match
   | rem ->
       let rec c_rec body total_body = function
index b515cd1aedcb85e4830b7802aa5a1a2e44f45445..520e25283e0b6f37cc45f4db156141ae95533259 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: translcore.ml 12681 2012-07-10 08:33:16Z garrigue $ *)
+(* $Id: translcore.ml 12871 2012-08-21 07:14:03Z lefessan $ *)
 
 (* Translation from typed abstract syntax to lambda terms,
    for the core language *)
@@ -286,6 +286,12 @@ let prim_obj_dup =
   { prim_name = "caml_obj_dup"; prim_arity = 1; prim_alloc = true;
     prim_native_name = ""; prim_native_float = false }
 
+let find_primitive loc prim_name =
+  match prim_name with
+      "%revapply" -> Prevapply loc
+    | "%apply" -> Pdirapply loc
+    | name -> Hashtbl.find primitives_table name
+
 let transl_prim loc prim args =
   let prim_name = prim.prim_name in
   try
@@ -324,11 +330,7 @@ let transl_prim loc prim args =
     end
   with Not_found ->
   try
-    let p =
-      match prim_name with
-          "%revapply" -> Prevapply loc
-        | "%apply" -> Pdirapply loc
-        | name -> Hashtbl.find primitives_table name in
+    let p = find_primitive loc prim_name in
     (* Try strength reduction based on the type of the argument *)
     begin match (p, args) with
         (Psetfield(n, _), [arg1; arg2]) -> Psetfield(n, maybe_pointer arg2)
@@ -355,7 +357,7 @@ let transl_prim loc prim args =
 
 (* Eta-expand a primitive without knowing the types of its arguments *)
 
-let transl_primitive p =
+let transl_primitive loc p =
   let prim =
     try
       let (gencomp, _, _, _, _, _, _, _) =
@@ -363,7 +365,7 @@ let transl_primitive p =
       gencomp
     with Not_found ->
     try
-      Hashtbl.find primitives_table p.prim_name
+      find_primitive loc p.prim_name
     with Not_found ->
       Pccall p in
   match prim with
@@ -584,7 +586,7 @@ and transl_exp0 e =
         Lfunction(Curried, [obj; meth; cache; pos],
                   Lsend(Cached, Lvar meth, Lvar obj, [Lvar cache; Lvar pos], e.exp_loc))
       else
-        transl_primitive p
+        transl_primitive e.exp_loc p
   | Texp_ident(path, _, {val_kind = Val_anc _}) ->
       raise(Error(e.exp_loc, Free_super_var))
   | Texp_ident(path, _, {val_kind = Val_reg | Val_self _}) ->
index 5914b4dd9a73ec86b7727482a2f192441e30720e..7203dcb9f33563f8a77d7d4548281b839e330905 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: translcore.mli 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: translcore.mli 12871 2012-08-21 07:14:03Z lefessan $ *)
 
 (* Translation from typed abstract syntax to lambda terms,
    for the core language *)
@@ -27,7 +27,7 @@ val transl_apply: lambda -> (label * expression option * optional) list
                   -> Location.t -> lambda
 val transl_let:
       rec_flag -> (pattern * expression) list -> lambda -> lambda
-val transl_primitive: Primitive.description -> lambda
+val transl_primitive: Location.t -> Primitive.description -> lambda
 val transl_exception:
       Ident.t -> Path.t option -> exception_declaration -> lambda
 
index a39c117895d684b9148768643ab07d8a4a81ff33..fe4a20171b0a19f52deb3123a062901ff61bc6f6 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: translmod.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: translmod.ml 12871 2012-08-21 07:14:03Z lefessan $ *)
 
 (* Translation from typed abstract syntax to lambda terms,
    for the module language *)
@@ -50,7 +50,7 @@ let rec apply_coercion restr arg =
             (Lapply(Lvar id, [apply_coercion cc_arg (Lvar param)],
                     Location.none))))
   | Tcoerce_primitive p ->
-      transl_primitive p
+      transl_primitive Location.none p
 
 and apply_coercion_field id (pos, cc) =
   apply_coercion cc (Lprim(Pfield pos, [Lvar id]))
@@ -279,7 +279,7 @@ and transl_structure fields cc rootpath = function
                 List.map
                   (fun (pos, cc) ->
                     match cc with
-                      Tcoerce_primitive p -> transl_primitive p
+                      Tcoerce_primitive p -> transl_primitive Location.none p
                     | _ -> apply_coercion cc (Lvar v.(pos)))
                   pos_cc_list)
       | _ ->
@@ -480,7 +480,8 @@ let transl_store_structure glob map prims str =
 
   and store_primitive (pos, prim) cont =
     Lsequence(Lprim(Psetfield(pos, false),
-                    [Lprim(Pgetglobal glob, []); transl_primitive prim]),
+                    [Lprim(Pgetglobal glob, []);
+                     transl_primitive Location.none prim]),
               cont)
 
   in List.fold_right store_primitive prims (transl_store !transl_store_subst str)
index 11a2cad2035f00a67c2dbfa8ba6c5b32801c88d5..dec89e6f2d18741920a4dd9b0726ff33c30f4bf7 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: compact.c 12621 2012-06-20 15:39:09Z doligez $ */
+/* $Id: compact.c 12910 2012-09-10 09:52:09Z doligez $ */
 
 #include <string.h>
 
@@ -331,7 +331,7 @@ static void do_compaction (void)
         word q = *p;
         if (Color_hd (q) == Caml_white){
           size_t sz = Bhsize_hd (q);
-          char *newadr = compact_allocate (sz);  Assert (newadr <= (char *)p);
+          char *newadr = compact_allocate (sz);
           memmove (newadr, p, sz);
           p += Wsize_bsize (sz);
         }else{
@@ -384,7 +384,8 @@ static void do_compaction (void)
     while (ch != NULL){
       if (Chunk_size (ch) > Chunk_alloc (ch)){
         caml_make_free_blocks ((value *) (ch + Chunk_alloc (ch)),
-                               Wsize_bsize (Chunk_size(ch)-Chunk_alloc(ch)), 1);
+                               Wsize_bsize (Chunk_size(ch)-Chunk_alloc(ch)), 1,
+                               Caml_white);
       }
       ch = Chunk_next (ch);
     }
@@ -397,7 +398,7 @@ uintnat caml_percent_max;  /* used in gc_ctrl.c and memory.c */
 
 void caml_compact_heap (void)
 {
-  uintnat target_size, live;
+  uintnat target_words, target_size, live;
 
   do_compaction ();
   /* Compaction may fail to shrink the heap to a reasonable size
@@ -414,26 +415,33 @@ void caml_compact_heap (void)
      See PR#5389
   */
   /* We compute:
-     freewords = caml_fl_cur_size          (exact)
-     heapsize = caml_heap_size             (exact)
-     live = heap_size - freewords
-     target_size = live * (1 + caml_percent_free / 100)
-                 = live / 100 * (100 + caml_percent_free)
-     We add 1 to live/100 to make sure it isn't 0.
+     freewords = caml_fl_cur_size                  (exact)
+     heapwords = Wsize_bsize (caml_heap_size)      (exact)
+     live = heapwords - freewords
+     wanted = caml_percent_free * (live / 100 + 1) (same as in do_compaction)
+     target_words = live + wanted
+     We add one page to make sure a small difference in counting sizes
+     won't make [do_compaction] keep the second block (and break all sorts
+     of invariants).
 
      We recompact if target_size < heap_size / 2
   */
-  live = caml_stat_heap_size - Bsize_wsize (caml_fl_cur_size);
-  target_size = (live / 100 + 1) * (100 + caml_percent_free);
-  target_size = caml_round_heap_chunk_size (target_size);
+  live = Wsize_bsize (caml_stat_heap_size) - caml_fl_cur_size;
+  target_words = live + caml_percent_free * (live / 100 + 1)
+                 + Wsize_bsize (Page_size);
+  target_size = caml_round_heap_chunk_size (Bsize_wsize (target_words));
   if (target_size < caml_stat_heap_size / 2){
     char *chunk;
 
-    /* round it up to a page size */
+    caml_gc_message (0x10, "Recompacting heap (target=%luk)\n",
+                     target_size / 1024);
+
     chunk = caml_alloc_for_heap (target_size);
     if (chunk == NULL) return;
+    /* PR#5757: we need to make the new blocks blue, or they won't be
+       recognized as free by the recompaction. */
     caml_make_free_blocks ((value *) chunk,
-                           Wsize_bsize (Chunk_size (chunk)), 0);
+                           Wsize_bsize (Chunk_size (chunk)), 0, Caml_blue);
     if (caml_page_table_add (In_heap, chunk, chunk + Chunk_size (chunk)) != 0){
       caml_free_for_heap (chunk);
       return;
@@ -448,6 +456,7 @@ void caml_compact_heap (void)
     do_compaction ();
     Assert (caml_stat_heap_chunks == 1);
     Assert (Chunk_next (caml_heap_start) == NULL);
+    Assert (caml_stat_heap_size == Chunk_size (chunk));
   }
 }
 
index a1d9bac3c8d82bae2117fdf3024305b69c43a7b8..bf9f47d49e9ea91ce7a8ac6972e84f82318f9f69 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: extern.c 12394 2012-04-25 00:40:46Z meyer $ */
+/* $Id: extern.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* Structured output */
 
@@ -823,4 +823,3 @@ static struct code_fragment * extern_find_code(char *addr)
   }
   return NULL;
 }
-
index f84478ba17854a9715b69ce32ed4ad682a0d06d9..a67ce86c18b0fe4e8def37a29556a5b211ea0248 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: freelist.c 12708 2012-07-13 12:03:26Z doligez $ */
+/* $Id: freelist.c 12910 2012-09-10 09:52:09Z doligez $ */
 
 #define FREELIST_DEBUG 0
 #if FREELIST_DEBUG
@@ -509,8 +509,11 @@ void caml_fl_add_blocks (char *bp)
    p: pointer to the first word of the block
    size: size of the block (in words)
    do_merge: 1 -> do merge; 0 -> do not merge
+   color: which color to give to the pieces; if [do_merge] is 1, this
+          is overridden by the merge code, but we have historically used
+          [Caml_white].
 */
-void caml_make_free_blocks (value *p, mlsize_t size, int do_merge)
+void caml_make_free_blocks (value *p, mlsize_t size, int do_merge, int color)
 {
   mlsize_t sz;
 
@@ -520,7 +523,7 @@ void caml_make_free_blocks (value *p, mlsize_t size, int do_merge)
     }else{
       sz = size;
     }
-    *(header_t *)p = Make_header (Wosize_whsize (sz), 0, Caml_white);
+    *(header_t *)p = Make_header (Wosize_whsize (sz), 0, color);
     if (do_merge) caml_fl_merge_block (Bp_hp (p));
     size -= sz;
     p += sz;
index 531e4665f6fecc87483ce88dd4e192883a591263..c34799097ae5361f8675e92a17703717c419492e 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: freelist.h 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: freelist.h 12910 2012-09-10 09:52:09Z doligez $ */
 
 /* Free lists of heap blocks. */
 
@@ -29,7 +29,7 @@ void caml_fl_init_merge (void);
 void caml_fl_reset (void);
 char *caml_fl_merge_block (char *);
 void caml_fl_add_blocks (char *);
-void caml_make_free_blocks (value *, mlsize_t, int);
+void caml_make_free_blocks (value *, mlsize_t, int, int);
 void caml_set_allocation_policy (uintnat);
 
 
index 22b051acb402eb9c85c242f85ee7e0cd970543ee..037c9c5a3de0a736e18a49fe7ccb89df32396dc0 100644 (file)
@@ -29,4 +29,3 @@ CAMLextern uint32 caml_hash_mix_string(uint32 h, value s);
 
 
 #endif
-
index bdeb4a2f3a5b9ea2940e608a62dda24b0bf1dacf..7395d98607fbe0c6958e4c83e3d23e73ab490987 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: intern.c 12441 2012-05-08 13:48:33Z xleroy $ */
+/* $Id: intern.c 12910 2012-09-10 09:52:09Z doligez $ */
 
 /* Structured input, compact format */
 
@@ -337,7 +337,7 @@ static void intern_rec(value *dest)
           ReadItems(&Field(v, 2), size - 2);
           /* Request freshing OID */
           PushItem();
-          sp->op = OFreshOID;                                           
+          sp->op = OFreshOID;
           sp->dest = &Field(v, 1);
           sp->arg = 1;
           /* Finally read first two block elements: method table and old OID */
@@ -463,9 +463,9 @@ static void intern_rec(value *dest)
       case CODE_INFIXPOINTER:
         ofs = read32u();
         /* Read a value to *dest, then offset *dest by ofs */
-        PushItem();                                                     
+        PushItem();
         sp->dest = dest;
-        sp->op = OShift;                                                
+        sp->op = OShift;
         sp->arg = ofs;
         ReadItems(dest, 1);
         continue;  /* with next iteration of main loop, skipping *dest = v */
@@ -489,7 +489,7 @@ static void intern_rec(value *dest)
         caml_failwith("input_value: ill-formed message");
       }
     }
-  } 
+  }
   /* end of case OReadItems */
   *dest = v;
   break;
@@ -558,7 +558,7 @@ static void intern_add_to_heap(mlsize_t whsize)
     Assert(intern_dest <= end_extra_block);
     if (intern_dest < end_extra_block){
       caml_make_free_blocks ((value *) intern_dest,
-                             end_extra_block - intern_dest, 0);
+                             end_extra_block - intern_dest, 0, Caml_white);
     }
     caml_allocated_words +=
       Wsize_bsize ((char *) intern_dest - intern_extra_block);
index ab8f7459a384fbeb7931c7234dee377f9c08067b..99a928584de90c51c3148b1a9034673ee76c7add 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: major_gc.c 12625 2012-06-21 13:43:03Z doligez $ */
+/* $Id: major_gc.c 12910 2012-09-10 09:52:09Z doligez $ */
 
 #include <limits.h>
 
@@ -496,7 +496,7 @@ void caml_init_major_heap (asize_t heap_size)
 
   caml_fl_init_merge ();
   caml_make_free_blocks ((value *) caml_heap_start,
-                         Wsize_bsize (caml_stat_heap_size), 1);
+                         Wsize_bsize (caml_stat_heap_size), 1, Caml_white);
   caml_gc_phase = Phase_idle;
   gray_vals_size = 2048;
   gray_vals = (value *) malloc (gray_vals_size * sizeof (value));
index dc3ba43e736347b8ddf7111a13f7dbbb7c4c738d..2e571272a8dfcf20f81052d73acce276a506c218 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: md5.c 12227 2012-03-13 14:44:48Z xleroy $ */
+/* $Id: md5.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include <string.h>
 #include "alloc.h"
@@ -68,7 +68,7 @@ CAMLprim value caml_md5_chan(value vchan, value len)
   CAMLreturn (res);
 }
 
-CAMLexport void caml_md5_block(unsigned char digest[16], 
+CAMLexport void caml_md5_block(unsigned char digest[16],
                                void * data, uintnat len)
 {
   struct MD5Context ctx;
index eab0c053eca7b879bc099bad8a63c0c3f47785da..a041fab08b7f89210787c15e0921024b45099675 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: md5.h 12227 2012-03-13 14:44:48Z xleroy $ */
+/* $Id: md5.h 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* MD5 message digest */
 
@@ -24,7 +24,7 @@
 
 CAMLextern value caml_md5_string (value str, value ofs, value len);
 CAMLextern value caml_md5_chan (value vchan, value len);
-CAMLextern void caml_md5_block(unsigned char digest[16], 
+CAMLextern void caml_md5_block(unsigned char digest[16],
                                void * data, uintnat len);
 
 struct MD5Context {
index 3ca41da2717d87e98f626794f760cbc3003e0c0a..82357802b4dc6804424e300284c34651b917ad87 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: memory.c 12364 2012-04-17 08:20:35Z doligez $ */
+/* $Id: memory.c 12910 2012-09-10 09:52:09Z doligez $ */
 
 #include <stdlib.h>
 #include <string.h>
@@ -318,7 +318,7 @@ static char *expand_heap (mlsize_t request)
   }
   remain = malloc_request;
   prev = hp = mem;
-  /* XXX find a way to do this with a call to caml_make_free_blocks */
+  /* FIXME find a way to do this with a call to caml_make_free_blocks */
   while (Wosize_bhsize (remain) > Max_wosize){
     Hd_hp (hp) = Make_header (Max_wosize, 0, Caml_blue);
 #ifdef DEBUG
index 2838083fd1c124fb08d68f34b0b83acbe56d5904..c9e94154afe4e4aa33c58489839b88e0721aa909 100644 (file)
@@ -279,7 +279,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
     | TyAnt loc _ -> error loc "antiquotation not allowed here"
     | TyOfAmp _ _ _ |TyAmp _ _ _ |TySta _ _ _ |
       TyCom _ _ _ |TyVrn _ _ |TyQuM _ _ |TyQuP _ _ |TyDcl _ _ _ _ _ |
-         TyAnP _ | TyAnM _ | TyTypePol _ _ _ |
+          TyAnP _ | TyAnM _ | TyTypePol _ _ _ |
       TyObj _ _ (RvAnt _) | TyNil _ | TyTup _ _ ->
         assert False ]
   and row_field = fun
@@ -631,28 +631,28 @@ value varify_constructors var_names =
   let rec loop t =
     let desc =
       match t.ptyp_desc with
-         [
+          [
        Ptyp_any -> Ptyp_any
       | Ptyp_var x -> Ptyp_var x
       | Ptyp_arrow label core_type core_type' ->
-         Ptyp_arrow label (loop core_type) (loop core_type')
+          Ptyp_arrow label (loop core_type) (loop core_type')
       | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
       | Ptyp_constr ({ txt = Lident s }) [] when List.mem s var_names ->
-         Ptyp_var ("&" ^ s)
+          Ptyp_var ("&" ^ s)
       | Ptyp_constr longident lst ->
-         Ptyp_constr longident (List.map loop lst)
+          Ptyp_constr longident (List.map loop lst)
       | Ptyp_object lst ->
-         Ptyp_object (List.map loop_core_field lst)
+          Ptyp_object (List.map loop_core_field lst)
       | Ptyp_class longident lst lbl_list ->
-         Ptyp_class (longident, List.map loop lst, lbl_list)
+          Ptyp_class (longident, List.map loop lst, lbl_list)
       | Ptyp_alias core_type string ->
-         Ptyp_alias(loop core_type, string)
+          Ptyp_alias(loop core_type, string)
       | Ptyp_variant row_field_list flag lbl_lst_option ->
-         Ptyp_variant(List.map loop_row_field row_field_list, flag, lbl_lst_option)
+          Ptyp_variant(List.map loop_row_field row_field_list, flag, lbl_lst_option)
       | Ptyp_poly string_lst core_type ->
-         Ptyp_poly(string_lst, loop core_type)
+          Ptyp_poly(string_lst, loop core_type)
       | Ptyp_package longident lst ->
-         Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
+          Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
 ]
     in
     {(t) with ptyp_desc = desc}
@@ -660,17 +660,17 @@ value varify_constructors var_names =
     let desc =
       match t.pfield_desc with
       [ Pfield(n,typ) ->
-         Pfield(n,loop typ)
+          Pfield(n,loop typ)
       | Pfield_var ->
-         Pfield_var]
+          Pfield_var]
     in
     { (t) with pfield_desc=desc}
   and loop_row_field x  =
     match x with
       [ Rtag(label,flag,lst) ->
-         Rtag(label,flag,List.map loop lst)
+          Rtag(label,flag,List.map loop lst)
       | Rinherit t ->
-         Rinherit (loop t) ]
+          Rinherit (loop t) ]
   in
   loop;
 
@@ -893,10 +893,10 @@ value varify_constructors var_names =
     | <:binding@_loc< $pat:( <:patt@sloc< $lid:bind_name$ >> )$ = ($e$ : $TyTypePol _ vs ty$) >> ->
       (* this code is not pretty because it is temporary *)
       let rec id_to_string x =
-       match x with
-           [ <:ctyp< $lid:x$ >> -> [x]
-           | <:ctyp< $x$ $y$ >> -> (id_to_string x) @ (id_to_string y)
-           | _ -> assert False]
+        match x with
+            [ <:ctyp< $lid:x$ >> -> [x]
+            | <:ctyp< $x$ $y$ >> -> (id_to_string x) @ (id_to_string y)
+            | _ -> assert False]
       in
       let vars = id_to_string vs in
       let ampersand_vars = List.map (fun x -> "&" ^ x) vars in
@@ -905,14 +905,14 @@ value varify_constructors var_names =
       let mkpat = mkpat _loc in
       let e = mkexp (Pexp_constraint (expr e) (Some (ctyp ty)) None) in
       let rec mk_newtypes x =
-       match x with
-         [ [newtype :: []] -> mkexp (Pexp_newtype(newtype, e))
-         | [newtype :: newtypes] ->
-           mkexp(Pexp_newtype (newtype,mk_newtypes newtypes))
-         | [] -> assert False]
+        match x with
+          [ [newtype :: []] -> mkexp (Pexp_newtype(newtype, e))
+          | [newtype :: newtypes] ->
+            mkexp(Pexp_newtype (newtype,mk_newtypes newtypes))
+          | [] -> assert False]
       in
       let pat =
-       mkpat (Ppat_constraint (mkpat (Ppat_var (with_loc bind_name sloc)),
+        mkpat (Ppat_constraint (mkpat (Ppat_var (with_loc bind_name sloc)),
                                 mktyp _loc (Ptyp_poly ampersand_vars ty')))
       in
       let e = mk_newtypes vars in
index c73369959ddc07f2a8bb9465e197762905c7fc35..6d5099a8d0a407fdaa24bc520b10ca918f969825 100644 (file)
@@ -180,9 +180,9 @@ module Make (Token : Sig.Camlp4Token)
       pos_lnum = if absolute then line else pos.pos_lnum + line;
       pos_bol = pos.pos_cnum - chars;
     }
-       
+
     (* To convert integer literals, copied from "../parsing/lexer.mll" *)
-       
+
     let cvt_int_literal s =
       - int_of_string ("-" ^ s)
     let cvt_int32_literal s =
index bbec29b966761ba1cbfb194f265b4a228bb710c4..4a2f8d90c03ce207c5cc9231c49637d0310e5bef 100644 (file)
@@ -107,13 +107,13 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
         | _ -> 1 ])
   ;
 
-  value lident_colon =  
-     Gram.Entry.of_parser "lident_colon"        
-       (fun strm ->     
-         match Stream.npeek 2 strm with         
-         [ [(LIDENT i, _); (KEYWORD ":", _)] ->         
-             do { Stream.junk strm; Stream.junk strm; i }       
-         | _ -> raise Stream.Failure ])         
+  value lident_colon =
+     Gram.Entry.of_parser "lident_colon"
+       (fun strm ->
+         match Stream.npeek 2 strm with
+         [ [(LIDENT i, _); (KEYWORD ":", _)] ->
+             do { Stream.junk strm; Stream.junk strm; i }
+         | _ -> raise Stream.Failure ])
    ;
 
   value rec is_ident_constr_call =
@@ -576,7 +576,7 @@ module Make (Syntax : Sig.Camlp4Syntax) = struct
     optional_type_parameter:
       [ [ `ANTIQUOT (""|"typ"|"anti" as n) s -> <:ctyp< $anti:mk_anti n s$ >>
         | `QUOTATION x -> Quotation.expand _loc x Quotation.DynAst.ctyp_tag
-        | "+"; "_" -> Ast.TyAnP _loc 
+        | "+"; "_" -> Ast.TyAnP _loc
         | "+"; "'"; i = a_ident -> <:ctyp< +'$lid:i$ >>
         | "-"; "_" -> Ast.TyAnM _loc
         | "-"; "'"; i = a_ident -> <:ctyp< -'$lid:i$ >>
index edd5fe0a16a121dc22593d2f1d1267f19aa65aea..328e00f9533931b127ad93e615762d38c4c08a39 100644 (file)
@@ -1055,7 +1055,7 @@ New syntax:\
         | "'"; i = a_ident -> <:ctyp< '$lid:i$ >>
         | "+"; "'"; i = a_ident -> <:ctyp< +'$lid:i$ >>
         | "-"; "'"; i = a_ident -> <:ctyp< -'$lid:i$ >>
-        | "+"; "_" -> Ast.TyAnP _loc 
+        | "+"; "_" -> Ast.TyAnP _loc
         | "-"; "_" -> Ast.TyAnM _loc
         | "_" -> Ast.TyAny _loc
 
@@ -1148,7 +1148,7 @@ New syntax:\
             let (tl, rt) = generalized_type_of_type t in
             <:ctyp< $uid:s$ : ($Ast.tyAnd_of_list tl$ -> $rt$) >>
         | s = a_UIDENT ->
-         <:ctyp< $uid:s$ >>
+          <:ctyp< $uid:s$ >>
       ] ]
     ;
     constructor_declaration:
@@ -1400,9 +1400,9 @@ New syntax:\
     ;
     cvalue_binding:
       [ [ "="; e = expr -> e
-        | ":"; "type"; t1 = unquoted_typevars; "." ; t2 = ctyp ; "="; e = expr -> 
-       let u = Ast.TyTypePol _loc t1 t2 in
-       <:expr< ($e$ : $u$) >>
+        | ":"; "type"; t1 = unquoted_typevars; "." ; t2 = ctyp ; "="; e = expr ->
+        let u = Ast.TyTypePol _loc t1 t2 in
+        <:expr< ($e$ : $u$) >>
         | ":"; t = poly_type; "="; e = expr -> <:expr< ($e$ : $t$) >>
         | ":"; t = poly_type; ":>"; t2 = ctyp; "="; e = expr ->
             match t with
index 0a1778243a42d3a3e6615bda3e54f6ce4a1c87c9..9e49aa0f51959706c5662011b5c808b072e6275c 100644 (file)
@@ -456,10 +456,10 @@ and print_out_type_decl kwd ppf (name, args, ty, priv, constraints) =
   match ty with
   [ Otyp_abstract ->
       fprintf ppf "@[<2>@[<hv 2>@[%s %t@]@]%a@]" kwd type_defined
-       print_constraints constraints
+        print_constraints constraints
   | _ ->
       fprintf ppf "@[<2>@[<hv 2>@[%s %t@] =%a@]%a@]" kwd type_defined
-       print_types ty print_constraints constraints ]
+        print_types ty print_constraints constraints ]
 ;
 
 (* Phrases *)
index e60c7fb59af463018f1dd01a8e59635844fc4580..15953262c5539ff8fea77d80d2317bc956c7f556 100644 (file)
 
   open Camlp4.PreCast;;
   module ArithGram = MakeGram(Lexer);;
-  
+
   type t = Local of string * t * t
          | Binop of t * (int -> int -> int) * t
          | Int   of int
          | Var   of string;;
-  
+
   let expression = ArithGram.Entry.mk "expression";;
-  
+
   EXTEND ArithGram
     GLOBAL: expression;
-  
+
     expression: (* A grammar entry for expressions *)
     [ "top"
       [ "let"; `LIDENT s; "="; e1 = SELF; "in"; e2 = SELF -> Local(s,e1,e2) ]
       | `LIDENT s -> Var(s)
       | "("; e = expression; ")" -> e ]
     ];
-  
+
   END;;
-  
+
   let parse_arith s =
     ArithGram.parse_string expression (Loc.mk "<string>") s;;
-  
+
   let rec eval env =
     function
     | Local(x, e1, e2) ->
@@ -56,8 +56,8 @@
          op (eval env e1) (eval env e2)
     | Int(i) -> i
     | Var(x) -> List.assoc x env;;
-  
+
   let calc s =
     Format.printf "%s ==> %d@." s (eval [] (parse_arith s));;
-  
+
   calc "42 * let x = 21 in x + x";;
index 52c544a02e384de9b8059e3f6ae83d3551ba4260..45f15b996fd1c2a2c809eed1314f108bd2c6a919 100644 (file)
@@ -11,7 +11,7 @@
 .\"*                                                                     *
 .\"***********************************************************************
 .\"
-.\" $Id: camlp4.1.tpl 11156 2011-07-27 14:17:02Z doligez $
+.\" $Id: camlp4.1.tpl 12800 2012-07-30 18:59:07Z doligez $
 .\"
 .TH CAMLP4 1  "" "INRIA"
 .SH NAME
index ddc3c84fed51298f3951c70831d213e92aebd688..19fab689f6373d6039e478742fb7d986e7755691 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: command_line.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: command_line.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (************************ Reading and executing commands ***************)
 
@@ -236,9 +236,9 @@ let instr_env ppf lexbuf =
   if cmdarg <> "" then
     try
       if (String.index cmdarg '=') > 0 then
-       Debugger_config.environment := cmdarg :: !Debugger_config.environment
+        Debugger_config.environment := cmdarg :: !Debugger_config.environment
       else
-       eprintf "Environment variables should not have an empty name\n%!"
+        eprintf "Environment variables should not have an empty name\n%!"
     with Not_found ->
       eprintf "Environment variables should have the \"name=value\" format\n%!"
   else
index 4b9556c44d0325be29cb22a38625ae6f6b19e5a9..727ae641bcc488612dc0b0aacabd14e5174caafd 100644 (file)
@@ -10,7 +10,7 @@
 ;(*                                                                     *)
 ;(***********************************************************************)
 
-;(* $Id: caml-types.el 12695 2012-07-10 17:49:46Z doligez $ *)
+;(* $Id: caml-types.el 12800 2012-07-30 18:59:07Z doligez $ *)
 
 ; An emacs-lisp complement to the "-annot" option of ocamlc and ocamlopt.
 
@@ -687,21 +687,21 @@ The function uses two overlays.
                            (vector target-file target-line target-bol cnum))
                      (save-excursion
                        (setq node (caml-types-find-location target-pos "type" ()
-                                                           target-tree))
+                                                            target-tree))
                        (set-buffer caml-types-buffer)
                        (erase-buffer)
                        (cond
-                       ((null node)
+                        ((null node)
                          (delete-overlay caml-types-expr-ovl)
                          (setq type "*no type information*")
                          (setq limits
                                (caml-types-find-interval
                                 target-buf target-pos target-tree)))
                         (t
-                        (let ((left
-                               (caml-types-get-pos target-buf (elt node 0)))
+                         (let ((left
+                                (caml-types-get-pos target-buf (elt node 0)))
                                (right
-                               (caml-types-get-pos target-buf (elt node 1))))
+                                (caml-types-get-pos target-buf (elt node 1))))
                          (move-overlay
                           caml-types-expr-ovl left right target-buf)
                          (setq limits
@@ -709,7 +709,7 @@ The function uses two overlays.
                                                          target-pos node)
                                type (cdr (assoc "type" (elt node 2))))
                          ))
-                       )
+                        )
                        (setq mes (format "type: %s" type))
                        (insert type)
                        ))
index b1413234a2b20cc20eefbc3aae5e9c102ccea6f7..90a142d99e690ba1d0a88f19d9154e0c6f05eea0 100644 (file)
@@ -10,7 +10,7 @@
 ;(*                                                                     *)
 ;(***********************************************************************)
 
-;(* $Id: caml.el 12152 2012-02-13 17:48:41Z doligez $ *)
+;(* $Id: caml.el 12973 2012-09-28 16:54:20Z doligez $ *)
 
 ;;; caml.el --- OCaml code editing commands for Emacs
 
@@ -1185,6 +1185,11 @@ Used to distinguish it from toplevel let construct.")
 (defconst caml-kwop-regexps (make-vector 9 nil)
   "Array of regexps representing caml keywords of different priorities.")
 
+(defun caml-in-shebang-line ()
+  (save-excursion
+    (beginning-of-line)
+    (and (= 1 (point)) (looking-at "#!"))))
+
 (defun caml-in-expr-p ()
   (let ((pos (point)) (in-expr t))
     (caml-find-kwop
@@ -1192,6 +1197,8 @@ Used to distinguish it from toplevel let construct.")
              caml-matching-kw-regexp "\\|"
              (aref caml-kwop-regexps caml-max-indent-priority)))
     (cond
+     ; special case for #! at beginning of file
+     ((caml-in-shebang-line) (setq in-expr nil))
      ; special case for ;;
      ((and (> (point) 1) (= (preceding-char) ?\;) (= (following-char) ?\;))
       (setq in-expr nil))
index b1b2660d8241c6fe23c50a5d90b49fde99789298..a805c3890b45c7c63b2b48934ce547311934e4a0 100644 (file)
@@ -10,7 +10,7 @@
 ;(*                                                                     *)
 ;(***********************************************************************)
 
-;(* $Id: camldebug.el 12149 2012-02-10 16:15:24Z doligez $ *)
+;(* $Id: camldebug.el 12800 2012-07-30 18:59:07Z doligez $ *)
 
 ;;; Run camldebug under Emacs
 ;;; Derived from gdb.el.
@@ -575,7 +575,7 @@ the camldebug commands `cd DIR' and `directory'."
         (let ((process-window))
           ;; it does not seem necessary to save excursion here,
           ;; since set-buffer as a temporary effect.
-          ;; comint-output-filter explicitly avoids it. 
+          ;; comint-output-filter explicitly avoids it.
           ;; in version 23, it prevents the marker to stay at end of buffer
           ;; (save-excursion
             (set-buffer (process-buffer proc))
@@ -595,8 +595,8 @@ the camldebug commands `cd DIR' and `directory'."
                                       (get-buffer-window (current-buffer))))
             ;; Insert the text, moving the process-marker.
             (comint-output-filter proc output)
-          ;; ) 
-          ;; this was the end of save-excursion. 
+          ;; )
+          ;; this was the end of save-excursion.
           ;; if save-excursion is used (comint-next-prompt 1) would be needed
           ;; to move the mark past then next prompt, but this is not as good
           ;; as solution.
index 47a4deb85acac15e65841099363cdb3a2ecf844b..4c6c7d89eb88be1057c1d004c7c23c9bc289ac79 100644 (file)
@@ -12,7 +12,7 @@
 ;(*                                                                     *)
 ;(***********************************************************************)
 
-;(* $Id: ocamltags.in 11156 2011-07-27 14:17:02Z doligez $ *)
+;(* $Id: ocamltags.in 12800 2012-07-30 18:59:07Z doligez $ *)
 
 ;; Copyright (C) 1998 Ian Zimmerman <itz@transbay.net>
 ;;  This program is free software; you can redistribute it and/or
@@ -24,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 11156 2011-07-27 14:17:02Z doligez $
+;; $Id: ocamltags.in 12800 2012-07-30 18:59:07Z doligez $
 
 (require 'caml)
 
index fc55d12afa7b9b7334da20df7209e8ece4a46195..6f9a39b08ea871cdd35a36ac163ad99a9bd8b5f1 100644 (file)
@@ -10,7 +10,7 @@
 .\"*                                                                     *
 .\"***********************************************************************
 .\"
-.\" $Id: ocamlc.m 12527 2012-05-31 15:15:03Z doligez $
+.\" $Id: ocamlc.m 12800 2012-07-30 18:59:07Z doligez $
 .\"
 .TH OCAMLC 1
 
@@ -407,7 +407,7 @@ specify the name of the output file produced.
 .B \-output\-obj
 Cause the linker to produce a C object file instead of a bytecode
 executable file. This is useful to wrap OCaml code as a C library,
-callable from any C program. The name of the output object file 
+callable from any C program. The name of the output object file
 must be set with the
 .B \-o
 option. This
index 50df4ea523984d6f53736ddb4d6235baa34e2dc4..2cb71761f42d8135359b6f1f75801bb6e408ee98 100644 (file)
@@ -10,7 +10,7 @@
 .\"*                                                                     *
 .\"***********************************************************************
 .\"
-.\" $Id: ocamldoc.m 11156 2011-07-27 14:17:02Z doligez $
+.\" $Id: ocamldoc.m 12800 2012-07-30 18:59:07Z doligez $
 .\"
 .TH OCAMLDOC 1
 
@@ -253,7 +253,7 @@ as the title for the generated documentation.
 .BI \-intro \ file
 Use content of
 .I file
-as 
+as
 .B ocamldoc
 text to use as introduction (HTML, LaTeX and TeXinfo only).
 For HTML, the file is used to create the whole "index.html" file.
index 2e22e5fd86ece76f702f2b71c9b9ff45ae8210ae..eaf0cde1223d35299c3ba9ef895e71366bb1e059 100644 (file)
@@ -10,7 +10,7 @@
 .\"*                                                                     *
 .\"***********************************************************************
 .\"
-.\" $Id: ocamlopt.m 12428 2012-05-03 17:01:27Z doligez $
+.\" $Id: ocamlopt.m 12800 2012-07-30 18:59:07Z doligez $
 .\"
 .TH OCAMLOPT 1
 
@@ -171,8 +171,8 @@ file can be used with the emacs commands given in
 to display types and other annotations interactively.
 .TP
 .B \-dtypes
-Has been deprecated. Please use 
-.BI \-annot 
+Has been deprecated. Please use
+.BI \-annot
 instead.
 .TP
 .B \-c
@@ -336,7 +336,7 @@ option is given, specify the name of plugin file produced.
 .B \-output\-obj
 Cause the linker to produce a C object file instead of an executable
 file. This is useful to wrap OCaml code as a C library,
-callable from any C program. The name of the output object file 
+callable from any C program. The name of the output object file
 must be set with the
 .B \-o
 option.
index 0899500eb36217bf791c2f246a0001568b97cd1a..183be582104acd18a27f46f952d1e93aadc45345 100644 (file)
        * ocamlbuild.ml: Add some flags -lflag, -ppflag, -cflag, --.
        Also add a detection mechanism for dependencies.
        * discard_printf.ml, Makefile: Update.
-
index a7839d059dca5a10ee30a37a1a2672ab1354f768..a9478ab5acfe9a0d0a4e6a890c84f0ecc2d701b7 100644 (file)
@@ -119,6 +119,21 @@ module List = struct
   let union a b =
     rev (rev_append_uniq (rev_append_uniq [] a) b)
 
+  let ordered_unique (type el) (lst : el list)  =
+    let module Set = Set.Make(struct
+      type t = el
+      let compare = Pervasives.compare
+      let print _ _ = ()
+    end)
+    in
+    let _, lst =
+      List.fold_left (fun (set,acc) el ->
+        if Set.mem el set
+        then set, acc
+        else Set.add el set, el :: acc) (Set.empty,[]) lst
+    in
+    List.rev lst
+
 end
 
 module String = struct
index e23a0e99d494832262a05099413a9ddd8718de4d..05343de13e6c993695dc94b1527f92ab1ee22aff 100644 (file)
@@ -474,7 +474,7 @@ let () =
     (fun param -> S [A "-pp"; A param]);
   pflag ["ocaml"; "infer_interface"] "pp"
     (fun param -> S [A "-pp"; A param]);
-  pflag ["ocaml";"compile";] "warn" 
+  pflag ["ocaml";"compile";] "warn"
     (fun param -> S [A "-w"; A param])
 
 let camlp4_flags camlp4s =
index 9b56f12d5dec2cae8b09bf3a829f3f785a25f3c9..c3b04f06e40ae628be73ba64f3bb9d67268d292e 100644 (file)
@@ -39,4 +39,4 @@ Ocaml_dependencies
 Exit_codes
 Digest_cache
 Ocamlbuild_plugin
-Findlib
\ No newline at end of file
+Findlib
index 9653afbcc6188fe87ffa6c1e56b63fecb036fd29..09dc4e02623feda19b36ec65fecb72ed92ff48cb 100644 (file)
@@ -38,4 +38,4 @@ Ocaml_dependencies
 Exit_codes
 Digest_cache
 Findlib
-Param_tags
\ No newline at end of file
+Param_tags
index 02001dedb79f2dee23b15a0d36cad46353328309..94e967881405e02730bd43522de8a47a67f47e7f 100644 (file)
 (* Original author: Romain Bardou *)
 
 module StringSet = Set.Make(String)
-module SSOSet = Set.Make(struct
-  type t = string * string option
-  let compare = Pervasives.compare
-end)
 
 (* tag name -> tag action (string -> unit) *)
 let declared_tags = Hashtbl.create 17
 
-let acknowledged_tags = ref SSOSet.empty
+let acknowledged_tags = ref []
 
 let only_once f =
   let instances = ref StringSet.empty in
@@ -37,7 +33,8 @@ let declare name action =
 
 let acknowledge tag =
   let tag = Lexers.tag_gen (Lexing.from_string tag) in
-  acknowledged_tags := SSOSet.add tag !acknowledged_tags
+  acknowledged_tags := tag :: !acknowledged_tags
+
 
 let really_acknowledge (name, param) =
   match param with
@@ -51,6 +48,6 @@ let really_acknowledge (name, param) =
         List.iter (fun f -> f param) actions
 
 let init () =
-  SSOSet.iter really_acknowledge !acknowledged_tags
+  List.iter really_acknowledge (My_std.List.ordered_unique !acknowledged_tags)
 
 let make = Printf.sprintf "%s(%s)"
index 3b6c44eca95e5af25545f686f830fce1c814372a..c191cbefcb56bd122020d2fec06f5ac6bda8c92b 100644 (file)
@@ -33,7 +33,7 @@ module type LIST = sig
   val print : (Format.formatter -> 'a -> 'b) -> Format.formatter -> 'a list -> unit
   val filter_opt : ('a -> 'b option) -> 'a list -> 'b list
   val union : 'a list -> 'a list -> 'a list
-
+  val ordered_unique : 'a list -> 'a list
   (* Original functions *)
   include module type of List
 end
index 3707d265bd7a452d2f89b12315c4943495e199e1..49ed84d24d9751da02fbd036835a6341b3f3865c 100644 (file)
@@ -6,8 +6,8 @@ TODO:
      module type M = sig type u end
      module N : sig include M val f: u -> unit end
    Here, in html for example, f in displayed being of type Foo.u instead of Foo.M.u
- - latex: types variant polymorphes dépassent de la page quand ils sont trop longs
- - utilisation nouvelles infos de Xavier: "début de rec", etc.
+ - latex: types variant polymorphes depassent de la page quand ils sont trop longs
+ - utilisation nouvelles infos de Xavier: "debut de rec", etc.
  - xml generator
 
 =====
@@ -61,12 +61,12 @@ Release 3.08.1:
 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)
- - ajout Ã  la doc: fichier de l'option -intro utilisé pour l'index en html
+ - ajout a la doc de Module_list et Index_list (utilise dans le html seulement)
+ - ajout a la doc: fichier de l'option -intro utilise pour l'index en html
  - fix: create a Module_with instead of a Module_alias when we encounter
      module A : Foo in a signature
  - latex: style latex pour indenter dans les module kind et les class kind
- - latex: il manque la génération des paramètres de classe
+ - latex: il manque la generation des parametres de classe
  - parse des {!modules: } et {!indexlist}
  - gestion des Module_list et Index_list
  - no need to Dynlink.add_available_units any more
index 7c025e1278bee5bfff9f9f44897e0e5130b4fe8f..626236cf1a7b2063dbe3571ade32030c02e680f6 100644 (file)
@@ -48,7 +48,7 @@ struct
     method private gen_if_tag name target info_opt =
       match info_opt with
         None -> ()
-      |        Some i ->
+      | Some i ->
           let l =
             List.fold_left
               (fun acc (t, text) ->
@@ -69,7 +69,7 @@ struct
                        | _ -> (None, text) :: acc
 
                      end
-                 |     _ -> acc
+                 | _ -> acc
               )
               []
               i.i_custom
index 6e86af0b647cfe40d078c68ae0fd64be4e0f51ff..8eb26eaac3dc4e895cee9cf0ee17d46a4d73e93a 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_analyse.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: odoc_analyse.ml 12862 2012-08-16 09:44:48Z guesdon $ *)
 
 (** Analysis of source files. This module is strongly inspired from
     driver/main.ml :-) *)
@@ -115,7 +115,7 @@ let process_implementation_file ppf sourcefile =
     let parsetree = parse_file inputfile Parse.implementation ast_impl_magic_number in
     let typedtree =
       Typemod.type_implementation
-       sourcefile prefixname modulename env parsetree
+        sourcefile prefixname modulename env parsetree
     in
     (Some (parsetree, typedtree), inputfile)
   with
@@ -284,7 +284,11 @@ let process_file ppf sourcefile =
       Location.input_name := file;
       try
         let mod_name =
-          String.capitalize (Filename.basename (Filename.chop_extension file))
+          let s =
+            try Filename.chop_extension file
+            with _ -> file
+          in
+          String.capitalize (Filename.basename s)
         in
         let txt =
           try Odoc_text.Texter.text_of_string (Odoc_misc.input_file_as_string file)
index c67903e13f1e5cf555d5038643027d7575e8d3f2..2aa7caee93a1e2e017ec700b0edd5f74745f983d 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_ast.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: odoc_ast.ml 12951 2012-09-25 07:14:43Z guesdon $ *)
 
 (** Analysis of implementation files. *)
 open Misc
@@ -188,6 +188,9 @@ module Typedtree_search =
         | { cf_desc = Typedtree.Tcf_val (_, _, _, ident, Tcfk_concrete exp, _) } :: q
           when Name.from_ident ident = name ->
             exp.Typedtree.exp_type
+        | { cf_desc = Typedtree.Tcf_val (_, _, _, ident, Tcfk_virtual typ, _) } :: q
+          when Name.from_ident ident = name ->
+            typ.Typedtree.ctyp_type
         | _ :: q ->
             iter q
       in
@@ -201,12 +204,6 @@ module Typedtree_search =
       in
       fun ct_decl -> iter ct_decl.Types.clty_type
 
-    let search_virtual_attribute_type table ctname name =
-      let ct_decl = search_class_type_declaration table ctname in
-      let cls_sig = class_sig_of_cltype_decl ct_decl.ci_type_decl in
-      let (_,_,texp) = Types.Vars.find name cls_sig.cty_vars in
-      texp
-
    let search_method_expression cls name =
       let rec iter = function
         | [] ->
@@ -452,7 +449,7 @@ module Analyser =
            | l ->
                match l with
                  [] ->
-                   (* cas impossible, on l'a filtré avant *)
+                   (* cas impossible, on l'a filtre avant *)
                    assert false
                | (pattern_param, exp) :: second_ele :: q ->
                    (* implicit pattern matching -> anonymous parameter *)
@@ -564,12 +561,7 @@ module Analyser =
           let complete_name = Name.concat current_class_name label in
           let (info_opt, ele_comments) = get_comments_in_class last_pos loc.Location.loc_start.Lexing.pos_cnum in
           let type_exp =
-            try
-              if virt then
-                Typedtree_search.search_virtual_attribute_type table
-                (Name.simple current_class_name) label
-              else
-                Typedtree_search.search_attribute_type tt_cls label
+            try Typedtree_search.search_attribute_type tt_cls label
             with Not_found ->
                 raise (Failure (Odoc_messages.attribute_not_found_in_typedtree complete_name))
           in
@@ -697,10 +689,10 @@ module Analyser =
               Typedtree.Tcl_ident (p,_,_) -> Name.from_path p
             | _ ->
                 (* we try to get the name from the environment. *)
-                (* A VOIR : dommage qu'on n'ait pas un Tclass_ident :-( même quand on a class tutu = toto *)
+                (* A VOIR : dommage qu'on n'ait pas un Tclass_ident :-( meme quand on a class tutu = toto *)
                 Name.from_longident lid.txt
           in
-          (* On n'a pas ici les paramètres de type sous forme de Types.type_expr,
+          (* On n'a pas ici les parametres de type sous forme de Types.type_expr,
              par contre on peut les trouver dans le class_type *)
           let params =
             match tt_class_exp.Typedtree.cl_type with
@@ -785,7 +777,7 @@ module Analyser =
             match tt_class_expr2.Typedtree.cl_desc with
               Typedtree.Tcl_ident (p,_,_) -> Name.from_path p (* A VOIR : obtenir le nom complet *)
             | _ ->
-                (* A VOIR : dommage qu'on n'ait pas un Tclass_ident :-( même quand on a class tutu = toto *)
+                (* A VOIR : dommage qu'on n'ait pas un Tclass_ident :-( meme quand on a class tutu = toto *)
                 match p_class_expr2.Parsetree.pcl_desc with
                   Parsetree.Pcl_constr (lid, _) ->
                     (* we try to get the name from the environment. *)
@@ -978,7 +970,7 @@ module Analyser =
         | Element_type t ->
              (function
                 Types.Sig_type (ident,_,_) ->
-                  (* A VOIR: il est possible que le détail du type soit caché *)
+                  (* A VOIR: il est possible que le detail du type soit cache *)
                   let n1 = Name.simple t.ty_name
                   and n2 = Ident.name ident in
                   n1 = n2
@@ -1321,7 +1313,7 @@ module Analyser =
              let new_env = Odoc_env.add_module env new_module.m_name in
              let new_env2 =
                match new_module.m_type with
-                 (* A VOIR : cela peut-il Ãªtre Tmty_ident ? dans ce cas, on aurait pas la signature *)
+                 (* A VOIR : cela peut-il etre Tmty_ident ? dans ce cas, on aurait pas la signature *)
                  Types.Mty_signature s ->
                    Odoc_env.add_signature new_env new_module.m_name
                      ~rel: (Name.simple new_module.m_name) s
@@ -1420,7 +1412,7 @@ module Analyser =
           let new_env = Odoc_env.add_module_type env mt.mt_name in
           let new_env2 =
             match tt_module_type.mty_type with
-              (* A VOIR : cela peut-il Ãªtre Tmty_ident ? dans ce cas, on n'aurait pas la signature *)
+              (* A VOIR : cela peut-il etre Tmty_ident ? dans ce cas, on n'aurait pas la signature *)
               Types.Mty_signature s ->
                 Odoc_env.add_signature new_env mt.mt_name ~rel: (Name.simple mt.mt_name) s
             | _ ->
@@ -1549,7 +1541,7 @@ module Analyser =
               im_info = comment_opt ;
             }
           in
-          (0, env, [ Element_included_module im ]) (* A VOIR : Ã©tendre l'environnement ? avec quoi ? *)
+          (0, env, [ Element_included_module im ]) (* A VOIR : etendre l'environnement ? avec quoi ? *)
 
      (** Analysis of a [Parsetree.module_expr] and a name to return a [t_module].*)
      and analyse_module env current_module_name module_name comment_opt p_module_expr tt_module_expr =
index a8457ab883556f2841452d8980f50805a9ae8800..40c62824f543909aec8fcd32b1e5e4a15b330d27 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_class.ml 12341 2012-04-11 16:46:30Z guesdon $ *)
+(* $Id: odoc_class.ml 12796 2012-07-30 11:22:29Z doligez $ *)
 
 (** Representation and manipulation of classes and class types.*)
 
@@ -115,7 +115,7 @@ let rec class_elements ?(trans=true) cl =
     | Class_constraint (c_kind, ct_kind) ->
         iter_kind c_kind
       (* A VOIR : utiliser le c_kind ou le ct_kind ?
-         Pour l'instant, comme le ct_kind n'est pas analysé,
+         Pour l'instant, comme le ct_kind n'est pas analyse,
          on cherche dans le c_kind
          class_type_elements ~trans: trans
          { clt_name = "" ; clt_info = None ;
@@ -250,4 +250,4 @@ let class_type_parameter_text_by_name clt label =
           None
 
 
-(* eof $Id: odoc_class.ml 12341 2012-04-11 16:46:30Z guesdon $ *)
+(* eof $Id: odoc_class.ml 12796 2012-07-30 11:22:29Z doligez $ *)
index bf31217ab4a2dc04d3c61aec5bf83fcdea467a21..b63f9ba00e032a511ec34097c0702305ca811838 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_dot.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: odoc_dot.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Definition of a class which outputs a dot file showing
    top modules dependencies.*)
@@ -143,4 +143,3 @@ class dot =
 end
 
 module type Dot_generator = module type of Generator
-
index 3140be11c87ff36c62d4e0d54bac1bdd6680a57f..ff58d9f00db8a6529e3a7cc968268809784a7d89 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_env.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: odoc_env.ml 12796 2012-07-30 11:22:29Z doligez $ *)
 
 (** Environment for finding complete names from relative names. *)
 
@@ -56,7 +56,7 @@ let rec add_signature env root ?rel signat =
     | Types.Sig_exception (ident, _) -> { env with env_exceptions = (rel_name ident, qualify ident) :: env.env_exceptions }
     | Types.Sig_module (ident, modtype, _) ->
         let env2 =
-          match modtype with (* A VOIR : le cas où c'est un identificateur, dans ce cas on n'a pas de signature *)
+          match modtype with (* A VOIR : le cas ou c'est un identificateur, dans ce cas on n'a pas de signature *)
             Types.Mty_signature s -> add_signature env (qualify ident) ~rel: (rel_name ident) s
           |  _ -> env
         in
@@ -68,7 +68,7 @@ let rec add_signature env root ?rel signat =
               env
           | Types.Modtype_manifest modtype ->
               match modtype with
-                 (* A VOIR : le cas où c'est un identificateur, dans ce cas on n'a pas de signature *)
+                 (* A VOIR : le cas ou c'est un identificateur, dans ce cas on n'a pas de signature *)
                 Types.Mty_signature s -> add_signature env (qualify ident) ~rel: (rel_name ident) s
               |  _ -> env
         in
@@ -246,4 +246,4 @@ let subst_class_type env t =
   in
   iter t
 
-(* eof $Id: odoc_env.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* eof $Id: odoc_env.ml 12796 2012-07-30 11:22:29Z doligez $ *)
index 7a37554ec5ec55ddd4ba229c4074f4384b7b32b7..95c9118a088d1dac8e5ed4f8a62923d64853ffc4 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_global.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: odoc_global.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Global variables. *)
 
@@ -84,6 +84,3 @@ let with_trailer = ref true
 let with_toc = ref true
 
 let with_index = ref true
-
-
-
index efe12d1622dfe2625b686e24c396e114d42ee970..a4a5cfdb619fe4a8e3332f86577f7075ee8c8cdb 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_html.ml 12434 2012-05-07 09:41:28Z guesdon $ *)
+(* $Id: odoc_html.ml 12953 2012-09-25 07:50:40Z guesdon $ *)
 
 (** Generation of html documentation.*)
 
@@ -335,7 +335,11 @@ class virtual text =
         in
         fun b s ->
       if !colorize_code then
-         self#html_of_code b (remove_useless_newlines s)
+          (
+           bs b "<pre class=\"codepre\">";
+           self#html_of_code b (remove_useless_newlines s);
+           bs b "</pre>"
+          )
       else
         (
          bs b "<pre class=\"codepre\"><code class=\"";
@@ -403,7 +407,6 @@ class virtual text =
 
     method html_of_Title b n label_opt t =
       let label1 = self#create_title_label (n, label_opt, t) in
-      bp b "<span id=\"%s\">" (Naming.label_target label1);
       let (tag_o, tag_c) =
         if n > 6 then
           (Printf.sprintf "div class=\"h%d\"" n, "div")
@@ -411,13 +414,12 @@ class virtual text =
           let t = Printf.sprintf "h%d" n in (t, t)
       in
       bs b "<";
-      bs b tag_o;
+      bp b "%s id=\"%s\"" tag_o (Naming.label_target label1);
       bs b ">";
       self#html_of_text b t;
       bs b "</";
       bs b tag_c;
-      bs b ">";
-      bs b "</span>"
+      bs b ">"
 
     method html_of_Latex b _ = ()
       (* don't care about LaTeX stuff in HTML. *)
@@ -836,9 +838,9 @@ class html =
         "pre.verbatim, pre.codepre { }";
 
         ".indextable {border: 1px #ddd solid; border-collapse: collapse}";
-        ".indextable td, .indextable th {border: 1px #ddd solid;       min-width: 80px}";
+        ".indextable td, .indextable th {border: 1px #ddd solid; min-width: 80px}";
         ".indextable td.module {background-color: #eee ;  padding-left: 2px; padding-right: 2px}";
-        ".indextable td.module a {color: 4E6272;       text-decoration: none; display: block; width: 100%}";
+        ".indextable td.module a {color: 4E6272; text-decoration: none; display: block; width: 100%}";
         ".indextable td.module a:hover {text-decoration: underline; background-color: transparent}";
         ".deprecated {color: #888; font-style: italic}" ;
 
@@ -1513,7 +1515,7 @@ class html =
              | l,Some r ->
                  bs b (" " ^ (self#keyword ":") ^ " ");
                  self#html_of_type_expr_list ~par: false b father " * " l;
-                bs b (" " ^ (self#keyword "->") ^ " ");
+                 bs b (" " ^ (self#keyword "->") ^ " ");
                  self#html_of_type_expr b father r;
             );
             bs b "</code></td>\n";
@@ -1780,7 +1782,7 @@ class html =
       if info then
         (
          if complete then
-           self#html_of_info ~indent: false
+           self#html_of_info ~indent: true
          else
            self#html_of_info_first_sentence
         ) b m.m_info
@@ -1809,7 +1811,7 @@ class html =
       if info then
         (
          if complete then
-           self#html_of_info ~indent: false
+           self#html_of_info ~indent: true
          else
            self#html_of_info_first_sentence
         ) b mt.mt_info
@@ -1966,7 +1968,7 @@ class html =
       print_DEBUG "html#html_of_class : info" ;
       (
        if complete then
-         self#html_of_info ~indent: false
+         self#html_of_info ~indent: true
        else
          self#html_of_info_first_sentence
       ) b c.cl_info
@@ -2009,7 +2011,7 @@ class html =
       bs b "</pre>";
       (
        if complete then
-         self#html_of_info ~indent: false
+         self#html_of_info ~indent: true
        else
          self#html_of_info_first_sentence
       ) b ct.clt_info
index 00d626af47a4c5695d2880bcc2e4dc00faaa8959..4f42986e496335ce3e5cd711d2b65b520fa36f6c 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_info.mli 12435 2012-05-07 10:31:18Z guesdon $ *)
+(* $Id: odoc_info.mli 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Interface to the information collected in source files. *)
 
@@ -203,7 +203,7 @@ module Type :
         {
           vc_name : string ; (** Name of the constructor. *)
           vc_args : Types.type_expr list ; (** Arguments of the constructor. *)
-         vc_ret : Types.type_expr option ;
+          vc_ret : Types.type_expr option ;
           mutable vc_text : text option ; (** Optional description in the associated comment. *)
         }
 
index 0c6b75e429ccbb3093901b772b63cc0f91477fd2..bec8b91cb678ff08e27d91611b397071ea7b9b08 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_latex.ml 12249 2012-03-20 12:00:11Z guesdon $ *)
+(* $Id: odoc_latex.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Generation of LaTeX documentation. *)
 
@@ -97,19 +97,19 @@ class text =
         "}", "\\\\}";
         "\\$", "\\\\$";
         "\\^", "{\\\\textasciicircum}";
-        "à", "\\\\`a";
-        "â", "\\\\^a";
-        "é", "\\\\'e";
-        "è", "\\\\`e";
-        "ê", "\\\\^e";
-        "ë", "\\\\\"e";
-        "ç", "\\\\c{c}";
-        "ô", "\\\\^o";
-        "ö", "\\\\\"o";
-        "î", "\\\\^i";
-        "ï", "\\\\\"i";
-        "ù", "\\\\`u";
-        "û", "\\\\^u";
+        "\xE0", "\\\\`a";
+        "\xE2", "\\\\^a";
+        "\xE9", "\\\\'e";
+        "\xE8", "\\\\`e";
+        "\xEA", "\\\\^e";
+        "\xEB", "\\\\\"e";
+        "\xE7", "\\\\c{c}";
+        "\xF4", "\\\\^o";
+        "\xF6", "\\\\\"o";
+        "\xEE", "\\\\^i";
+        "\xEF", "\\\\\"i";
+        "\xF9", "\\\\`u";
+        "\xFB", "\\\\^u";
         "%", "\\\\%";
         "_", "\\\\_";
         "~", "\\\\~{}";
@@ -574,7 +574,7 @@ class latex =
                            p fmt2 " %s@ %s@ %s@ %s"
                              ":"
                              (self#normal_type_list ~par: false mod_name " * " l)
-                            "->"
+                             "->"
                              (self#normal_type mod_name r)
                       );
                       flush2 ()
@@ -703,7 +703,7 @@ class latex =
           self#latex_of_module_kind fmt father k2;
           self#latex_of_text fmt [Code ")"]
       | Module_with (k, s) ->
-          (* TODO: Ã  modifier quand Module_with sera plus détaillé *)
+          (* TODO: a modifier quand Module_with sera plus detaille *)
           self#latex_of_module_type_kind fmt father k;
           self#latex_of_text fmt
             [ Code " ";
@@ -732,7 +732,7 @@ class latex =
           self#latex_of_text fmt [Latex "\\end{ocamldocobjectend}\n"]
 
       | Class_apply capp ->
-          (* TODO: afficher le type final Ã  partir du typedtree *)
+          (* TODO: afficher le type final a partir du typedtree *)
           self#latex_of_text fmt [Raw "class application not handled yet"]
 
       | Class_constr cco ->
index ac2d00e06bf15c2fbe3a6fce9ae1b4ac4ae7574f..4b8dcb9f23d3b9a7ca7eac83361b13bdf40c02ef 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_lexer.mll 10652 2010-08-24 09:45:45Z guesdon $ *)
+(* $Id: odoc_lexer.mll 12796 2012-07-30 11:22:29Z doligez $ *)
 
 (** The lexer for special comments. *)
 
@@ -22,10 +22,10 @@ let line_number = ref 0
 
 let string_buffer = Buffer.create 32
 
-(** Fonction de remise Ã  zéro de la chaine de caractères tampon *)
+(** Fonction de remise a zero de la chaine de caracteres tampon *)
 let reset_string_buffer () = Buffer.reset string_buffer
 
-(** Fonction d'ajout d'un caractère dans la chaine de caractères tampon *)
+(** Fonction d'ajout d'un caractere dans la chaine de caracteres tampon *)
 let ajout_char_string = Buffer.add_char string_buffer
 
 (** Add a string to the buffer. *)
index fe855ea430e3b7fd52ae8cbefbc23f40349030e2..4a813da49430151af87f21d24e7c7bca729723ac 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_man.ml 12249 2012-03-20 12:00:11Z guesdon $ *)
+(* $Id: odoc_man.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** The man pages generator. *)
 open Odoc_info
@@ -492,13 +492,13 @@ class man =
                | l, None, Some r ->
                    bs b "\n.B : ";
                    self#man_of_type_expr_list ~par: false b father " * " l;
-                  bs b ".B -> ";
+                   bs b ".B -> ";
                    self#man_of_type_expr b father r;
                    bs b " "
                | l, (Some t), Some r ->
                    bs b "\n.B of ";
                    self#man_of_type_expr_list ~par: false b father " * " l;
-                  bs b ".B -> ";
+                   bs b ".B -> ";
                    self#man_of_type_expr b father r;
                    bs b ".I \"  \"\n";
                    bs b "(* ";
index 0c2701913513647f9e6f022ad351eee99beab674..a28e8fb56e6ff6eb767cfe8908b51705d17c8dc7 100644 (file)
@@ -9,11 +9,11 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_merge.mli 12341 2012-04-11 16:46:30Z guesdon $ *)
+(* $Id: odoc_merge.mli 12796 2012-07-30 11:22:29Z doligez $ *)
 
 (** Merge of information from [.ml] and [.mli] for a module.*)
 
-(** Merging \@before tags. *)
+(** Merging \@before tags. *)
 val merge_before_tags :
     (string * Odoc_types.text) list -> (string * Odoc_types.text) list
 
index 46189745107949d46022b6080bc67314e8a8431a..29a466550c803630bd31a76f206634756b51830b 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_misc.ml 12341 2012-04-11 16:46:30Z guesdon $ *)
+(* $Id: odoc_misc.ml 12796 2012-07-30 11:22:29Z doligez $ *)
 
 let no_blanks s =
   let len = String.length s in
@@ -334,7 +334,7 @@ let rec get_before_dot s =
     let len = String.length s in
     let n = String.index s '.' in
     if n + 1 >= len then
-      (* le point est le dernier caractère *)
+      (* le point est le dernier caractere *)
       (true, s, "")
     else
       match s.[n+1] with
index e937a00bbd7c82492c8f04055408727f532232eb..f9b9b1cabc10d502a73861fa7c84c603ef8c2c07 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_name.ml 12622 2012-06-21 05:46:28Z guesdon $ *)
+(* $Id: odoc_name.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Representation of element names. *)
 
@@ -52,11 +52,11 @@ let strip_string s =
         else
           match s.[n] with
             ' ' | '\t' | '\n' | '\r' -> iter_last (n-1)
-          |    _ -> Some n
+          | _ -> Some n
       in
       match iter_last (len-1) with
         None -> String.sub s first 1
-      |        Some last -> String.sub s first ((last-first)+1)
+      | Some last -> String.sub s first ((last-first)+1)
 
 let parens_if_infix name =
   match strip_string name with
index 6e75ce1d71b330804c3a5da51977d4bd51dd6ea5..3c3c22b5c141b815a9b4be0452811170b248f731 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_print.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: odoc_print.ml 12796 2012-07-30 11:22:29Z doligez $ *)
 
 open Format
 
@@ -82,7 +82,7 @@ let simpl_class_type t =
     match t with
       Types.Cty_constr (p,texp_list,ct) -> t
     | Types.Cty_signature cs ->
-        (* on vire les vals et methods pour ne pas qu'elles soient imprimées
+        (* on vire les vals et methods pour ne pas qu'elles soient imprimees
            quand on affichera le type *)
         let tnil = { Types.desc = Types.Tnil ; Types.level = 0; Types.id = 0 } in
         Types.Cty_signature { Types.cty_self = { cs.Types.cty_self with
index 32554f919831631f5c913f0aa9905d418d42b1b1..6b1b392f2808a26fbaf4fb913c40d38844cd7232 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_scan.ml 12341 2012-04-11 16:46:30Z guesdon $ *)
+(* $Id: odoc_scan.ml 12796 2012-07-30 11:22:29Z doligez $ *)
 
 (** Scanning of modules and elements.
 
@@ -56,7 +56,7 @@ class scanner =
     method scan_class_pre (c : Odoc_class.t_class) = true
 
     (** This method scan the elements of the given class.
-       A VOIR : scan des classes héritées.*)
+       A VOIR : scan des classes heritees.*)
     method scan_class_elements c =
       List.iter
         (fun ele ->
@@ -82,7 +82,7 @@ class scanner =
     method scan_class_type_pre (ct : Odoc_class.t_class_type) = true
 
     (** This method scan the elements of the given class type.
-       A VOIR : scan des classes héritées.*)
+       A VOIR : scan des classes heritees.*)
     method scan_class_type_elements ct =
       List.iter
         (fun ele ->
index 28772530e8a6665d393d7511266f160a65f3f9db..f5d566819f7ce7f5ef81b8f2023ed01218c9d1b7 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_sig.ml 12622 2012-06-21 05:46:28Z guesdon $ *)
+(* $Id: odoc_sig.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Analysis of interface files. *)
 
@@ -232,7 +232,7 @@ module Analyser =
             {
               vc_name = constructor_name ;
               vc_args = List.map (Odoc_env.subst_type env) type_expr_list ;
-             vc_ret =  may_map (Odoc_env.subst_type env) ret_type;
+              vc_ret =  may_map (Odoc_env.subst_type env) ret_type;
               vc_text = comment_opt
             }
           in
@@ -728,7 +728,7 @@ module Analyser =
             new_module.m_info <- merge_infos new_module.m_info info_after_opt ;
             let new_env = Odoc_env.add_module env new_module.m_name in
             let new_env2 =
-              match new_module.m_type with (* A VOIR : cela peut-il Ãªtre Tmty_ident ? dans ce cas, on aurait pas la signature *)
+              match new_module.m_type with (* A VOIR : cela peut-il etre Tmty_ident ? dans ce cas, on aurait pas la signature *)
                 Types.Mty_signature s -> Odoc_env.add_signature new_env new_module.m_name ~rel: (Name.simple new_module.m_name) s
               | _ -> new_env
             in
@@ -748,7 +748,7 @@ module Analyser =
                       raise (Failure (Odoc_messages.module_not_found current_module_name name))
                   in
                   match sig_module_type with
-                    (* A VOIR : cela peut-il Ãªtre Tmty_ident ? dans ce cas, on aurait pas la signature *)
+                    (* A VOIR : cela peut-il etre Tmty_ident ? dans ce cas, on aurait pas la signature *)
                     Types.Mty_signature s ->
                       Odoc_env.add_signature e complete_name ~rel: name s
                   | _ ->
@@ -863,7 +863,7 @@ module Analyser =
             mt.mt_info <- merge_infos mt.mt_info info_after_opt ;
             let new_env = Odoc_env.add_module_type env mt.mt_name in
             let new_env2 =
-              match sig_mtype with (* A VOIR : cela peut-il Ãªtre Tmty_ident ? dans ce cas, on aurait pas la signature *)
+              match sig_mtype with (* A VOIR : cela peut-il etre Tmty_ident ? dans ce cas, on aurait pas la signature *)
                 Some (Types.Mty_signature s) -> Odoc_env.add_signature new_env mt.mt_name ~rel: (Name.simple mt.mt_name) s
               | _ -> new_env
             in
@@ -1223,7 +1223,7 @@ module Analyser =
           ([], Class_structure (inher_l, ele))
 
       | (Parsetree.Pcty_fun (parse_label, _, pclass_type), Types.Cty_fun (label, type_expr, class_type)) ->
-          (* label = string. Dans les signatures, pas de nom de paramètres Ã  l'intérieur des tuples *)
+          (* label = string. Dans les signatures, pas de nom de parametres a l'interieur des tuples *)
           (* si label = "", pas de label. ici on a l'information pour savoir si on a un label explicite. *)
           if parse_label = label then
             (
index e8f80962638aef540b11a243278d02f088afe986..48fb55b5a0d284b181687c6f7124968f8dee41c1 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_texi.ml 11160 2011-07-29 10:32:43Z garrigue $ *)
+(* $Id: odoc_texi.ml 12798 2012-07-30 11:53:27Z doligez $ *)
 
 (** Generation of Texinfo documentation. *)
 
@@ -149,23 +149,23 @@ struct
   ] @
     (if !esc_8bits
     then [
-    (Str.regexp "à", "@`a") ;
-    (Str.regexp "â", "@^a") ;
-    (Str.regexp "é", "@'e") ;
-    (Str.regexp "è", "@`e") ;
-    (Str.regexp "ê", "@^e") ;
-    (Str.regexp "ë", "@\"e") ;
-    (Str.regexp "ç", "@,{c}") ;
-    (Str.regexp "ô", "@^o") ;
-    (Str.regexp "ö", "@\"o") ;
-    (Str.regexp "î", "@^i") ;
-    (Str.regexp "ï", "@\"i") ;
-    (Str.regexp "ù", "@`u") ;
-    (Str.regexp "û", "@^u") ;
-    (Str.regexp "æ", "@ae{}" ) ;
-    (Str.regexp "Æ", "@AE{}" ) ;
-    (Str.regexp "ß", "@ss{}" ) ;
-    (Str.regexp "©", "@copyright{}" ) ;
+    (Str.regexp "\xE0", "@`a") ;
+    (Str.regexp "\xE2", "@^a") ;
+    (Str.regexp "\xE9", "@'e") ;
+    (Str.regexp "\xE8", "@`e") ;
+    (Str.regexp "\xEA", "@^e") ;
+    (Str.regexp "\xEB", "@\"e") ;
+    (Str.regexp "\xF7", "@,{c}") ;
+    (Str.regexp "\xF4", "@^o") ;
+    (Str.regexp "\xF6", "@\"o") ;
+    (Str.regexp "\xEE", "@^i") ;
+    (Str.regexp "\xEF", "@\"i") ;
+    (Str.regexp "\xF9", "@`u") ;
+    (Str.regexp "\xFB", "@^u") ;
+    (Str.regexp "\xE6", "@ae{}" ) ;
+    (Str.regexp "\xC6", "@AE{}" ) ;
+    (Str.regexp "\xDF", "@ss{}" ) ;
+    (Str.regexp "\xA9", "@copyright{}" ) ;
     ]
     else [])
 
@@ -640,13 +640,13 @@ class texi =
           Printf.sprintf "(%s) "
             (String.concat ", " (List.map f l))
 
-    method string_of_type_args (args:Types.type_expr list) (ret:Types.type_expr option) = 
+    method string_of_type_args (args:Types.type_expr list) (ret:Types.type_expr option) =
       match args, ret with
       | [], None -> ""
       | args, None -> " of " ^ (Odoc_info.string_of_type_list " * " args)
       | [], Some r -> " : " ^ (Odoc_info.string_of_type_expr r)
-      | args, Some r -> " : " ^ (Odoc_info.string_of_type_list " * " args) ^ 
-                               " -> " ^ (Odoc_info.string_of_type_expr r)
+      | args, Some r -> " : " ^ (Odoc_info.string_of_type_list " * " args) ^
+                                " -> " ^ (Odoc_info.string_of_type_expr r)
 
     (** Return Texinfo code for a type. *)
     method texi_of_type ty =
index fb45d1e2a9929d41307e9351e22a06ee65cc4fb0..b2b8ecc53d13a45c4250aa5563db7732e9a063ab 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_text_lexer.mll 12249 2012-03-20 12:00:11Z guesdon $ *)
+(* $Id: odoc_text_lexer.mll 12796 2012-07-30 11:22:29Z doligez $ *)
 
 (** The lexer for string to build text structures. *)
 
@@ -22,10 +22,10 @@ let char_number = ref 0
 
 let string_buffer = Buffer.create 32
 
-(** Fonction de remise Ã  zéro de la chaine de caractères tampon *)
+(** Fonction de remise a zero de la chaine de caracteres tampon *)
 let reset_string_buffer () = Buffer.reset string_buffer
 
-(** Fonction d'ajout d'un caractère dans la chaine de caractères tampon *)
+(** Fonction d'ajout d'un caractere dans la chaine de caracteres tampon *)
 let ajout_char_string = Buffer.add_char string_buffer
 
 (** Add a string to the buffer. *)
index 7d63a97fb602c58b31aa91b118a192231c7f117d..15f5fb2bf3b689bcbe30424a7b29b5c99e1979d3 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: bigarray_stubs.c 12433 2012-05-06 08:23:37Z xleroy $ */
+/* $Id: bigarray_stubs.c 12963 2012-09-27 15:48:40Z doligez $ */
 
 #include <stddef.h>
 #include <stdarg.h>
@@ -779,7 +779,12 @@ static void caml_ba_serialize(value v,
   }
   /* Compute required size in OCaml heap.  Assumes struct caml_ba_array
      is exactly 4 + num_dims words */
+  /* PR#5516: use C99's flexible array types if possible */
+#if (__STDC_VERSION__ >= 199901L)
+  Assert(sizeof(struct caml_ba_array) == 4 * sizeof(value));
+#else
   Assert(sizeof(struct caml_ba_array) == 5 * sizeof(value));
+#endif
   *wsize_32 = (4 + b->num_dims) * 4;
   *wsize_64 = (4 + b->num_dims) * 8;
 }
@@ -846,7 +851,12 @@ uintnat caml_ba_deserialize(void * dst)
   case CAML_BA_NATIVE_INT:
     caml_ba_deserialize_longarray(b->data, num_elts); break;
   }
+  /* PR#5516: use C99's flexible array types if possible */
+#if (__STDC_VERSION__ >= 199901L)
+  return sizeof(struct caml_ba_array) + b->num_dims * sizeof(intnat);
+#else
   return sizeof(struct caml_ba_array) + (b->num_dims - 1) * sizeof(intnat);
+#endif
 }
 
 /* Create / update proxy to indicate that b2 is a sub-array of b1 */
index 971c74957cf25ce875e4c7b6ac87c52ca1a732ef..e208f21f9eb7631f6b4935e547ef052d1e76e7d9 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: mmap_unix.c 12582 2012-06-07 12:17:44Z xleroy $ */
+/* $Id: mmap_unix.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* Needed (under Linux at least) to get pwrite's prototype in unistd.h.
    Must be defined before the first system .h is included. */
@@ -70,7 +70,7 @@ static int caml_grow_file(int fd, file_offset size)
     if (p != -1) {
       c = 0;
       p = write(fd, &c, 1);
-      if (p != -1) 
+      if (p != -1)
         p = lseek(fd, currpos, SEEK_SET);
     }
   }
index ab9faa619a695df2cb4d70e17ba7275ee3fc3e72..84c8960d895a938d9a968aad170f12578d83b9de 100644 (file)
@@ -5,7 +5,7 @@ color.o: color.c libgraph.h \
   ../../byterun/mlvalues.h ../../byterun/compatibility.h \
   ../../byterun/config.h ../../byterun/../config/m.h \
   ../../byterun/../config/s.h ../../byterun/misc.h \
+
 draw.o: draw.c libgraph.h \
   \
   \
index b86f8dcd856744e990192ce1008e0238446d127a..65e5dc4c2d3627c90e6c52cfc499236b21e69855 100644 (file)
@@ -1,2 +1,2 @@
 This is Francois Rouaix's widget set library, Frx.
-It uses CamlTk API.
\ No newline at end of file
+It uses CamlTk API.
index cae3f225c8fa41ca743ae153e8ebe7dbacc4674e..cc3e4145d3607aa3dbba091341a3985d9241cc65 100644 (file)
@@ -21,7 +21,7 @@ all: $(LIBNAME).cma $(LIBNAME)top$(EXE) $(LIBNAME)
 opt: $(LIBNAME).cmxa
 
 clean:
-       rm -f $(LIBNAME)top$(EXE) $(LIBNAME) *.cm* *.$(A)
+       rm -f $(LIBNAME)top$(EXE) $(LIBNAME) *.cm* *.$(A) *$(EXT_DLL)
 
 superclean:
        - if test -f tk.cmo; then \
@@ -56,7 +56,7 @@ $(LIBNAME).cma: $(SUPPORT) ../Widgets.src
        cd ../camltk; $(MAKE)
        $(MKLIB) -ocamlc '$(CAMLCB)' -o $(LIBNAME) \
          -I ../labltk -I ../camltk $(TKOBJS) \
-         -ccopt "\"$(TK_LINK)\""
+         -cclib "\"$(TK_LINK)\""
 
 $(LIBNAME).cmxa: $(SUPPORT:.cmo=.cmx) ../Widgets.src
        $(MAKE) superclean
@@ -64,7 +64,7 @@ $(LIBNAME).cmxa: $(SUPPORT:.cmo=.cmx) ../Widgets.src
        cd ../camltk; $(MAKE) opt
        $(MKLIB) -ocamlopt '$(CAMLOPTB)' -o $(LIBNAME) -oc $(LIBNAME) \
          -I ../labltk -I ../camltk $(TKOBJS:.cmo=.cmx) \
-         -ccopt "\"$(TK_LINK)\""
+         -cclib "\"$(TK_LINK)\""
 
 $(LIBNAME)top$(EXE) : $(TOPDEPS) $(LIBNAME).cma ../support/lib$(LIBNAME).$(A)
        $(CAMLC) -verbose -linkall -o $(LIBNAME)top$(EXE) -I ../support \
index 67bf904edf232254200d2c55eb28f1b74a75e838..2b0b5ab535168c5430ad644c397ba2de334ed738 100644 (file)
@@ -1 +1 @@
-include Makefile
\ No newline at end of file
+include Makefile
index f760e80006eb3ff20060430afa6c4ff86f320327..8020fafdde978e3faf197a78d3899346d7b0eaa0 100755 (executable)
@@ -1 +1 @@
-@ocaml -I +labltk labltk.cma %1 %2 %3 %4 %5 %6 %7 %8 %9
\ No newline at end of file
+@ocaml -I +labltk labltk.cma %1 %2 %3 %4 %5 %6 %7 %8 %9
index 9e35921f09b33d5030751a00ca64e9f4076cfde2..5196edb7a4c05dcd6d273aa4053d758ef943bb17 100644 (file)
@@ -14,7 +14,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: cltkVar.c 12149 2012-02-10 16:15:24Z doligez $ */
+/* $Id: cltkVar.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* Alternative to tkwait variable */
 #include <string.h>
@@ -65,7 +65,7 @@ CAMLprim value camltk_setvar(value var, value contents)
 
   if (s == NULL)
     tk_error(Tcl_GetStringResult(cltclinterp));
-  else 
+  else
     return(Val_unit);
 }
 
index 703939670e674092835d9cc8514e6a4abd255332..fa0cce027b72eed2d183e1e71178a53e32e4a58e 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: nat_stubs.c 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: nat_stubs.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include "alloc.h"
 #include "config.h"
@@ -416,4 +416,3 @@ static intnat hash_nat(value v)
   }
   return h;
 }
-
index f5c992ae3a9c20fdd6fdacf7a498c0ea97a39e3d..46c86135412b7280d67fd2c09cde76906c88756a 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: str.mli 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: str.mli 12922 2012-09-11 14:40:43Z doligez $ *)
 
 (** Regular expressions and high-level string processing *)
 
@@ -48,7 +48,7 @@ val regexp : string -> regexp
      ([\2] for the second expression, and so on up to [\9]).
    - [\b    ] Matches word boundaries.
    - [\     ] Quotes special characters.  The special characters
-              are [$^.*+?[]].
+              are [$^\.*+?[]].
 *)
 
 val regexp_case_fold : string -> regexp
@@ -82,15 +82,16 @@ val search_forward : regexp -> string -> int -> int
    matching the regular expression [r]. The search starts at position
    [start] and proceeds towards the end of the string.
    Return the position of the first character of the matched
-   substring, or raise [Not_found] if no substring matches. *)
+   substring.
+   @raise Not_found if no substring matches. *)
 
 val search_backward : regexp -> string -> int -> int
 (** [search_backward r s last] searches the string [s] for a
   substring matching the regular expression [r]. The search first
   considers substrings that start at position [last] and proceeds
   towards the beginning of string. Return the position of the first
-  character of the matched substring; raise [Not_found] if no
-  substring matches. *)
+  character of the matched substring.
+  @raise Not_found if no substring matches. *)
 
 val string_partial_match : regexp -> string -> int -> bool
 (** Similar to {!Str.string_match}, but also returns true if
@@ -99,29 +100,50 @@ val string_partial_match : regexp -> string -> int -> bool
 
 val matched_string : string -> string
 (** [matched_string s] returns the substring of [s] that was matched
-   by the latest {!Str.string_match}, {!Str.search_forward} or
-   {!Str.search_backward}.
+   by the last call to one of the following matching or searching
+   functions:
+   - {!Str.string_match}
+   - {!Str.search_forward}
+   - {!Str.search_backward}
+   - {!Str.string_partial_match}
+   - {!Str.global_substitute}
+   - {!Str.substitute_first}
+   provided that none of the following functions was called inbetween:
+   - {!Str.global_replace}
+   - {!Str.replace_first}
+   - {!Str.split}
+   - {!Str.bounded_split}
+   - {!Str.split_delim}
+   - {!Str.bounded_split_delim}
+   - {!Str.full_split}
+   - {!Str.bounded_full_split}
+
+   Note: in the case of [global_substitute] and [substitute_first],
+   a call to [matched_string] is only valid within the [subst] argument,
+   not after [global_substitute] or [substitute_first] returns.
+
    The user must make sure that the parameter [s] is the same string
    that was passed to the matching or searching function. *)
 
 val match_beginning : unit -> int
 (** [match_beginning()] returns the position of the first character
-   of the substring that was matched by {!Str.string_match},
-   {!Str.search_forward} or {!Str.search_backward}. *)
+   of the substring that was matched by the last call to a matching
+   or searching function (see {!Str.matched_string} for details). *)
 
 val match_end : unit -> int
 (** [match_end()] returns the position of the character following the
-   last character of the substring that was matched by [string_match],
-   [search_forward] or [search_backward]. *)
+   last character of the substring that was matched by the last call
+   to a matching or searching function (see {!Str.matched_string} for
+   details). *)
 
 val matched_group : int -> string -> string
 (** [matched_group n s] returns the substring of [s] that was matched
-   by the [n]th group [\(...\)] of the regular expression during
-   the latest {!Str.string_match}, {!Str.search_forward} or
-   {!Str.search_backward}.
+   by the [n]th group [\(...\)] of the regular expression that was
+   matched by the last call to a matching or searching function (see
+   {!Str.matched_string} for details).
    The user must make sure that the parameter [s] is the same string
    that was passed to the matching or searching function.
-   [matched_group n s] raises [Not_found] if the [n]th group
+   @raise Not_found if the [n]th group
    of the regular expression was not matched.  This can happen
    with groups inside alternatives [\|], options [?]
    or repetitions [*].  For instance, the empty string will match
@@ -131,7 +153,8 @@ val matched_group : int -> string -> string
 val group_beginning : int -> int
 (** [group_beginning n] returns the position of the first character
    of the substring that was matched by the [n]th group of
-   the regular expression.
+   the regular expression that was matched by the last call to a
+   matching or searching function (see {!Str.matched_string} for details).
    @raise Not_found if the [n]th group of the regular expression
    was not matched.
    @raise Invalid_argument if there are fewer than [n] groups in
@@ -140,7 +163,9 @@ val group_beginning : int -> int
 val group_end : int -> int
 (** [group_end n] returns
    the position of the character following the last character of
-   substring that was matched by the [n]th group of the regular expression.
+   substring that was matched by the [n]th group of the regular
+   expression that was matched by the last call to a matching or
+   searching function (see {!Str.matched_string} for details).
    @raise Not_found if the [n]th group of the regular expression
    was not matched.
    @raise Invalid_argument if there are fewer than [n] groups in
@@ -176,9 +201,11 @@ val substitute_first : regexp -> (string -> string) -> string -> string
 val replace_matched : string -> string -> string
 (** [replace_matched repl s] returns the replacement text [repl]
    in which [\1], [\2], etc. have been replaced by the text
-   matched by the corresponding groups in the most recent matching
-   operation.  [s] must be the same string that was matched during
-   this matching operation. *)
+   matched by the corresponding groups in the regular expression
+   that was matched by the last call to a matching or searching
+   function (see {!Str.matched_string} for details).
+   [s] must be the same string that was passed to the matching or
+   searching function. *)
 
 
 (** {6 Splitting} *)
@@ -189,7 +216,7 @@ val split : regexp -> string -> string list
    the substrings that match [r], and returns the list of substrings.
    For instance, [split (regexp "[ \t]+") s] splits [s] into
    blank-separated words.  An occurrence of the delimiter at the
-   beginning and at the end of the string is ignored. *)
+   beginning or at the end of the string is ignored. *)
 
 val bounded_split : regexp -> string -> int -> string list
 (** Same as {!Str.split}, but splits into at most [n] substrings,
index 070a4496fea887411fc26498a9acc77859d85a9e..44b475110e34069117fd0ea825b712b7463440ef 100644 (file)
@@ -158,7 +158,7 @@ static INLINE int st_masterlock_waiters(st_masterlock * m)
 {
   return m->waiters;
 }
+
 /* Mutexes */
 
 typedef pthread_mutex_t * st_mutex;
@@ -411,6 +411,6 @@ value caml_wait_signal(value sigs) /* ML */
   return Val_int(signo);
 #else
   invalid_argument("Thread.wait_signal not implemented");
-  return Val_int(0);           /* not reached */
+  return Val_int(0);            /* not reached */
 #endif
 }
index 550a1762843ec1e1dd5f4f5cbc383e331cd51279..78d6d925a75daa0028ea41c975de32a2b917306d 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: st_stubs.c 12324 2012-04-08 17:11:47Z xleroy $ */
+/* $Id: st_stubs.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include "alloc.h"
 #include "backtrace.h"
@@ -279,7 +279,7 @@ static uintnat caml_thread_stack_usage(void)
     sz += (value *) th->top_of_stack - (value *) th->bottom_of_stack;
 #else
     sz += th->stack_high - th->sp;
-#endif    
+#endif
   }
   if (prev_stack_usage_hook != NULL)
     sz += prev_stack_usage_hook();
@@ -501,7 +501,7 @@ static ST_THREAD_FUNCTION caml_thread_start(void * arg)
 #endif
   /* The thread now stops running */
   return 0;
-}  
+}
 
 CAMLprim value caml_thread_new(value clos)          /* ML */
 {
@@ -525,7 +525,7 @@ CAMLprim value caml_thread_new(value clos)          /* ML */
     caml_thread_remove_info(th);
     st_check_error(err, "Thread.create");
   }
-  /* Create the tick thread if not already done.  
+  /* Create the tick thread if not already done.
      Because of PR#4666, we start the tick thread late, only when we create
      the first additional thread in the current process*/
   if (! caml_tick_thread_running) {
@@ -581,7 +581,7 @@ CAMLexport int caml_c_thread_register(void)
   return 1;
 }
 
-/* Unregister a thread that was created from C and registered with 
+/* Unregister a thread that was created from C and registered with
    the function above */
 
 CAMLexport int caml_c_thread_unregister(void)
index da602b7f8b74cff22a8e54bfc792e86e96753e4d..206646dfc4bb3bc8b0aeaced446db8ae69b6dfa7 100644 (file)
@@ -54,7 +54,7 @@ static DWORD st_initialize(void)
 
 typedef HANDLE st_thread_id;
 
-static DWORD st_thread_create(st_thread_id * res, 
+static DWORD st_thread_create(st_thread_id * res,
                               LPTHREAD_START_ROUTINE fn, void * arg)
 {
   HANDLE h = CreateThread(NULL, 0, fn, arg, 0, NULL);
@@ -150,7 +150,7 @@ static INLINE int st_masterlock_waiters(st_masterlock * m)
 {
   return 1;                     /* info not maintained */
 }
+
 /* Mutexes */
 
 typedef CRITICAL_SECTION * st_mutex;
@@ -367,12 +367,12 @@ static void st_check_error(DWORD retcode, char * msg)
   if (retcode == 0) return;
   if (retcode == ERROR_NOT_ENOUGH_MEMORY) raise_out_of_memory();
   if (! FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
-                     NULL,
-                     retcode,
-                     0,
-                     err,
-                     sizeof(err),
-                     NULL)) {
+                      NULL,
+                      retcode,
+                      0,
+                      err,
+                      sizeof(err),
+                      NULL)) {
     sprintf(err, "error code %lx", retcode);
   }
   msglen = strlen(msg);
@@ -410,11 +410,11 @@ static DWORD st_atfork(void (*fn)(void))
 value caml_thread_sigmask(value cmd, value sigs) /* ML */
 {
   invalid_argument("Thread.sigmask not implemented");
-  return Val_int(0);           /* not reached */
+  return Val_int(0);            /* not reached */
 }
 
 value caml_wait_signal(value sigs) /* ML */
 {
   invalid_argument("Thread.wait_signal not implemented");
-  return Val_int(0);           /* not reached */
+  return Val_int(0);            /* not reached */
 }
index 971c38767820b0ce995e36ce1dc6b398f80cd23c..07d3863120e071082dd03682b82d6dda884a2ca7 100644 (file)
@@ -11,7 +11,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile 12383 2012-04-19 13:12:23Z xleroy $
+# $Id: Makefile 12867 2012-08-21 04:39:34Z garrigue $
 
 include ../../config/Makefile
 
@@ -36,9 +36,10 @@ LIB_OBJS=pervasives.cmo \
   $(LIB)/lazy.cmo $(LIB)/stream.cmo $(LIB)/buffer.cmo                       \
   $(LIB)/printf.cmo $(LIB)/arg.cmo $(LIB)/printexc.cmo $(LIB)/gc.cmo        \
   $(LIB)/digest.cmo $(LIB)/random.cmo $(LIB)/hashtbl.cmo                    \
-  $(LIB)/format.cmo $(LIB)/scanf.cmo $(LIB)/camlinternalOO.cmo              \
+  $(LIB)/format.cmo $(LIB)/scanf.cmo $(LIB)/callback.cmo \
+  $(LIB)/camlinternalOO.cmo              \
   $(LIB)/oo.cmo $(LIB)/camlinternalMod.cmo $(LIB)/genlex.cmo                \
-  $(LIB)/callback.cmo $(LIB)/weak.cmo $(LIB)/filename.cmo                   \
+  $(LIB)/weak.cmo $(LIB)/filename.cmo                   \
   $(LIB)/complex.cmo $(LIB)/arrayLabels.cmo $(LIB)/listLabels.cmo           \
   $(LIB)/stringLabels.cmo $(LIB)/stdLabels.cmo $(LIB)/moreLabels.cmo
 
index cee2ed13835e5421bc8658d4f700924e04c17168..ad21804ce6df17808226e5240126b155ad2e5e57 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: select.c 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: select.c 12947 2012-09-24 11:25:32Z xleroy $ */
 
 #include <mlvalues.h>
 #include <alloc.h>
 #endif
 #include <string.h>
 #include <unistd.h>
+#include <errno.h>
 
-typedef fd_set file_descr_set;
-
-static void fdlist_to_fdset(value fdlist, fd_set *fdset, int *maxfd)
+static int fdlist_to_fdset(value fdlist, fd_set *fdset, int *maxfd)
 {
   value l;
   FD_ZERO(fdset);
   for (l = fdlist; l != Val_int(0); l = Field(l, 1)) {
-    int fd = Int_val(Field(l, 0));
-    FD_SET(fd, fdset);
+    long fd = Long_val(Field(l, 0));
+    /* PR#5563: harden against bad fds */
+    if (fd < 0 || fd >= FD_SETSIZE) return -1;
+    FD_SET((int) fd, fdset);
     if (fd > *maxfd) *maxfd = fd;
   }
+  return 0;
 }
 
 static value fdset_to_fdlist(value fdlist, fd_set *fdset)
@@ -75,9 +77,11 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds,
 
   Begin_roots3 (readfds, writefds, exceptfds);
     maxfd = -1;
-    fdlist_to_fdset(readfds, &read, &maxfd);
-    fdlist_to_fdset(writefds, &write, &maxfd);
-    fdlist_to_fdset(exceptfds, &except, &maxfd);
+    retcode  = fdlist_to_fdset(readfds, &read, &maxfd);
+    retcode += fdlist_to_fdset(writefds, &write, &maxfd);
+    retcode += fdlist_to_fdset(exceptfds, &except, &maxfd);
+    /* PR#5563: if a bad fd was encountered, report EINVAL error */
+    if (retcode != 0) unix_error(EINVAL, "select", Nothing);
     tm = Double_val(timeout);
     if (tm < 0.0)
       tvp = (struct timeval *) NULL;
index 0f3245a97a2465ae0037d2fd873108c433d1a4b5..00c93f85866995c15ba8927c1298627adf0024df 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: close_on.c 11888 2011-12-20 08:59:09Z xleroy $ */
+/* $Id: close_on.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include <mlvalues.h>
 #include <windows.h>
@@ -22,8 +22,8 @@ int win_set_inherit(value fd, BOOL inherit)
   /* According to the MSDN, SetHandleInformation may not work
      for console handles on WinNT4 and earlier versions. */
   if (! SetHandleInformation(Handle_val(fd),
-                            HANDLE_FLAG_INHERIT,
-                            inherit ? HANDLE_FLAG_INHERIT : 0)) {
+                             HANDLE_FLAG_INHERIT,
+                             inherit ? HANDLE_FLAG_INHERIT : 0)) {
     win32_maperr(GetLastError());
     return -1;
   }
index cd9ad22f5cfa99240f53f8ad2a1e7885b6269146..e9169dfa97d4f4aa80681949d4f0cdec6ca2f885 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: select.c 12023 2012-01-14 09:40:49Z xleroy $ */
+/* $Id: select.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include <mlvalues.h>
 #include <alloc.h>
@@ -31,7 +31,7 @@
  * It takes the following parameters into account:
  * - limitation on number of objects is mostly due to limitation
  *   a WaitForMultipleObjects
- * - there is always an event "hStop" to watch 
+ * - there is always an event "hStop" to watch
  *
  * This lead to pick the following value as the biggest possible
  * value
@@ -115,7 +115,7 @@ typedef enum _SELECTHANDLETYPE {
 typedef enum _SELECTMODE {
   SELECT_MODE_NONE = 0,
   SELECT_MODE_READ = 1,
-  SELECT_MODE_WRITE = 2, 
+  SELECT_MODE_WRITE = 2,
   SELECT_MODE_EXCEPT = 4,
 } SELECTMODE;
 
@@ -191,18 +191,18 @@ LPSELECTDATA select_data_new (LPSELECTDATA lpSelectData, SELECTTYPE EType)
   /* Allocate the data structure */
   LPSELECTDATA res;
   DWORD        i;
-  
-  res = (LPSELECTDATA)caml_stat_alloc(sizeof(SELECTDATA)); 
+
+  res = (LPSELECTDATA)caml_stat_alloc(sizeof(SELECTDATA));
 
   /* Init common data */
   list_init((LPLIST)res);
   list_next_set((LPLIST)res, (LPLIST)lpSelectData);
   res->EType         = EType;
   res->nResultsCount = 0;
-        
+
 
   /* Data following are dedicated to APC like call, they
-     will be initialized if required. For now they are set to 
+     will be initialized if required. For now they are set to
      invalid values.
      */
   res->funcWorker    = NULL;
@@ -255,14 +255,14 @@ DWORD select_data_result_add (LPSELECTDATA lpSelectData, SELECTMODE EMode, int l
 }
 
 /* Add a query to select data, return zero if something goes wrong */
-DWORD select_data_query_add (LPSELECTDATA lpSelectData, 
-                             SELECTMODE EMode, 
-                             HANDLE hFileDescr, 
+DWORD select_data_query_add (LPSELECTDATA lpSelectData,
+                             SELECTMODE EMode,
+                             HANDLE hFileDescr,
                              int lpOrigIdx,
                              unsigned int uFlagsFd)
 {
   DWORD res;
-  DWORD i; 
+  DWORD i;
 
   res = 0;
   if (lpSelectData->nQueriesCount < MAXIMUM_SELECT_OBJECTS)
@@ -280,22 +280,22 @@ DWORD select_data_query_add (LPSELECTDATA lpSelectData,
 }
 
 /* Search for a job that has available query slots and that match provided type.
- * If none is found, create a new one. Return the corresponding SELECTDATA, and 
+ * If none is found, create a new one. Return the corresponding SELECTDATA, and
  * update provided SELECTDATA head, if required.
  */
 LPSELECTDATA select_data_job_search (LPSELECTDATA *lppSelectData, SELECTTYPE EType)
 {
   LPSELECTDATA res;
-  
+
   res = NULL;
-  
+
   /* Search for job */
   DEBUG_PRINT("Searching an available job for type %d", EType);
   res = *lppSelectData;
   while (
       res != NULL
       && !(
-        res->EType == EType 
+        res->EType == EType
         && res->nQueriesCount < MAXIMUM_SELECT_OBJECTS
         )
       )
@@ -326,7 +326,7 @@ void read_console_poll(HANDLE hStop, void *_data)
   DWORD n;
   LPSELECTDATA  lpSelectData;
   LPSELECTQUERY lpQuery;
-  
+
   DEBUG_PRINT("Waiting for data on console");
 
   record;
@@ -338,7 +338,7 @@ void read_console_poll(HANDLE hStop, void *_data)
   events[0] = hStop;
   events[1] = lpQuery->hFileDescr;
   while (lpSelectData->EState == SELECT_STATE_NONE)
-  {    
+  {
     waitRes = WaitForMultipleObjects(2, events, FALSE, INFINITE);
     if (waitRes == WAIT_OBJECT_0 || check_error(lpSelectData, waitRes == WAIT_FAILED))
     {
@@ -359,7 +359,7 @@ void read_console_poll(HANDLE hStop, void *_data)
       lpSelectData->EState = SELECT_STATE_SIGNALED;
       break;
     }
-    else 
+    else
     {
       /* discard everything else and try again */
       if (check_error(lpSelectData, ReadConsoleInput(lpQuery->hFileDescr, &record, 1, &n) == 0))
@@ -371,9 +371,9 @@ void read_console_poll(HANDLE hStop, void *_data)
 }
 
 /* Add a function to monitor console input */
-LPSELECTDATA read_console_poll_add (LPSELECTDATA lpSelectData, 
-                                    SELECTMODE EMode, 
-                                    HANDLE hFileDescr, 
+LPSELECTDATA read_console_poll_add (LPSELECTDATA lpSelectData,
+                                    SELECTMODE EMode,
+                                    HANDLE hFileDescr,
                                     int lpOrigIdx,
                                     unsigned int uFlagsFd)
 {
@@ -414,14 +414,14 @@ void read_pipe_poll (HANDLE hStop, void *_data)
     {
       iterQuery = &(lpSelectData->aQueries[i]);
       res = PeekNamedPipe(
-          iterQuery->hFileDescr, 
-          NULL, 
-          0, 
-          NULL, 
-          &n, 
+          iterQuery->hFileDescr,
+          NULL,
+          0,
+          NULL,
+          &n,
           NULL);
-      if (check_error(lpSelectData, 
-            (res == 0) && 
+      if (check_error(lpSelectData,
+            (res == 0) &&
             (GetLastError() != ERROR_BROKEN_PIPE)))
       {
         break;
@@ -435,7 +435,7 @@ void read_pipe_poll (HANDLE hStop, void *_data)
     };
 
     /* Alas, nothing except polling seems to work for pipes.
-       Check the state & stop_worker_event every 10 ms 
+       Check the state & stop_worker_event every 10 ms
      */
     if (lpSelectData->EState == SELECT_STATE_NONE)
     {
@@ -446,7 +446,7 @@ void read_pipe_poll (HANDLE hStop, void *_data)
        * a chance that one of the 4 first calls succeed.
        */
       wait = 2 * wait;
-      if (wait > 10) 
+      if (wait > 10)
       {
         wait = 10;
       };
@@ -460,23 +460,23 @@ void read_pipe_poll (HANDLE hStop, void *_data)
 }
 
 /* Add a function to monitor pipe input */
-LPSELECTDATA read_pipe_poll_add (LPSELECTDATA lpSelectData, 
-                                 SELECTMODE EMode, 
-                                 HANDLE hFileDescr, 
+LPSELECTDATA read_pipe_poll_add (LPSELECTDATA lpSelectData,
+                                 SELECTMODE EMode,
+                                 HANDLE hFileDescr,
                                  int lpOrigIdx,
                                  unsigned int uFlagsFd)
 {
   LPSELECTDATA res;
   LPSELECTDATA hd;
-  
+
   hd = lpSelectData;
   /* Polling pipe is a non blocking operation by default. This means that each
-     worker can handle many pipe. We begin to try to find a worker that is 
+     worker can handle many pipe. We begin to try to find a worker that is
      polling pipe, but for which there is under the limit of pipe per worker.
      */
   DEBUG_PRINT("Searching an available worker handling pipe");
   res = select_data_job_search(&hd, SELECT_TYPE_PIPE_READ);
-  
+
   /* Add a new pipe to poll */
   res->funcWorker = read_pipe_poll;
   select_data_query_add(res, EMode, hFileDescr, lpOrigIdx, uFlagsFd);
@@ -528,22 +528,22 @@ void socket_poll (HANDLE hStop, void *_data)
 
     check_error(lpSelectData,
         WSAEventSelect(
-          (SOCKET)(iterQuery->hFileDescr), 
-          aEvents[nEvents], 
+          (SOCKET)(iterQuery->hFileDescr),
+          aEvents[nEvents],
           maskEvents) == SOCKET_ERROR);
   }
-  
+
   /* Add stop event */
   aEvents[nEvents]  = hStop;
   nEvents++;
 
   if (lpSelectData->nError == 0)
   {
-    check_error(lpSelectData, 
+    check_error(lpSelectData,
         WaitForMultipleObjects(
-          nEvents, 
-          aEvents, 
-          FALSE, 
+          nEvents,
+          aEvents,
+          FALSE,
           INFINITE) == WAIT_FAILED);
   };
 
@@ -599,9 +599,9 @@ void socket_poll (HANDLE hStop, void *_data)
 }
 
 /* Add a function to monitor socket */
-LPSELECTDATA socket_poll_add (LPSELECTDATA lpSelectData, 
-                              SELECTMODE EMode, 
-                              HANDLE hFileDescr, 
+LPSELECTDATA socket_poll_add (LPSELECTDATA lpSelectData,
+                              SELECTMODE EMode,
+                              HANDLE hFileDescr,
                               int lpOrigIdx,
                               unsigned int uFlagsFd)
 {
@@ -609,7 +609,7 @@ LPSELECTDATA socket_poll_add (LPSELECTDATA lpSelectData,
   LPSELECTDATA candidate;
   DWORD i;
   LPSELECTQUERY aQueries;
-  
+
   res = lpSelectData;
   candidate = NULL;
   aQueries = NULL;
@@ -695,19 +695,19 @@ LPSELECTDATA socket_poll_add (LPSELECTDATA lpSelectData,
 /***********************/
 
 /* Add a static result */
-LPSELECTDATA static_poll_add (LPSELECTDATA lpSelectData, 
-                              SELECTMODE EMode, 
-                              HANDLE hFileDescr, 
+LPSELECTDATA static_poll_add (LPSELECTDATA lpSelectData,
+                              SELECTMODE EMode,
+                              HANDLE hFileDescr,
                               int lpOrigIdx,
                               unsigned int uFlagsFd)
 {
   LPSELECTDATA res;
   LPSELECTDATA hd;
-  
+
   /* Look for an already initialized static element */
   hd = lpSelectData;
   res = select_data_job_search(&hd, SELECT_TYPE_STATIC);
-  
+
   /* Add a new query/result */
   select_data_query_add(res, EMode, hFileDescr, lpOrigIdx, uFlagsFd);
   select_data_result_add(res, EMode, lpOrigIdx);
@@ -738,7 +738,7 @@ static SELECTHANDLETYPE get_handle_type(value fd)
   {
     switch(GetFileType(Handle_val(fd)))
     {
-      case FILE_TYPE_DISK: 
+      case FILE_TYPE_DISK:
         res = SELECT_HANDLE_DISK;
         break;
 
@@ -783,8 +783,8 @@ LPSELECTDATA select_data_dispatch (LPSELECTDATA lpSelectData, SELECTMODE EMode,
   DEBUG_PRINT("Begin dispatching handle %x", hFileDescr);
 
   DEBUG_PRINT("Waiting for %d on handle %x", EMode, hFileDescr);
-  
-  /* There is only 2 way to have except mode: transmission of OOB data through 
+
+  /* There is only 2 way to have except mode: transmission of OOB data through
      a socket TCP/IP and through a strange interaction with a TTY.
      With windows, we only consider the TCP/IP except condition
   */
@@ -879,7 +879,7 @@ static value find_handle(LPSELECTRESULT iterResult, value readfds, value writefd
   CAMLlocal2(result, list);
   int i;
 
-  switch( iterResult->EMode )  
+  switch( iterResult->EMode )
   {
     case SELECT_MODE_READ:
       list = readfds;
@@ -892,12 +892,12 @@ static value find_handle(LPSELECTRESULT iterResult, value readfds, value writefd
       break;
   };
 
-  for(i=0; list != Val_unit && i < iterResult->lpOrigIdx; ++i ) 
+  for(i=0; list != Val_unit && i < iterResult->lpOrigIdx; ++i )
   {
     list = Field(list, 1);
   }
 
-  if (list == Val_unit) 
+  if (list == Val_unit)
     failwith ("select.c: original file handle not found");
 
   result = Field(list, 0);
@@ -944,12 +944,12 @@ static value fdset_to_fdlist(value fdlist, fd_set *fdset)
 }
 
 CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value timeout)
-{  
+{
   /* Event associated to handle */
   DWORD   nEventsCount;
   DWORD   nEventsMax;
   HANDLE *lpEventsDone;
-  
+
   /* Data for all handles */
   LPSELECTDATA lpSelectData;
   LPSELECTDATA iterSelectData;
@@ -990,7 +990,7 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
   double tm;
   struct timeval tv;
   struct timeval * tvp;
-  
+
   DEBUG_PRINT("in select");
 
   err = 0;
@@ -1003,7 +1003,7 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
       leave_blocking_section();
     }
     read_list = write_list = except_list = Val_int(0);
-  } else {      
+  } else {
     if (fdlist_to_fdset(readfds, &read) && fdlist_to_fdset(writefds, &write) && fdlist_to_fdset(exceptfds, &except)) {
       DEBUG_PRINT("only sockets to select on, using classic select");
       if (tm < 0.0) {
@@ -1040,9 +1040,9 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
       writefds_len   = caml_list_length(writefds);
       exceptfds_len  = caml_list_length(exceptfds);
       hdsMax         = MAX(readfds_len, MAX(writefds_len, exceptfds_len));
-      
+
       hdsData = (HANDLE *)caml_stat_alloc(sizeof(HANDLE) * hdsMax);
-      
+
       if (tm >= 0.0)
         {
           milliseconds = 1000 * tm;
@@ -1052,8 +1052,8 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
         {
           milliseconds = INFINITE;
         }
-      
-      
+
+
       /* Create list of select data, based on the different list of fd to watch */
       DEBUG_PRINT("Dispatch read fd");
       handle_set_init(&hds, hdsData, hdsMax);
@@ -1072,7 +1072,7 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
             }
         }
       handle_set_reset(&hds);
-      
+
       DEBUG_PRINT("Dispatch write fd");
       handle_set_init(&hds, hdsData, hdsMax);
       i=0;
@@ -1090,7 +1090,7 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
             }
         }
       handle_set_reset(&hds);
-      
+
       DEBUG_PRINT("Dispatch exceptional fd");
       handle_set_init(&hds, hdsData, hdsMax);
       i=0;
@@ -1108,13 +1108,13 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
             }
         }
       handle_set_reset(&hds);
-      
+
       /* Building the list of handle to wait for */
       DEBUG_PRINT("Building events done array");
       nEventsMax   = list_length((LPLIST)lpSelectData);
       nEventsCount = 0;
       lpEventsDone = (HANDLE *)caml_stat_alloc(sizeof(HANDLE) * nEventsMax);
-      
+
       iterSelectData = lpSelectData;
       while (iterSelectData != NULL)
         {
@@ -1127,23 +1127,23 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
             {
               hasStaticData = TRUE;
             };
-          
+
           /* Execute APC */
           if (iterSelectData->funcWorker != NULL)
             {
-              iterSelectData->lpWorker = 
+              iterSelectData->lpWorker =
                 worker_job_submit(
-                                  iterSelectData->funcWorker, 
+                                  iterSelectData->funcWorker,
                                   (void *)iterSelectData);
-              DEBUG_PRINT("Job submitted to worker %x", iterSelectData->lpWorker); 
+              DEBUG_PRINT("Job submitted to worker %x", iterSelectData->lpWorker);
               lpEventsDone[nEventsCount] = worker_job_event_done(iterSelectData->lpWorker);
               nEventsCount++;
             };
           iterSelectData = LIST_NEXT(LPSELECTDATA, iterSelectData);
         };
-      
+
       DEBUG_PRINT("Need to watch %d workers", nEventsCount);
-      
+
       /* Processing select itself */
       enter_blocking_section();
       /* There are worker started, waiting to be monitored */
@@ -1158,17 +1158,17 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
                 case WAIT_FAILED:
                   err = GetLastError();
                   break;
-                  
+
                 case WAIT_TIMEOUT:
                   DEBUG_PRINT("Select timeout");
                   break;
-                  
+
                 default:
                   DEBUG_PRINT("One worker is done");
                   break;
                 };
             }
-          
+
           /* Ordering stop to every worker */
           DEBUG_PRINT("Sending stop signal to every select workers");
           iterSelectData = lpSelectData;
@@ -1180,14 +1180,14 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
                 };
               iterSelectData = LIST_NEXT(LPSELECTDATA, iterSelectData);
             };
-          
+
           DEBUG_PRINT("Waiting for every select worker to be done");
           switch (WaitForMultipleObjects(nEventsCount, lpEventsDone, TRUE, INFINITE))
             {
             case WAIT_FAILED:
               err = GetLastError();
               break;
-              
+
             default:
               DEBUG_PRINT("Every worker is done");
               break;
@@ -1199,16 +1199,16 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
           Sleep(milliseconds);
         }
       leave_blocking_section();
-      
+
       DEBUG_PRINT("Error status: %d (0 is ok)", err);
       /* Build results */
       if (err == 0)
         {
           DEBUG_PRINT("Building result");
-          read_list = Val_unit; 
+          read_list = Val_unit;
           write_list = Val_unit;
           except_list = Val_unit;
-          
+
           iterSelectData = lpSelectData;
           while (iterSelectData != NULL)
             {
@@ -1241,7 +1241,7 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
               iterSelectData = LIST_NEXT(LPSELECTDATA, iterSelectData);
             }
         }
-      
+
       /* Free resources */
       DEBUG_PRINT("Free selectdata resources");
       iterSelectData = lpSelectData;
@@ -1252,12 +1252,12 @@ CAMLprim value unix_select(value readfds, value writefds, value exceptfds, value
           select_data_free(lpSelectData);
         }
       lpSelectData = NULL;
-      
+
       /* Free allocated events/handle set array */
       DEBUG_PRINT("Free local allocated resources");
       caml_stat_free(lpEventsDone);
       caml_stat_free(hdsData);
-      
+
       DEBUG_PRINT("Raise error if required");
       if (err != 0)
         {
index 725895ec1594f6282b22fd7ef43894df1c11326a..1946452d6ceac275b2df1ef959e48e20046065e6 100644 (file)
@@ -1,35 +1,35 @@
-#include <windows.h>\r
-#include <mlvalues.h>\r
-#include "unixsupport.h"\r
-\r
-\r
-double to_sec(FILETIME ft) {\r
-  ULARGE_INTEGER tmp;\r
-\r
-  tmp.u.LowPart = ft.dwLowDateTime;\r
-  tmp.u.HighPart = ft.dwHighDateTime;\r
-\r
-  /* convert to seconds:\r
-     GetProcessTimes returns number of 100-nanosecond intervals */\r
-  return tmp.QuadPart / 1e7;\r
-}\r
-\r
-\r
-value unix_times(value unit) {\r
-\r
-  value res;\r
-  FILETIME creation, exit, stime, utime;\r
-\r
-  if (!(GetProcessTimes(GetCurrentProcess(), &creation, &exit, &stime, &utime))) {\r
-    win32_maperr(GetLastError());\r
-    uerror("times", Nothing);\r
-  }\r
-\r
-  res = alloc_small(4 * Double_wosize, Double_array_tag);\r
-  Store_double_field(res, 0, to_sec(utime));\r
-  Store_double_field(res, 1, to_sec(stime));\r
-  Store_double_field(res, 2, 0);\r
-  Store_double_field(res, 3, 0);\r
-  return res;\r
-\r
-}\r
+#include <windows.h>
+#include <mlvalues.h>
+#include "unixsupport.h"
+
+
+double to_sec(FILETIME ft) {
+  ULARGE_INTEGER tmp;
+
+  tmp.u.LowPart = ft.dwLowDateTime;
+  tmp.u.HighPart = ft.dwHighDateTime;
+
+  /* convert to seconds:
+     GetProcessTimes returns number of 100-nanosecond intervals */
+  return tmp.QuadPart / 1e7;
+}
+
+
+value unix_times(value unit) {
+
+  value res;
+  FILETIME creation, exit, stime, utime;
+
+  if (!(GetProcessTimes(GetCurrentProcess(), &creation, &exit, &stime, &utime))) {
+    win32_maperr(GetLastError());
+    uerror("times", Nothing);
+  }
+
+  res = alloc_small(4 * Double_wosize, Double_array_tag);
+  Store_double_field(res, 0, to_sec(utime));
+  Store_double_field(res, 1, to_sec(stime));
+  Store_double_field(res, 2, 0);
+  Store_double_field(res, 3, 0);
+  return res;
+
+}
index 6904c27a164fe0d646088e79451371022fe505ce..ffbfaca902ef0a1afec8fb74d04f17e826096689 100644 (file)
@@ -11,7 +11,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: windbug.c 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: windbug.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include "windbug.h"
 
@@ -26,7 +26,7 @@ int debug_test (void)
     debug = (getenv("OCAMLDEBUG") != NULL);
     debug_init = 1;
   };
-#endif 
+#endif
 
   return debug;
 }
index 3576b0002d649a6935c31f632dfefbd0ad7c0566..fd24721428cf846a12879aa31fcca2deb61b4e48 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: location.mli 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: location.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Source code locations (ranges of positions), used in parsetree. *)
 
@@ -77,4 +77,3 @@ val show_filename: string -> string
 
 
 val absname: bool ref
-
index cf48b9bbd1ffcaaf0c23fe82711f4fb5caee9465..5cfee41a3094710cbc4db184bd79074a0d99da00 100644 (file)
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: parser.mly 12638 2012-06-21 17:10:58Z frisch $ */
+/* $Id: parser.mly 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* The parser definition */
 
@@ -1423,7 +1423,7 @@ constructor_declaration:
 
   | constr_ident generalized_constructor_arguments
       { let arg_types,ret_type = $2 in
-       (mkrhs $1 1, arg_types,ret_type, symbol_rloc()) }
+        (mkrhs $1 1, arg_types,ret_type, symbol_rloc()) }
 ;
 
 constructor_arguments:
index dea08e3bf158aeafdc8b20237cb14683c95130b3..8b2f3e027b91cec48e9b555878edd25b94b32861 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: printast.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: printast.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Asttypes;;
 open Format;;
@@ -338,9 +338,9 @@ and value_description i ppf x =
 and string_option_underscore i ppf =
   function
     | Some x ->
-       string i ppf x.txt
+        string i ppf x.txt
     | None ->
-       string i ppf "_"
+        string i ppf "_"
 
 and type_declaration i ppf x =
   line i ppf "type_declaration %a\n" fmt_location x.ptype_loc;
index 346dd9d5858d6c9b2f1e044db577705cf2de7723..78857a46e06b5f57792cc51fc3574755c52fa876 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: array.ml 11914 2011-12-21 10:41:59Z xleroy $ *)
+(* $Id: array.ml 12891 2012-08-28 15:07:45Z xleroy $ *)
 
 (* Array operations *)
 
@@ -22,7 +22,7 @@ external unsafe_get: 'a array -> int -> 'a = "%array_unsafe_get"
 external unsafe_set: 'a array -> int -> 'a -> unit = "%array_unsafe_set"
 external make: int -> 'a -> 'a array = "caml_make_vect"
 external create: int -> 'a -> 'a array = "caml_make_vect"
-external sub : 'a array -> int -> int -> 'a array = "caml_array_sub"
+external unsafe_sub : 'a array -> int -> int -> 'a array = "caml_array_sub"
 external append_prim : 'a array -> 'a array -> 'a array = "caml_array_append"
 external concat : 'a array list -> 'a array = "caml_array_concat"
 external unsafe_blit : 'a array -> int -> 'a array -> int -> int -> unit = "caml_array_blit"
@@ -45,14 +45,19 @@ let make_matrix sx sy init =
 let create_matrix = make_matrix
 
 let copy a =
-  let l = length a in if l = 0 then [||] else sub a 0 l
+  let l = length a in if l = 0 then [||] else unsafe_sub a 0 l
 
 let append a1 a2 =
   let l1 = length a1 in
   if l1 = 0 then copy a2
-  else if length a2 = 0 then sub a1 0 l1
+  else if length a2 = 0 then unsafe_sub a1 0 l1
   else append_prim a1 a2
 
+let sub a ofs len =
+  if len < 0 || ofs > length a - len
+  then invalid_arg "Array.sub"
+  else unsafe_sub a ofs len
+
 let fill a ofs len v =
   if ofs < 0 || len < 0 || ofs > length a - len
   then invalid_arg "Array.fill"
index 07f11520ec8f79f69fff9e307b97a1c6ff6686c1..6dc86940e08152d25d7169d3951ceba415985717 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: format.mli 12213 2012-03-08 22:36:21Z doligez $ *)
+(* $Id: format.mli 12906 2012-09-08 15:27:53Z doligez $ *)
 
 (** Pretty printing.
 
@@ -164,7 +164,7 @@ val set_margin : int -> unit;;
    overflows that leads to split lines.
    Nothing happens if [d] is smaller than 2.
    If [d] is too large, the right margin is set to the maximum
-   admissible value (which is greater than [10^10]). *)
+   admissible value (which is greater than [10^9]). *)
 
 val get_margin : unit -> int;;
 (** Returns the position of the right margin. *)
@@ -178,7 +178,7 @@ val set_max_indent : int -> unit;;
    if they do not fit on the current line.
    Nothing happens if [d] is smaller than 2.
    If [d] is too large, the limit is set to the maximum
-   admissible value (which is greater than [10^10]). *)
+   admissible value (which is greater than [10^9]). *)
 
 val get_max_indent : unit -> int;;
 (** Return the value of the maximum indentation limit (in characters). *)
@@ -632,7 +632,6 @@ val fprintf : formatter -> ('a, formatter, unit) format -> 'a;;
      For more details about tags, see the functions [open_tag] and
      [close_tag].
    - [@\}]: close the most recently opened tag.
-   - [@%]: print a plain [%] character.
 
    Example: [printf "@[%s@ %d@]@." "x =" 1] is equivalent to
    [open_box (); print_string "x ="; print_space ();
index f2a553dad721bdb4c3a77ddc37f9228051a26f29..0a3e1ced864a0a3451521d1fc440dc0733025201 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: stdLabels.mli 12210 2012-03-08 19:52:03Z doligez $ *)
+(* $Id: stdLabels.mli 12823 2012-08-06 11:41:12Z doligez $ *)
 
 (** Standard labeled libraries.
 
@@ -117,6 +117,8 @@ module String :
         unit
     val concat : sep:string -> string list -> string
     val iter : f:(char -> unit) -> string -> unit
+    val iteri : f:(int -> char -> unit) -> string -> unit
+    val map : f:(char -> char) -> string -> string
     val trim : string -> string
     val escaped : string -> string
     val index : string -> char -> int
index 454c0f4a8a4a6c6966ddea30594e873786cf39c5..f63f31cb3c223e54b13f132fc369890530aabec3 100644 (file)
@@ -11,7 +11,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: stream.ml 12683 2012-07-10 10:01:57Z scherer $ *)
+(* $Id: stream.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* The fields of type t are not mutable to preserve polymorphism of
    the empty stream. This is type safe because the empty stream is never
@@ -46,7 +46,7 @@ let rec get_data s d = match d with
  (* Only return a "forced stream", that is either Sempty or
     Scons(a,_). If d is a generator or a buffer, the item a is seen as
     extracted from the generator/buffer.
-    
+
     Forcing also updates the "count" field of the delayed stream,
     in the Sapp and Slazy cases (see slazy/lapp implementation below). *)
    Sempty | Scons (_, _) -> d
index 146785cb28d123b7d7b035b95ce52a4072ae5d15..9f6ad1b5685dce77089886a345cc719bfb9904b1 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: alloc.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: alloc.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Random allocation test *)
 
@@ -48,4 +48,3 @@ let argspecs = [
 Arg.parse argspecs (fun _ -> ()) "Usage: alloc [-c]";;
 
 main ();;
-
index b1ae33d48a0f985d5dccca5a6a3b73a6a3b3a9ba..6398f754b30e8315adcddd7a3616a81664ec8704 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: testing.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: testing.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Testing auxilliaries. *)
 
@@ -30,7 +30,7 @@ at_exit finish;;
 let test_num = ref (-1);;
 
 let print_test_number () =
-  print_int !test_num; print_string " "; flush stdout;;
+  print_string " "; print_int !test_num; flush stdout;;
 
 let next_test () =
   incr test_num;
@@ -93,4 +93,3 @@ let any_failure_test = test_raises_some_failure;;
 
 let scan_failure_test f x =
   test_raises_exc_p (function Scan_failure _ -> true | _ -> false) f x;;
-
index b71e79658f0e152c4a0305fe311293c63500f3c1..7b64db8a643141ae1017420636b8c36f8d07c9dc 100644 (file)
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: amd64.S 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: amd64.S 12800 2012-07-30 18:59:07Z doligez $ */
 
 #ifdef SYS_macosx
 #define ALIGN 4
@@ -39,12 +39,12 @@ CALL_GEN_CODE:
         pushq   %r13
         pushq   %r14
         pushq   %r15
-       movq    %rdi, %r10
-       movq    %rsi, %rax
-       movq    %rdx, %rbx
-       movq    %rcx, %rdi
-       movq    %r8, %rsi
-        call   *%r10
+        movq    %rdi, %r10
+        movq    %rsi, %rax
+        movq    %rdx, %rbx
+        movq    %rcx, %rdi
+        movq    %r8, %rsi
+        call    *%r10
         popq    %r15
         popq    %r14
         popq    %r13
@@ -59,17 +59,17 @@ CAML_C_CALL:
         jmp     *%rax
 
 #ifdef SYS_macosx
-       .literal16
+        .literal16
 #else
-       .section        .rodata.cst8,"aM",@progbits,8
+        .section        .rodata.cst8,"aM",@progbits,8
 #endif
         .globl  CAML_NEGF_MASK
         .align  ALIGN
 CAML_NEGF_MASK:
-       .quad   0x8000000000000000, 0
+        .quad   0x8000000000000000, 0
         .globl  CAML_ABSF_MASK
         .align  ALIGN
 CAML_ABSF_MASK:
-       .quad   0x7FFFFFFFFFFFFFFF, 0
+        .quad   0x7FFFFFFFFFFFFFFF, 0
 
         .comm   young_limit, 8
index 984e9e4000a72cd514846d518e1ca2d9920198ae..fe3b0f84d773a41d51926d74ee98f7c6294fe797 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: arith.cmm 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: arith.cmm 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Regression test for arithmetic instructions *)
 
       (floataset d 38 (absf f))
 
 )))))))
-
-
-
index be89133e58f86675321f4f59d19f745d90beb070..f459bd33a172902852324c141ae05ea443ae842c 100644 (file)
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: arm.S 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: arm.S 12800 2012-07-30 18:59:07Z doligez $ */
 
         .text
 
@@ -37,4 +37,3 @@ call_gen_code:
 caml_c_call:
     @ function to call is in r10
         mov     pc, r10
-
index da8abdf4d586729e1bb3f1aa1bdea2f0946e0a9e..81c72651d745a3588c89f10724350dd61f57543c 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: checkbound.cmm 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: checkbound.cmm 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (function "checkbound2" (x: int y: int)
   (checkbound x y))
 
 (function "checkbound1" (x: int)
   (checkbound x 2))
-
-
index 87a96da9446a7118174e916ec4f7a9f8f46e943d..2d130dedef49c5b4d33aaac527a4314d8f6cec9c 100644 (file)
@@ -10,7 +10,7 @@
 ;*                                                                   *
 ;*********************************************************************
 
-; $Id: hppa.S 11156 2011-07-27 14:17:02Z doligez $
+; $Id: hppa.S 12800 2012-07-30 18:59:07Z doligez $
 ; Must be preprocessed by cpp
 
 #ifdef SYS_hpux
 #endif
 
 #ifdef SYS_hpux
-       .space $PRIVATE$
-       .subspa $DATA$,quad=1,align=8,access=31
-       .subspa $BSS$,quad=1,align=8,access=31,zero,sort=82
-       .space $TEXT$
-       .subspa $LIT$,quad=0,align=8,access=44
-       .subspa $CODE$,quad=0,align=8,access=44,code_only
-       .import $global$, data
+        .space $PRIVATE$
+        .subspa $DATA$,quad=1,align=8,access=31
+        .subspa $BSS$,quad=1,align=8,access=31,zero,sort=82
+        .space $TEXT$
+        .subspa $LIT$,quad=0,align=8,access=44
+        .subspa $CODE$,quad=0,align=8,access=44,code_only
+        .import $global$, data
         .import $$dyncall, millicode
 #endif
 
@@ -47,8 +47,8 @@
         EXPORT_CODE(G(call_gen_code))
 G(call_gen_code):
         STARTPROC
-       stw     %r2,-20(%r30)
-        ldo    256(%r30), %r30
+        stw     %r2,-20(%r30)
+        ldo     256(%r30), %r30
 ; Save the callee-save registers
         ldo     -32(%r30), %r1
         stws,ma %r3, -4(%r1)
@@ -67,26 +67,26 @@ G(call_gen_code):
         stws,ma %r16, -4(%r1)
         stws,ma %r17, -4(%r1)
         stws,ma %r18, -4(%r1)
-       fstds,ma %fr12, -8(%r1)
-       fstds,ma %fr13, -8(%r1)
-       fstds,ma %fr14, -8(%r1)
-       fstds,ma %fr15, -8(%r1)
-       fstds,ma %fr16, -8(%r1)
-       fstds,ma %fr17, -8(%r1)
-       fstds,ma %fr18, -8(%r1)
-       fstds,ma %fr19, -8(%r1)
-       fstds,ma %fr20, -8(%r1)
-       fstds,ma %fr21, -8(%r1)
-       fstds,ma %fr22, -8(%r1)
-       fstds,ma %fr23, -8(%r1)
-       fstds,ma %fr24, -8(%r1)
-       fstds,ma %fr25, -8(%r1)
-       fstds,ma %fr26, -8(%r1)
-       fstds,ma %fr27, -8(%r1)
-       fstds,ma %fr28, -8(%r1)
-       fstds,ma %fr29, -8(%r1)
-       fstds,ma %fr30, -8(%r1)
-       fstds,ma %fr31, -8(%r1)
+        fstds,ma %fr12, -8(%r1)
+        fstds,ma %fr13, -8(%r1)
+        fstds,ma %fr14, -8(%r1)
+        fstds,ma %fr15, -8(%r1)
+        fstds,ma %fr16, -8(%r1)
+        fstds,ma %fr17, -8(%r1)
+        fstds,ma %fr18, -8(%r1)
+        fstds,ma %fr19, -8(%r1)
+        fstds,ma %fr20, -8(%r1)
+        fstds,ma %fr21, -8(%r1)
+        fstds,ma %fr22, -8(%r1)
+        fstds,ma %fr23, -8(%r1)
+        fstds,ma %fr24, -8(%r1)
+        fstds,ma %fr25, -8(%r1)
+        fstds,ma %fr26, -8(%r1)
+        fstds,ma %fr27, -8(%r1)
+        fstds,ma %fr28, -8(%r1)
+        fstds,ma %fr29, -8(%r1)
+        fstds,ma %fr30, -8(%r1)
+        fstds,ma %fr31, -8(%r1)
 
 ; Shuffle the arguments and call
         copy    %r26, %r22
@@ -121,42 +121,42 @@ G(call_gen_code):
         ldws,ma -4(%r1), %r16
         ldws,ma -4(%r1), %r17
         ldws,ma -4(%r1), %r18
-       fldds,ma -8(%r1), %fr12
-       fldds,ma -8(%r1), %fr13
-       fldds,ma -8(%r1), %fr14
-       fldds,ma -8(%r1), %fr15
-       fldds,ma -8(%r1), %fr16
-       fldds,ma -8(%r1), %fr17
-       fldds,ma -8(%r1), %fr18
-       fldds,ma -8(%r1), %fr19
-       fldds,ma -8(%r1), %fr20
-       fldds,ma -8(%r1), %fr21
-       fldds,ma -8(%r1), %fr22
-       fldds,ma -8(%r1), %fr23
-       fldds,ma -8(%r1), %fr24
-       fldds,ma -8(%r1), %fr25
-       fldds,ma -8(%r1), %fr26
-       fldds,ma -8(%r1), %fr27
-       fldds,ma -8(%r1), %fr28
-       fldds,ma -8(%r1), %fr29
-       fldds,ma -8(%r1), %fr30
-       fldds,ma -8(%r1), %fr31
+        fldds,ma -8(%r1), %fr12
+        fldds,ma -8(%r1), %fr13
+        fldds,ma -8(%r1), %fr14
+        fldds,ma -8(%r1), %fr15
+        fldds,ma -8(%r1), %fr16
+        fldds,ma -8(%r1), %fr17
+        fldds,ma -8(%r1), %fr18
+        fldds,ma -8(%r1), %fr19
+        fldds,ma -8(%r1), %fr20
+        fldds,ma -8(%r1), %fr21
+        fldds,ma -8(%r1), %fr22
+        fldds,ma -8(%r1), %fr23
+        fldds,ma -8(%r1), %fr24
+        fldds,ma -8(%r1), %fr25
+        fldds,ma -8(%r1), %fr26
+        fldds,ma -8(%r1), %fr27
+        fldds,ma -8(%r1), %fr28
+        fldds,ma -8(%r1), %fr29
+        fldds,ma -8(%r1), %fr30
+        fldds,ma -8(%r1), %fr31
 
-        ldo    -256(%r30), %r30
-       ldw     -20(%r30), %r2
+        ldo     -256(%r30), %r30
+        ldw     -20(%r30), %r2
         bv      0(%r2)
         nop
         ENDPROC
 
-       .align  CODE_ALIGN
-       EXPORT_CODE(caml_c_call)
+        .align  CODE_ALIGN
+        EXPORT_CODE(caml_c_call)
 G(caml_c_call):
         STARTPROC
 #ifdef SYS_hpux
         bl $$dyncall, %r0
         nop
 #else
-        bv     0(%r22)
+        bv      0(%r22)
         nop
 #endif
         ENDPROC
index 4e9b62f7d256149acc9416d3571f3b28bb027ddb..5a2fc0c8a8410c1549e5694b4cacd890a3bfee88 100644 (file)
@@ -1,67 +1,67 @@
-;*********************************************************************
-;                                                                     
-;                                OCaml                                
-;                                                                     
-;            Xavier Leroy, projet Cristal, INRIA Rocquencourt         
-;                                                                     
-;  Copyright 1996 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.               
-;                                                                     
-;*********************************************************************
+;*********************************************************************;
+;                                                                     ;
+;                                OCaml                                ;
+;                                                                     ;
+;            Xavier Leroy, projet Cristal, INRIA Rocquencourt         ;
+;                                                                     ;
+;  Copyright 1996 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.               ;
+;                                                                     ;
+;*********************************************************************;
 
-; $Id: i386nt.asm 11156 2011-07-27 14:17:02Z doligez $
+; $Id: i386nt.asm 12800 2012-07-30 18:59:07Z doligez $
 
-       .386
-       .MODEL FLAT
+        .386
+        .MODEL FLAT
 
         .CODE
         PUBLIC  _call_gen_code
         ALIGN   4
 _call_gen_code:
-        push   ebp
-        mov    ebp, esp
-        push   ebx
-        push   esi
-        push   edi
-        mov    eax, [ebp+12]
-        mov    ebx, [ebp+16]
-        mov    ecx, [ebp+20]
-        mov    edx, [ebp+24]
-        call   DWORD PTR [ebp+8]
-        pop    edi
-        pop    esi
-        pop    ebx
-        pop    ebp
-        ret    
+        push    ebp
+        mov     ebp, esp
+        push    ebx
+        push    esi
+        push    edi
+        mov     eax, [ebp+12]
+        mov     ebx, [ebp+16]
+        mov     ecx, [ebp+20]
+        mov     edx, [ebp+24]
+        call    DWORD PTR [ebp+8]
+        pop     edi
+        pop     esi
+        pop     ebx
+        pop     ebp
+        ret
 
         PUBLIC  _caml_c_call
         ALIGN   4
 _caml_c_call:
-        ffree  st(0)
-        ffree  st(1)
-        ffree  st(2)
-        ffree  st(3)
-        jmp    eax
+        ffree   st(0)
+        ffree   st(1)
+        ffree   st(2)
+        ffree   st(3)
+        jmp     eax
 
         PUBLIC  _caml_call_gc
         PUBLIC  _caml_alloc
         PUBLIC  _caml_alloc1
         PUBLIC  _caml_alloc2
-        PUBLIC  _caml_alloc3       
+        PUBLIC  _caml_alloc3
 _caml_call_gc:
 _caml_alloc:
 _caml_alloc1:
 _caml_alloc2:
 _caml_alloc3:
-        int     3      
+        int     3
 
         .DATA
-        PUBLIC _caml_exception_pointer
-_caml_exception_pointer        dword 0
-        PUBLIC _young_ptr
-_young_ptr     dword 0
-        PUBLIC _young_limit
-_young_limit   dword 0
+        PUBLIC  _caml_exception_pointer
+_caml_exception_pointer dword 0
+        PUBLIC  _young_ptr
+_young_ptr      dword 0
+        PUBLIC  _young_limit
+_young_limit    dword 0
 
         END
index 409f8d32e9b1642dd7d6a51260951828519fe38b..8cfc407fa25cd5304184b2d09f33037ee63610f0 100644 (file)
@@ -10,7 +10,7 @@
 |*                                                                     *
 |***********************************************************************
 
-| $Id: m68k.S 11156 2011-07-27 14:17:02Z doligez $
+| $Id: m68k.S 12800 2012-07-30 18:59:07Z doligez $
 
 | call_gen_code is used with the following types:
 |       unit -> int
@@ -19,7 +19,7 @@
 |       int * int * address -> void
 |       int * int -> void
 |       unit -> unit
-| Hence arg1 -> d0, arg2 -> d1, arg3 -> a0, 
+| Hence arg1 -> d0, arg2 -> d1, arg3 -> a0,
 | and we need a special case for int -> double
 
         .text
index 607a9b18d8ad4819f8b29564ca10c116f37e0a0e..b454a0308baede18a16b1459b4edfcc8dcad632f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: main.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: main.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Clflags
 
@@ -57,4 +57,3 @@ let main() =
     ] compile_file usage
 
 let _ = (*Printexc.catch*) main (); exit 0
-
index e1b7ded45a66cc7e5116293ad8d7858123a14eaa..77b13473aed393d1c12223c69d1dc178236c9cc0 100644 (file)
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: mainarith.c 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: mainarith.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include <stdio.h>
 #include <math.h>
@@ -304,4 +304,3 @@ int main(int argc, char **argv)
   }
   return 0;
 }
-
index 70337e256f9eaa6eb29a4a67280dca651fd584bc..666ef86dc05d8ff393ee7bc1d8980d8ed19dcf99 100644 (file)
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: parsecmm.mly 12235 2012-03-14 09:24:19Z xleroy $ */
+/* $Id: parsecmm.mly 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* A simple parser for C-- */
 
@@ -325,4 +325,3 @@ dataitem:
   | SKIP INTCONST               { Cskip $2 }
   | ALIGN INTCONST              { Calign $2 }
 ;
-
index 6f3501e220c94e61c1d17a865ac181ee01c720f8..ece00ec30f747b7715ff5e12078a4b2962ec0b3d 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tagged-fib.cmm 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: tagged-fib.cmm 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (function "fib" (n: int)
   (if (< n 5)
       3
     (-  (+ (app "fib" (- n 2) int) (app "fib" (- n 4) int)) 1)))
-
index d03b00a879529486c1a92f99392b78fb0478022b..1a92e8f9f0bd9aef2ccb77eed5da33f43afd4568 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: tagged-integr.cmm 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: tagged-integr.cmm 12800 2012-07-30 18:59:07Z doligez $ *)
 
 ("res_square": skip 8)
 ("h": skip 8)
@@ -42,4 +42,3 @@
   (store float "low" 0.0)
   (store float "hi" 1.0)
   (load float (app "integr" "square" "low" "hi" n addr)))
-
index 4d197f5de5e1327fae67eaccd4b50a84c58d32d0..996640a00ecfad75c66bbb644e2bfd91e4c06fd0 100644 (file)
@@ -2,4 +2,3 @@ let s = { Float_record.f = Float_record.make 1.0 };;
 
 print_float (Float_record.from s.Float_record.f);;
 print_newline ();;
-
index 7fe52a1f57b234c034a736114ca0657e6ac01155..edaa0c8a2cea0b97e7715e842d395f53d5219ea7 100644 (file)
@@ -24,5 +24,3 @@ let _ =
   print_string "Trail:";
   List.iter (fun n -> print_string " "; print_int n) !trail;
   print_newline()
-
-
index e45234d0086dc9d4ea39ca5e9db2db5b39ab86ff..05bfea5e1aacd68cf2a2f4ec6fb2a9edaf6c7e11 100644 (file)
@@ -51,13 +51,13 @@ test "deux" g 6 5 ;
 test "deux" g 9 7 ; ()
 ;;
 
-  
+
 let g x = match x with
   1 -> 1
 | 2 -> 2
 | 3 -> 3
 | 4 | 5 -> 4
-| 6 -> 5   
+| 6 -> 5
 | 7 | 8 -> 6
 | 9 -> 7
 | _ -> 8;;
@@ -70,7 +70,7 @@ let g x= match  x with
 | 2 -> 2
 | 3 -> 3
 | 4 | 5 -> 4
-| 6 -> 5   
+| 6 -> 5
 | 4|5|7 -> 100
 | 7 | 8 -> 6
 | 9 -> 7
@@ -251,7 +251,7 @@ test "fin" f (D (C,1)) (D (A,1)) ;
 test "fin" f (E (C,A)) (D (A,0)) ; ()
 ;;
 
-type length = 
+type length =
     Char of int | Pixel of int | Percent of int | No of string | Default
 
 let length = function
@@ -550,7 +550,7 @@ test "flatgarde" flatgarde (2,4) 3 ; ()
 
 (* Les bugs de jerome *)
 type f =
-  | ABSENT 
+  | ABSENT
   | FILE
   | SYMLINK
   | DIRECTORY
@@ -584,27 +584,27 @@ let replicaContent2shortString rc =
 ;;
 
 
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (ABSENT, Unchanged) "        " ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (ABSENT, Deleted) "deleted " ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (FILE, Modified) "changed " ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (DIRECTORY, PropsChanged) "props   " ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (FILE, Deleted) "assert false" ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (SYMLINK, Deleted) "assert false" ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (SYMLINK, PropsChanged) "assert false" ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (DIRECTORY, Deleted) "assert false" ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (ABSENT, Created) "assert false" ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (ABSENT, Modified) "assert false" ;
-test "jerome_constr" 
+test "jerome_constr"
    replicaContent2shortString (ABSENT, PropsChanged) "assert false" ;
 ;;
 
@@ -631,27 +631,27 @@ let replicaContent2shortString rc =
 ;;
 
 
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`ABSENT, `Unchanged) "        " ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`ABSENT, `Deleted) "deleted " ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`FILE, `Modified) "changed " ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`DIRECTORY, `PropsChanged) "props   " ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`FILE, `Deleted) "assert false" ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`SYMLINK, `Deleted) "assert false" ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`SYMLINK, `PropsChanged) "assert false" ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`DIRECTORY, `Deleted) "assert false" ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`ABSENT, `Created) "assert false" ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`ABSENT, `Modified) "assert false" ;
-test "jerome_variant" 
+test "jerome_variant"
    replicaContent2shortString (`ABSENT, `PropsChanged) "assert false" ;
 ;;
 
@@ -972,10 +972,10 @@ match n with
 type  habert_a=
   | A of habert_c
   | B of habert_c
-  
-and habert_c= {lvar:int; lassoc: habert_c;lnb:int} 
-  
-  
+
+and habert_c= {lvar:int; lassoc: habert_c;lnb:int}
+
+
 let habert=function
   | (A {lnb=i}|B {lnb=i}) when i=0 -> 1
   | A {lassoc=({lnb=j});lnb=i} -> 2
@@ -1000,13 +1000,13 @@ type type_expr = [
   | `TVariant of string list
   | `TBlock of int
   | `TCopy of type_expr
-  ] 
+  ]
 
 and recurs_type_expr = [
   | `TTuple of type_expr list
   | `TConstr of type_expr list
   | `TVariant of string list
-  ] 
+  ]
 
 
 let rec maf te =
@@ -1129,7 +1129,7 @@ type bg = [
   | `False
   | `True
   ]
-  
+
 type vg = [
   | `A
   | `B
@@ -1142,7 +1142,7 @@ type tg = {
     x : bg;
   }
 
-let predg x = true 
+let predg x = true
 
 let rec gilles o = match o with
   | {v = (`U data | `V data); x = `False} when predg o -> 1
@@ -1168,3 +1168,22 @@ let () =
   test "lucexn1" lucexn  (Error "coucou") "coucou" ;
   test "lucexn2" lucexn (Found ("int: ",0)) "int: 0" ;
   ()
+
+(*
+  PR#5758: different representations of floats
+*)
+
+let pr5758 x str =
+  match (x, str) with
+  | (1. , "A") -> "Matched A"
+  | (1.0, "B") -> "Matched B"
+  | (1. , "C") -> "Matched C"
+  | result ->
+    match result with
+    | (1., "A") -> "Failed match A then later matched"
+    | _ -> "Failed twice"
+;;
+
+let () =
+  test "pr5758" (pr5758 1.) "A" "Matched A"
+;;
index d48268db21c385e4410bde9585fb1a666f3351f8..b8348575844a495db33639e2c66eeb7fe60095b0 100644 (file)
@@ -24,4 +24,3 @@ Buffer.clear b;
 Buffer.add_substitute b identity pat1;
 test (String.length (Buffer.contents b) = n1)
 ;;
-
index e41ae649441c2e0aa0c872eb1de1f7eb246e1fd5..f0f683477f0e7ecfc43f87835df27e244a86df6c 100644 (file)
@@ -1,2 +1,2 @@
-0 1 
+ 0 1
 All tests succeeded.
index af0e3a2f417e305c55dac238a2736b0769369db3..8a7ab475cf646e09af412be73c61a277bbe02782 100644 (file)
@@ -2,11 +2,11 @@ open Random
 
 let _ =
   for i = 0 to 20 do
-    print_int (int 1000); print_char ' '
+    print_char ' '; print_int (int 1000);
   done;
   print_newline ();  print_newline ();
   for i = 0 to 20 do
-    print_float (float 1000.); print_char ' '
+    print_char ' '; print_float (float 1000.);
   done
 
 let _ = exit 0
index 366e682c15b311ebd949866863c23ee305d74b37..943addd1bd3de98506fd3cac92a4412ddc3204b9 100644 (file)
@@ -1,4 +1,4 @@
-344 685 182 641 439 500 104 20 921 370 217 885 949 678 615 412 401 606 428 869 289 
+ 344 685 182 641 439 500 104 20 921 370 217 885 949 678 615 412 401 606 428 869 289
 
-122.128067547 461.324792129 360.006556146 768.75882284 396.500946942 190.217751234 567.660068681 403.59226778 59.8488223602 363.816246826 764.705761642 172.627051105 481.861849093 399.173195422 629.424106752 391.547032203 676.701133948 174.382120878 994.425675487 585.00027757 34.3270777955 
+ 122.128067547 461.324792129 360.006556146 768.75882284 396.500946942 190.217751234 567.660068681 403.59226778 59.8488223602 363.816246826 764.705761642 172.627051105 481.861849093 399.173195422 629.424106752 391.547032203 676.701133948 174.382120878 994.425675487 585.00027757 34.3270777955
 All tests succeeded.
index 117423261c4dcc0024329da658bad4525b0625e1..819c5ba6930efcc7f50e10d380081d748260f90f 100644 (file)
@@ -1,2 +1,2 @@
-0 
+ 0
 All tests succeeded.
index 518859da2c3c39e681978707c63febec8f5080b6..8bbc9f71512455f064dd6453c7e8546a36d8dce9 100644 (file)
@@ -42,7 +42,7 @@ test (test1 ());;
 let test2 () = true
 (*  sprintf "%1$d\n" 5 1 = "    1\n" &&
   sprintf "%01$d\n" 5 1 = "00001\n" *);;
-  
+
 test (test2 ());;
 
 (* Testing meta format string printing. *)
index d804a0b893c1a65f116a4f363698b046ad9d6754..1fb209d42c16eeb499e7a079ba1be99944df9acc 100644 (file)
@@ -1,2 +1,2 @@
-0 1 2 3 4 5 
+ 0 1 2 3 4 5
 All tests succeeded.
index 8dcf116623b8b66e5f97a15221238008355b582b..a25e4ccd7dc2575f53ca4cc643751eecf26d97cc 100644 (file)
@@ -110,6 +110,17 @@ let test7 () =
   if a <> [|"a"; "a"; "a"; "a"; "a"; "b1"; "b1"; "b2"; "b3"; "a"|]
   then print_string "Test7: failed(2)\n"
 
+let test8 () =
+  (try
+    ignore (Array.sub [||] 0 1); print_string "Test 8.1: failed\n"
+  with Invalid_argument _ -> ());
+  (try
+    ignore (Array.sub [|3;4|] 1 (-1)); print_string "Test 8.2: failed\n"
+  with Invalid_argument _ -> ());
+  (try
+    ignore (Array.sub [|3;4|] max_int 1); print_string "Test 8.3: failed\n"
+  with Invalid_argument _ -> ())
+
 let _ =
   test1();
   test2();
@@ -118,4 +129,5 @@ let _ =
   test5();
   test6();
   test7();
+  test8();
   exit 0
index 6dd1773dcc169f14c111e11469bc97e2e9546d6b..a84e65dee9f6f31aabaf664ac2ddbaa0734c6ec0 100644 (file)
@@ -28,30 +28,30 @@ let test test_number answer correct_answer =
 module type TESTSIG = sig
   type t
   module Ops : sig
-    val neg: t -> t 
-    val add: t -> t -> t 
-    val sub: t -> t -> t 
-    val mul: t -> t -> t 
-    val div: t -> t -> t 
-    val rem: t -> t -> t 
-    val logand: t -> t -> t 
-    val logor: t -> t -> t 
-    val logxor: t -> t -> t 
-    val shift_left: t -> int -> t 
-    val shift_right: t -> int -> t 
-    val shift_right_logical: t -> int -> t 
-    val of_int: int -> t 
-    val to_int: t -> int 
-    val of_float: float -> t 
+    val neg: t -> t
+    val add: t -> t -> t
+    val sub: t -> t -> t
+    val mul: t -> t -> t
+    val div: t -> t -> t
+    val rem: t -> t -> t
+    val logand: t -> t -> t
+    val logor: t -> t -> t
+    val logxor: t -> t -> t
+    val shift_left: t -> int -> t
+    val shift_right: t -> int -> t
+    val shift_right_logical: t -> int -> t
+    val of_int: int -> t
+    val to_int: t -> int
+    val of_float: float -> t
     val to_float: t -> float
     val zero: t
     val one: t
     val minus_one: t
     val min_int: t
     val max_int: t
-    val format : string -> t -> string 
+    val format : string -> t -> string
     val to_string: t -> string
-    val of_string: string -> t 
+    val of_string: string -> t
   end
   val testcomp: t -> t -> bool*bool*bool*bool*bool*bool*int
   val skip_float_tests: bool
@@ -347,7 +347,7 @@ struct
     test 5 (add (of_int (-123)) (of_int 456)) (of_int 333);
     test 6 (add (of_int 123) (of_int (-456))) (of_int (-333));
     test 7 (add (of_int (-123)) (of_int (-456))) (of_int (-579));
-    test 8 (add (of_string "0x1234567812345678") 
+    test 8 (add (of_string "0x1234567812345678")
                 (of_string "0x9ABCDEF09ABCDEF"))
            (of_string "0x1be024671be02467");
     test 9 (add max_int max_int) (of_int (-2));
@@ -364,7 +364,7 @@ struct
     test 5 (sub (of_int (-123)) (of_int 456)) (of_int (-579));
     test 6 (sub (of_int 123) (of_int (-456))) (of_int 579);
     test 7 (sub (of_int (-123)) (of_int (-456))) (of_int 333);
-    test 8 (sub (of_string "0x1234567812345678") 
+    test 8 (sub (of_string "0x1234567812345678")
                 (of_string "0x9ABCDEF09ABCDEF"))
            (of_string "0x888888908888889");
     test 9 (sub max_int min_int) minus_one;
@@ -528,7 +528,7 @@ let _ =
   begin match Sys.word_size with
     32 ->
       let module C =
-        Test32(struct type t = nativeint 
+        Test32(struct type t = nativeint
                       module Ops = Nativeint
                       let testcomp = testcomp_nativeint
                       let skip_float_tests = true end)
@@ -537,7 +537,7 @@ let _ =
       let module C =
         Test64(struct type t = nativeint
                       module Ops = Nativeint
-                      let testcomp = testcomp_nativeint 
+                      let testcomp = testcomp_nativeint
                       let skip_float_tests = true end)
       in ()
   | _ ->
index f69120c9ac80d6c25d3fd05b6840d124e59ad757..ebf5cf438bb3da16069f595008ccb6633e7c3c4f 100644 (file)
@@ -102,4 +102,3 @@ let _ =
   test 53 eqtrue (testcmpfloat 0.0 0.0);
   test 54 eqtrue (testcmpfloat 1.0 0.0);
   test 55 eqtrue (testcmpfloat 0.0 1.0)
-
index 182272c1ba5d368d3522aef617d4a7dd3f58e9cc..15708bf970521539fa83b7caab3fe9de1ae725ed 100644 (file)
@@ -65,7 +65,7 @@ module D =
     include F(struct end)
     let test() = print_t A; print_newline(); print_t (B 42); print_newline()
   end
-    
+
 let _ =
   D.test();
   D.print_t D.A; print_newline(); D.print_t (D.B 42); print_newline()
@@ -89,4 +89,3 @@ module G =
 let _ =
   begin try raise (G.Exn "foo") with G.Exn s -> print_string s end;
   print_int ((new G.c)#m); print_newline()
-
index 932ecbe7ae2919d75016665ee280f208829f65c1..deb86c43328c6d331c9d51de04cbd20e647bd651 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: maps.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: maps.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 module IntMap = Map.Make(struct type t = int let compare x y = x-y end)
 
@@ -25,4 +25,3 @@ let () =
   print_endline "Inter";
   show (IntMap.merge (fun _ l r -> match l, r with Some x, Some y when x = y -> Some x | _ -> None) m1 m2);
   ()
-
index 1cc37c1c67e1067c4b467112b8b3b06ac3e74970..64e56174e001b6c9a8e0e7941252848165dd18cb 100644 (file)
@@ -91,7 +91,7 @@ let _ =
   done;
   for i = 0 to 255 do
     let c = Char.chr i in
-    printf "k(%s) = %s\t" (escaped c) (k c)
+    printf "\tk(%s) = %s" (escaped c) (k c)
   done;
   printf "\n";
   printf "p([|\"hello\"|]) = %s\n" (p [|"hello"|]);
@@ -103,6 +103,3 @@ let _ =
   printf "l([|2;3|]) = %d\n" (l [|2;3|]);
   printf "l([|4;5;6|]) = %d\n" (l [|4;5;6|]);
   exit 0
-
-
-
index eb7dc978869bac5f06807da8904654e1856593fb..125c466fd13264bc33a3b069d0ed21dc9903bc92 100644 (file)
@@ -57,7 +57,7 @@ h({) = ?
 h(|) = ?
 h(}) = ?
 h(~) = ?
-k(\000) = othr k(\001) = othr  k(\002) = othr  k(\003) = othr  k(\004) = othr  k(\005) = othr  k(\006) = othr  k(\007) = othr  k(\b) = othr    k(\t) = blk     k(\n) = blk     k(\011) = othr  k(\012) = othr  k(\r) = blk     k(\014) = othr  k(\015) = othr  k(\016) = othr  k(\017) = othr  k(\018) = othr  k(\019) = othr  k(\020) = othr  k(\021) = othr  k(\022) = othr  k(\023) = othr  k(\024) = othr  k(\025) = othr  k(\026) = othr  k(\027) = othr  k(\028) = othr  k(\029) = othr  k(\030) = othr  k(\031) = othr  k( ) = blk      k(!) = oper     k(\034) = othr  k(#) = oper     k($) = oper     k(%) = oper     k(&) = oper     k(\') = othr    k(\040) = othr  k(\041) = othr  k(*) = oper     k(+) = oper     k(\044) = othr  k(\045) = othr  k(\046) = othr  k(/) = oper     k(0) = dig      k(1) = dig      k(2) = dig      k(3) = dig      k(4) = dig      k(5) = dig      k(6) = dig      k(7) = dig      k(8) = dig      k(9) = dig      k(:) = oper     k(\059) = othr  k(<) = oper     k(=) = oper     k(>) = oper     k(?) = oper     k(@) = oper     k(A) = letr     k(B) = letr     k(C) = letr     k(D) = letr     k(E) = letr     k(F) = letr     k(G) = letr     k(H) = letr     k(I) = letr     k(J) = letr     k(K) = letr     k(L) = letr     k(M) = letr     k(N) = letr     k(O) = letr     k(P) = letr     k(Q) = letr     k(R) = letr     k(S) = letr     k(T) = letr     k(U) = letr     k(V) = letr     k(W) = letr     k(X) = letr     k(Y) = letr     k(Z) = letr     k(\091) = othr  k(\\) = oper    k(\093) = othr  k(^) = oper     k(\095) = othr  k(\096) = othr  k(a) = letr     k(b) = letr     k(c) = letr     k(d) = letr     k(e) = letr     k(f) = letr     k(g) = letr     k(h) = letr     k(i) = letr     k(j) = letr     k(k) = letr     k(l) = letr     k(m) = letr     k(n) = letr     k(o) = letr     k(p) = letr     k(q) = letr     k(r) = letr     k(s) = letr     k(t) = letr     k(u) = letr     k(v) = letr     k(w) = letr     k(x) = letr     k(y) = letr     k(z) = letr     k(\123) = othr  k(|) = oper     k(\125) = othr  k(~) = oper     k(\127) = othr  k(\128) = othr  k(\129) = othr  k(\130) = othr  k(\131) = othr  k(\132) = othr  k(\133) = othr  k(\134) = othr  k(\135) = othr  k(\136) = othr  k(\137) = othr  k(\138) = othr  k(\139) = othr  k(\140) = othr  k(\141) = othr  k(\142) = othr  k(\143) = othr  k(\144) = othr  k(\145) = othr  k(\146) = othr  k(\147) = othr  k(\148) = othr  k(\149) = othr  k(\150) = othr  k(\151) = othr  k(\152) = othr  k(\153) = othr  k(\154) = othr  k(\155) = othr  k(\156) = othr  k(\157) = othr  k(\158) = othr  k(\159) = othr  k(\160) = othr  k(\161) = othr  k(\162) = othr  k(\163) = othr  k(\164) = othr  k(\165) = othr  k(\166) = othr  k(\167) = othr  k(\168) = othr  k(\169) = othr  k(\170) = othr  k(\171) = othr  k(\172) = othr  k(\173) = othr  k(\174) = othr  k(\175) = othr  k(\176) = othr  k(\177) = othr  k(\178) = othr  k(\179) = othr  k(\180) = othr  k(\181) = othr  k(\182) = othr  k(\183) = othr  k(\184) = othr  k(\185) = othr  k(\186) = othr  k(\187) = othr  k(\188) = othr  k(\189) = othr  k(\190) = othr  k(\191) = othr  k(\192) = letr  k(\193) = letr  k(\194) = letr  k(\195) = letr  k(\196) = letr  k(\197) = letr  k(\198) = letr  k(\199) = letr  k(\200) = letr  k(\201) = letr  k(\202) = letr  k(\203) = letr  k(\204) = letr  k(\205) = letr  k(\206) = letr  k(\207) = letr  k(\208) = letr  k(\209) = letr  k(\210) = letr  k(\211) = letr  k(\212) = letr  k(\213) = letr  k(\214) = letr  k(\215) = letr  k(\216) = letr  k(\217) = letr  k(\218) = letr  k(\219) = letr  k(\220) = letr  k(\221) = letr  k(\222) = letr  k(\223) = letr  k(\224) = letr  k(\225) = letr  k(\226) = letr  k(\227) = letr  k(\228) = letr  k(\229) = letr  k(\230) = letr  k(\231) = letr  k(\232) = letr  k(\233) = letr  k(\234) = letr  k(\235) = letr  k(\236) = letr  k(\237) = letr  k(\238) = letr  k(\239) = letr  k(\240) = letr  k(\241) = letr  k(\242) = letr  k(\243) = letr  k(\244) = letr  k(\245) = letr  k(\246) = letr  k(\247) = letr  k(\248) = letr  k(\249) = letr  k(\250) = letr  k(\251) = letr  k(\252) = letr  k(\253) = letr  k(\254) = letr  k(\255) = letr  
+       k(\000) = othr  k(\001) = othr  k(\002) = othr  k(\003) = othr  k(\004) = othr  k(\005) = othr  k(\006) = othr  k(\007) = othr  k(\b) = othr    k(\t) = blk     k(\n) = blk     k(\011) = othr  k(\012) = othr  k(\r) = blk     k(\014) = othr  k(\015) = othr  k(\016) = othr  k(\017) = othr  k(\018) = othr  k(\019) = othr  k(\020) = othr  k(\021) = othr  k(\022) = othr  k(\023) = othr  k(\024) = othr  k(\025) = othr  k(\026) = othr  k(\027) = othr  k(\028) = othr  k(\029) = othr  k(\030) = othr  k(\031) = othr  k( ) = blk      k(!) = oper     k(\034) = othr  k(#) = oper     k($) = oper     k(%) = oper     k(&) = oper     k(\') = othr    k(\040) = othr  k(\041) = othr  k(*) = oper     k(+) = oper     k(\044) = othr  k(\045) = othr  k(\046) = othr  k(/) = oper     k(0) = dig      k(1) = dig      k(2) = dig      k(3) = dig      k(4) = dig      k(5) = dig      k(6) = dig      k(7) = dig      k(8) = dig      k(9) = dig      k(:) = oper     k(\059) = othr  k(<) = oper     k(=) = oper     k(>) = oper     k(?) = oper     k(@) = oper     k(A) = letr     k(B) = letr     k(C) = letr     k(D) = letr     k(E) = letr     k(F) = letr     k(G) = letr     k(H) = letr     k(I) = letr     k(J) = letr     k(K) = letr     k(L) = letr     k(M) = letr     k(N) = letr     k(O) = letr     k(P) = letr     k(Q) = letr     k(R) = letr     k(S) = letr     k(T) = letr     k(U) = letr     k(V) = letr     k(W) = letr     k(X) = letr     k(Y) = letr     k(Z) = letr     k(\091) = othr  k(\\) = oper    k(\093) = othr  k(^) = oper     k(\095) = othr  k(\096) = othr  k(a) = letr     k(b) = letr     k(c) = letr     k(d) = letr     k(e) = letr     k(f) = letr     k(g) = letr     k(h) = letr     k(i) = letr     k(j) = letr     k(k) = letr     k(l) = letr     k(m) = letr     k(n) = letr     k(o) = letr     k(p) = letr     k(q) = letr     k(r) = letr     k(s) = letr     k(t) = letr     k(u) = letr     k(v) = letr     k(w) = letr     k(x) = letr     k(y) = letr     k(z) = letr     k(\123) = othr  k(|) = oper     k(\125) = othr  k(~) = oper     k(\127) = othr  k(\128) = othr  k(\129) = othr  k(\130) = othr  k(\131) = othr  k(\132) = othr  k(\133) = othr  k(\134) = othr  k(\135) = othr  k(\136) = othr  k(\137) = othr  k(\138) = othr  k(\139) = othr  k(\140) = othr  k(\141) = othr  k(\142) = othr  k(\143) = othr  k(\144) = othr  k(\145) = othr  k(\146) = othr  k(\147) = othr  k(\148) = othr  k(\149) = othr  k(\150) = othr  k(\151) = othr  k(\152) = othr  k(\153) = othr  k(\154) = othr  k(\155) = othr  k(\156) = othr  k(\157) = othr  k(\158) = othr  k(\159) = othr  k(\160) = othr  k(\161) = othr  k(\162) = othr  k(\163) = othr  k(\164) = othr  k(\165) = othr  k(\166) = othr  k(\167) = othr  k(\168) = othr  k(\169) = othr  k(\170) = othr  k(\171) = othr  k(\172) = othr  k(\173) = othr  k(\174) = othr  k(\175) = othr  k(\176) = othr  k(\177) = othr  k(\178) = othr  k(\179) = othr  k(\180) = othr  k(\181) = othr  k(\182) = othr  k(\183) = othr  k(\184) = othr  k(\185) = othr  k(\186) = othr  k(\187) = othr  k(\188) = othr  k(\189) = othr  k(\190) = othr  k(\191) = othr  k(\192) = letr  k(\193) = letr  k(\194) = letr  k(\195) = letr  k(\196) = letr  k(\197) = letr  k(\198) = letr  k(\199) = letr  k(\200) = letr  k(\201) = letr  k(\202) = letr  k(\203) = letr  k(\204) = letr  k(\205) = letr  k(\206) = letr  k(\207) = letr  k(\208) = letr  k(\209) = letr  k(\210) = letr  k(\211) = letr  k(\212) = letr  k(\213) = letr  k(\214) = letr  k(\215) = letr  k(\216) = letr  k(\217) = letr  k(\218) = letr  k(\219) = letr  k(\220) = letr  k(\221) = letr  k(\222) = letr  k(\223) = letr  k(\224) = letr  k(\225) = letr  k(\226) = letr  k(\227) = letr  k(\228) = letr  k(\229) = letr  k(\230) = letr  k(\231) = letr  k(\232) = letr  k(\233) = letr  k(\234) = letr  k(\235) = letr  k(\236) = letr  k(\237) = letr  k(\238) = letr  k(\239) = letr  k(\240) = letr  k(\241) = letr  k(\242) = letr  k(\243) = letr  k(\244) = letr  k(\245) = letr  k(\246) = letr  k(\247) = letr  k(\248) = letr  k(\249) = letr  k(\250) = letr  k(\251) = letr  k(\252) = letr  k(\253) = letr  k(\254) = letr  k(\255) = letr
 p([|"hello"|]) = hello
 p([|1.0|]) = 1.000000
 q([|2|]) = 2
index c00ced8273550d4212cfde2a79fe47cfaca498d8..df32f5e702d6bf7901f9431b01a53862a0eb4874 100644 (file)
@@ -8,7 +8,7 @@ let _ =
   then print_string "Test 1: passed\n"
   else print_string "Test 1: FAILED\n";
   let one = 1 in
-  let rec y = (one, one+1) :: y in  
+  let rec y = (one, one+1) :: y in
   if match y with
        (1,2) :: y' -> y == y'
      | _ -> false
index 23b73535985eb204dff08184bdc380691b481fd0..7e37ea714cc995db000c0c1757e322f2953a5b7d 100644 (file)
@@ -18,7 +18,7 @@ let indtailcall8 fn a b c d e f g h =
   fn a b c d e f g h
 
 let indtailcall16 fn a b c d e f g h i j k l m n o p =
-  fn a b c d e f g h i j k l m n o p 
+  fn a b c d e f g h i j k l m n o p
 
 let _ =
   print_int (tailcall4 10000000 0 0 0); print_newline();
index a89056685a5b77ee4280529f131495d628e004a8..0db946a1ed120990a40b2a4479c61e113156b886 100644 (file)
@@ -12,7 +12,7 @@ run-byte: common
        @$(OCAMLC) -c tcallback.ml
        @$(OCAMLC) -o ./program -custom unix.cma callbackprim.$(O) tcallback.cmo
        @./program > bytecode.result
-       @$(DIFF) reference bytecode.result || (echo " => failed" && exit 1) 
+       @$(DIFF) reference bytecode.result || (echo " => failed" && exit 1)
        @echo " => passed"
 
 run-opt: common
@@ -24,7 +24,7 @@ run-opt: common
          $(DIFF) reference native.result || (echo " => failed" && exit 1); \
          echo " => passed"; \
        fi
-       
+
 promote: defaultpromote
 
 clean: defaultclean
index 32914119bdc85b9e46728986ca40cb54a86c7c72..e0f66fe506b854348d80801278a948ffe02321e6 100644 (file)
@@ -65,4 +65,3 @@ let _ =
   print_string(tripwire mycamlparam); print_newline();
   Sys.set_signal Sys.sigusr1 (Sys.Signal_handle sighandler);
   print_string(callbacksig ()); print_newline()
-
index ed3314346114740b9a2c202e17d84c31129ef67f..ec2308dd7dc4b05d3b895bf430a434e95d44cb26 100644 (file)
@@ -13,7 +13,7 @@ run:
        @./program > program.result
        @$(DIFF) program.reference program.result > /dev/null || (echo " => failed" && exit 1)
        @echo " => passed"
-       
+
 promote: defaultpromote
 
 clean: defaultclean
index f58fff1cc303e55c18a59ddc3b97f8f6aa9515f7..32a61a7cceed3832770596e9b801783e0f59c6a7 100644 (file)
@@ -52,5 +52,3 @@ value gb_generational_remove(value vblock)
   caml_remove_generational_global_root(&(Block_val(vblock)->v));
   return Val_unit;
 }
-
-
index 5c2462c2efa10e1c98615976feacaa61894cc839..ff52de1d9fa586614dcee39c2f185ef1468731fc 100644 (file)
@@ -24,4 +24,3 @@
  300      format(/1X, I3, 2X, 10F6.1/)
  200   continue
        end
-
index c915622840ee65e4655606dfaa6c82f6b15211b0..562cfc8a74e41e93c9e03cb097d2545bf8526d34 100644 (file)
@@ -60,4 +60,3 @@ let _ =
   test 2 a.{2,1} 201.0;
   test 3 a.{1,2} 102.0;
   test 4 a.{5,4} 504.0;
-
index 87bd67b7bc46d0e11f4a97ee1429ed9d5c0ce09f..be142f6a9210ae05c961ae0f3b0b2a8a4ec913fb 100644 (file)
@@ -57,4 +57,3 @@ value fortran_printtab(value ba)
   printtab_(Data_bigarray_val(ba), &dimx, &dimy);
   return Val_unit;
 }
-
index 85901400eb56162a478baad4d0da80d29b740578..9c790a1a6a03030b11678bcd2f4c869bebc9a23c 100644 (file)
@@ -139,14 +139,14 @@ let _ =
   let from_list kind vals =
     let a = Array1.create kind c_layout (List.length vals) in
     let rec set i = function
-        [] -> () 
+        [] -> ()
       | hd :: tl -> a.{i} <- hd; set (i+1) tl in
     set 0 vals;
     a in
   let from_list_fortran kind vals =
     let a = Array1.create kind fortran_layout (List.length vals) in
     let rec set i = function
-        [] -> () 
+        [] -> ()
       | hd :: tl -> a.{i} <- hd; set (i+1) tl in
     set 1 vals;
     a in
@@ -157,7 +157,7 @@ let _ =
   for i = 0 to 2 do test (i+1) a.{i} i done;
   test 4 true (try ignore a.{3}; false with Invalid_argument _ -> true);
   test 5 true (try ignore a.{-1}; false with Invalid_argument _ -> true);
-    
+
   let b = Array1.create float64 fortran_layout 3 in
   for i = 1 to 3 do b.{i} <- float i done;
   for i = 1 to 3 do test (5 + i) b.{i} (float i) done;
@@ -180,7 +180,7 @@ let _ =
   let a = Array1.create int c_layout 3 in
   for i = 0 to 2 do Array1.unsafe_set a i i done;
   for i = 0 to 2 do test (i+1) (Array1.unsafe_get a i) i done;
-    
+
   let b = Array1.create float64 fortran_layout 3 in
   for i = 1 to 3 do Array1.unsafe_set b i (float i) done;
   for i = 1 to 3 do test (5 + i) (Array1.unsafe_get b i) (float i) done;
@@ -459,7 +459,7 @@ let _ =
   test 3 true (try ignore a.{-1,0}; false with Invalid_argument _ -> true);
   test 4 true (try ignore a.{0,3}; false with Invalid_argument _ -> true);
   test 5 true (try ignore a.{0,-1}; false with Invalid_argument _ -> true);
-    
+
   let b = Array2.create float32 fortran_layout 3 3 in
   for i = 1 to 3 do for j = 1 to 3 do b.{i,j} <- float(i-j) done done;
   let ok = ref true in
@@ -480,7 +480,7 @@ let _ =
     for j = 0 to 2 do if Array2.unsafe_get a i j <> i-j then ok := false done
   done;
   test 1 true !ok;
-    
+
   let b = Array2.create float32 fortran_layout 3 3 in
   for i = 1 to 3 do for j = 1 to 3 do Array2.unsafe_set b i j (float(i-j)) done done;
   let ok = ref true in
@@ -611,7 +611,7 @@ let _ =
      if Int32.to_int a.{i,j,k} <> (i lsl 4) + (j lsl 2) + k then ok := false
   done done done;
   test 1 true !ok;
-    
+
   let b = Array3.create int64 fortran_layout 2 3 4 in
   for i = 1 to 2 do for j = 1 to 3 do for k = 1 to 4 do
      b.{i,j,k} <- Int64.of_int((i lsl 4) + (j lsl 2) + k)
@@ -764,7 +764,7 @@ let _ =
   Sys.remove mapped_file;
 
   ()
-                  
+
 (********* End of test *********)
 
 let _ =
index bd010e924db6390c4ae71202ddd2b6784cca067d..f9c62500ef69c3df4397eba7859bfd52a63eb72c 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: fftba.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: fftba.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Bigarray
 
@@ -22,17 +22,17 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
         (py : (float, float64_elt, c_layout) Array1.t) np =
   let i = ref 2 in
   let m = ref 1 in
-  
+
   while (!i < np) do
-    i := !i + !i; 
+    i := !i + !i;
     m := !m + 1
   done;
 
-  let n = !i in  
-  
+  let n = !i in
+
   if n <> np then begin
     for i = np+1 to n do
-      px.{i} <- 0.0; 
+      px.{i} <- 0.0;
       py.{i} <- 0.0
     done;
     print_string "Use "; print_int n;
@@ -41,7 +41,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
 
   let n2 = ref(n+n) in
   for k = 1 to !m-1 do
-    n2 := !n2 / 2; 
+    n2 := !n2 / 2;
     let n4 = !n2 / 4 in
     let e  = tpi /. float !n2 in
 
@@ -54,7 +54,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
       let ss3 = sin(a3) in
       let is = ref j in
       let id = ref(2 * !n2) in
-  
+
         while !is < n do
           let i0r = ref !is in
           while !i0r < n do
@@ -74,13 +74,13 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
              let r1 = r1 +. s2 in
              let s2 = r2 -. s1 in
              let r2 = r2 +. s1 in
-             px.{i2} <- r1*.cc1 -. s2*.ss1; 
+             px.{i2} <- r1*.cc1 -. s2*.ss1;
              py.{i2} <- -.s2*.cc1 -. r1*.ss1;
              px.{i3} <- s3*.cc3 +. r2*.ss3;
              py.{i3} <- r2*.cc3 -. s3*.ss3;
              i0r := i0 + !id
           done;
-          is := 2 * !id - !n2 + j; 
+          is := 2 * !id - !n2 + j;
           id := 4 * !id
         done
     done
@@ -92,7 +92,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
 
   let is = ref 1 in
   let id = ref 4 in
-  
+
   while !is < n do
     let i0r = ref !is in
     while !i0r <= n do
@@ -106,7 +106,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
       py.{i1} <- r1 -. py.{i1};
       i0r := i0 + !id
     done;
-    is := 2 * !id - 1; 
+    is := 2 * !id - 1;
     id := 4 * !id
   done;
 
@@ -115,11 +115,11 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
 (*************************)
 
   let j = ref 1 in
-  
+
   for i = 1 to n - 1 do
     if i < !j then begin
       let xt = px.{!j} in
-      px.{!j} <- px.{i}; 
+      px.{!j} <- px.{i};
       px.{i} <- xt;
       let xt = py.{!j} in
       py.{!j} <- py.{i};
@@ -127,7 +127,7 @@ let fft (px : (float, float64_elt, c_layout) Array1.t)
     end;
     let k = ref(n / 2) in
     while !k < !j do
-      j := !j - !k; 
+      j := !j - !k;
       k := !k / 2
     done;
     j := !j + !k
@@ -173,12 +173,12 @@ let test np =
   for i = 0 to np-1 do
       let a = abs_float(pxr.{i+1} -. float i) in
       if !zr < a then begin
-         zr := a; 
+         zr := a;
          kr := i
       end;
       let a = abs_float(pxi.{i+1}) in
       if !zi < a then begin
-         zi := a; 
+         zi := a;
          ki := i
       end
   done;
@@ -194,4 +194,3 @@ let test np =
 
 let _ =
   let np = ref 16 in for i = 1 to 13 do test !np; np := !np*2 done
-
index 69cdca64d9096c365736e626a7e5f4150d2e5ce7..e75215cf75c26a3f8ba88d9452edd8e693067755 100644 (file)
@@ -10,4 +10,3 @@ let _ =
   let y = Array1.of_array float64 fortran_layout [| 1. |] in
   (f y).{1};
   (f y).{1} <- 3.14
-
index 53e9f4692f35dc6f19c802c5d09ef743621a7261..089d17a5c4150b57e4471ae2dbb9380df93826de 100644 (file)
@@ -32,7 +32,7 @@ run:
        @export LD_LIBRARY_PATH=`pwd` && ./custom > custom.result
        @$(DIFF) custom.reference custom.result > /dev/null || (echo " => failed" && exit 1)
        @echo " => passed"
-       
+
 promote: defaultpromote
 
 clean: defaultclean
index b79504287d449a2f66244dc6439eaaf0f9b5ad08..725ee80c9d7ccdb2372a77eeb1a29bdcd32ce901 100644 (file)
@@ -8,17 +8,17 @@ let _ =
   for i = 1 to Array.length Sys.argv - 1 do
     let name = Sys.argv.(i) in
     Printf.printf "Loading %s\n" name; flush stdout;
-    try 
+    try
       if name.[0] = '-'
-      then Dynlink.loadfile_private 
-       (String.sub name 1 (String.length name - 1))
+      then Dynlink.loadfile_private
+        (String.sub name 1 (String.length name - 1))
       else Dynlink.loadfile name
     with
       | Dynlink.Error err ->
-         Printf.printf "Dynlink error: %s\n" 
-           (Dynlink.error_message err)
+          Printf.printf "Dynlink error: %s\n"
+            (Dynlink.error_message err)
       | exn ->
-         Printf.printf "Error: %s\n" (Printexc.to_string exn)
+          Printf.printf "Error: %s\n" (Printexc.to_string exn)
   done;
   flush stdout;
   try
index fd48914a6ff35295beaf54afc3289082fb2fea50..ad4618827798ef9cd2047485ddd937adf139b34d 100755 (executable)
@@ -17,7 +17,6 @@ let () =
       "../../../otherlibs/bigarray/bigarray.cma",
       "plugin.cmo"
   in
-  load s1; 
+  load s1;
   load s2;
   print_endline "OK."
-
index 39c46f3a1c834b344342c1a581a61d61b65bc520..aacf9f21bcf29d08effb18cbefa225bb06f0e5d7 100755 (executable)
@@ -1,4 +1,4 @@
 let f x = x.{2}
-  
+
 let () =
   print_endline "I'm the plugin."
index 304ee1f1f0aa80d8fef8e4a56aaf6e4752022e10..cd735abe3acbcc44cad553cebeb1672ca306fc84 100644 (file)
@@ -1,7 +1,7 @@
 let mods = ref []
 
 let reg_mod name =
-  if List.mem name !mods then 
+  if List.mem name !mods then
     Printf.printf "Reloading module %s\n" name
   else (
     mods := name :: !mods;
index 58149e22f157337b07ff0e0fb9a02c33158b01d6..afa1bef05186b5be93bcd92b26375ebf5afcd6d4 100755 (executable)
@@ -2,4 +2,3 @@ let () =
   print_endline "B is running";
   incr A.x;
   Printf.printf "A.x = %i\n" !A.x
-
index 02828378d0b023420cae5fc933784bd17f31976b..31c0f02595a210c1c7515654a9af12378f77ff99 100644 (file)
@@ -1,2 +1,2 @@
-let () = try raise (Invalid_argument "X") with Invalid_argument s -> 
+let () = try raise (Invalid_argument "X") with Invalid_argument s ->
   raise (Invalid_argument (s ^ s))
index 04b3aef7bb51717c9393bcd43a92f6d926c62ab4..8c738aeb70cb23d25f97827f609f7a3e3142d476 100644 (file)
@@ -7,17 +7,17 @@ let ()  =
   for i = 1 to Array.length Sys.argv - 1 do
     let name = Sys.argv.(i) in
     Printf.printf "Loading %s\n" name; flush stdout;
-    try 
+    try
       if name.[0] = '-'
-      then Dynlink.loadfile_private 
-       (String.sub name 1 (String.length name - 1))
+      then Dynlink.loadfile_private
+        (String.sub name 1 (String.length name - 1))
       else Dynlink.loadfile name
     with
       | Dynlink.Error err ->
-         Printf.printf "Dynlink error: %s\n" 
-           (Dynlink.error_message err)
+          Printf.printf "Dynlink error: %s\n"
+            (Dynlink.error_message err)
       | exn ->
-         Printf.printf "Error: %s\n" (Printexc.to_string exn)
+          Printf.printf "Error: %s\n" (Printexc.to_string exn)
   done;
   flush stdout;
   try
@@ -30,6 +30,3 @@ let ()  =
     List.iter (fun f -> f()) l
   with Failure s ->
     Printf.printf "Failure: %s\n" s
-
-
-
index 8f00e39dab2ebb1b08aec79e965c7aa2880085ce..2ee8363391e764ceee59aa8f8033bd5240721e4d 100644 (file)
@@ -3,4 +3,3 @@ let () =
 
 let bla = Sys.argv.(0) ^ "XXX"
 let mykey = Sys.argv.(0)
-
index f307b4f11c934c009f37eceb9e7d313edddb3d3d..d9b0574f1bdb8053ff4b24498ee13ed83909ec45 100644 (file)
@@ -7,5 +7,5 @@ let facts = [ fact 1; fact 2; fact 3; fact (Random.int 4) ]
 let () =
   Api.reg_mod "Plugin";
   Api.add_cb (fun () -> print_endline "Callback from plugin");
-  print_endline "COUCOU"; 
+  print_endline "COUCOU";
   ()
index ccf4642fbbff62686e508d49bfc8959fdcb4b2c3..a9f86e60a220a09b232a16e0856a355c93230d35 100644 (file)
@@ -1,5 +1,3 @@
 let () =
   Printf.printf "time = %f\n" (Unix.time ());
   Api.reg_mod "Plugin"
-
-
index 06001241c61160ca9a9ce80c5f3b4b8d57056737..60f127357c18c694e5f80e172e81854489c00d1e 100644 (file)
@@ -2,10 +2,9 @@ let x = ref 0
 
 let () =
   Api.reg_mod "Plugin_ref";
-  
-  Api.add_cb 
+
+  Api.add_cb
     (fun () ->
        Printf.printf "current value for ref = %i\n" !x;
        incr x
     )
-  
index a66b958f2bfe7b33500204325c190b8f306e610c..6e3d9d485a62fcbc437f933219950a296d050961 100644 (file)
@@ -1,21 +1,15 @@
 let () =
   Api.reg_mod "Plugin_thread";
   let _t =
-    Thread.create 
+    Thread.create
       (fun () ->
-        for i = 1 to 5 do
-          print_endline "Thread"; flush stdout;
-          Thread.delay 1.;
-        done
+         for i = 1 to 5 do
+           print_endline "Thread"; flush stdout;
+           Thread.delay 1.;
+         done
       ) ()
   in
   for i = 1 to 10 do
     print_endline "Thread"; flush stdout;
     Thread.delay 0.50;
   done
-
-
-
-
-
-
index 2a41493c04e3e6a9ff3f16619d95fc969543128a..d7faf9c8e276b89276426599a51c4ac4c7bbf633 100644 (file)
@@ -4,4 +4,3 @@ let facts = [ fact 1; fact 2; fact 3; fact 4; fact 5 ]
 
 let () =
   Api.reg_mod "Plugin'"
-
index 7b0b099fe79ecc2f358bc38a212195af8ea24aec..82c9e4866ec3f1a6156c25b2ee68fd3ceef98fb4 100644 (file)
@@ -1,3 +1,2 @@
 let () =
   ignore (Api.f 10)
-
index 5699587cef76082aea30b4764026348671bcc5f6..8b8205e7b2bb0b07d9ca794f1a9f0b49122f31cd 100644 (file)
@@ -39,12 +39,3 @@ let _ =
   printf "[10..0]\t\t%08x\n" (Hashtbl.hash [10;9;8;7;6;5;4;3;2;1;0]);
 
   ()
-
-
-
-
-
-
-
-
-  
index 6bed1fd5e8152c57fdf91c07020b969a97b95ffe..f58156962c50e836cb497787f106c2bbf5dd6f88 100644 (file)
@@ -190,4 +190,3 @@ let _ =
   TSP.test (pair_data d);
   printf "-- Lists of strings\n%!";
   TSL.test (list_data d)
-
index af59734b20180a6a7b73d7cd81d8b04de642f971..80fe5b77045b062a3e5b19a84efece52828d7a22 100644 (file)
@@ -447,7 +447,7 @@ let test_deep () =
   test 426 (Marshal.from_string s 0 = x)
 
 (* Test for objects *)
-class foo = object (self : 'self) 
+class foo = object (self : 'self)
   val data1 = "foo"
   val data2 = "bar"
   val data3 = 42L
@@ -462,11 +462,11 @@ class bar = object (self : 'self)
   val! data2 = "test5"
   val data4 = "test3"
   val data5 = "test4"
-  method test1 = 
-    data1 
-  ^ data2 
-  ^ data4 
-  ^ data5 
+  method test1 =
+    data1
+  ^ data2
+  ^ data4
+  ^ data5
   ^ Int64.to_string self#test4
 end
 
@@ -523,7 +523,7 @@ let test_infix () =
   test 605 (even' 41 = even 41);
   test 606 (even' 142 = true);
   test 607 (even' 142 = even 142)
-  
+
 let main() =
   if Array.length Sys.argv <= 2 then begin
     test_out "intext.data"; test_in "intext.data";
index 9225b90bc28a9a78e97c45efe3b6a40f8a411fb9..fca1fb385d5d1aa4043083cf29aa70214ef8723f 100644 (file)
@@ -3,7 +3,7 @@
 
 value marshal_to_block(value vbuf, value vlen, value v, value vflags)
 {
-  return Val_long(output_value_to_block(v, vflags, 
+  return Val_long(output_value_to_block(v, vflags,
                                         (char *) vbuf, Long_val(vlen)));
 }
 
index badc52160148fd8cd96ddfc2f617a43d5181005a..9d7262060b9873648ac093ae92835bfca555bb97 100644 (file)
@@ -56,52 +56,52 @@ testing_function "add_big_int";;
 test 1
 eq_big_int (add_big_int zero_big_int zero_big_int, zero_big_int);;
 test 2
-eq_big_int (add_big_int zero_big_int (big_int_of_int 1), 
+eq_big_int (add_big_int zero_big_int (big_int_of_int 1),
             big_int_of_int 1);;
 test 3
-eq_big_int (add_big_int (big_int_of_int 1) zero_big_int, 
+eq_big_int (add_big_int (big_int_of_int 1) zero_big_int,
             big_int_of_int 1);;
 test 4
-eq_big_int (add_big_int zero_big_int (big_int_of_int (-1)), 
+eq_big_int (add_big_int zero_big_int (big_int_of_int (-1)),
             big_int_of_int (-1));;
 test 5
-eq_big_int (add_big_int (big_int_of_int (-1)) zero_big_int, 
+eq_big_int (add_big_int (big_int_of_int (-1)) zero_big_int,
             big_int_of_int (-1));;
 test 6
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 1), 
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 1),
             big_int_of_int 2);;
 test 7
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 2), 
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int 2),
             big_int_of_int 3);;
 test 8
-eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int 1), 
+eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int 1),
             big_int_of_int 3);;
 test 9
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-1)), 
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-1)),
             big_int_of_int (-2));;
 test 10
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-2)), 
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int (-2)),
             big_int_of_int (-3));;
 test 11
-eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int (-1)), 
+eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int (-1)),
             big_int_of_int (-3));;
 test 12
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-1)), 
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-1)),
             zero_big_int);;
 test 13
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 1), 
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 1),
             zero_big_int);;
 test 14
-eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-2)), 
+eq_big_int (add_big_int (big_int_of_int 1) (big_int_of_int (-2)),
             big_int_of_int (-1));;
 test 15
-eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int 1), 
+eq_big_int (add_big_int (big_int_of_int (-2)) (big_int_of_int 1),
             big_int_of_int (-1));;
 test 16
-eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 2), 
+eq_big_int (add_big_int (big_int_of_int (-1)) (big_int_of_int 2),
             big_int_of_int 1);;
 test 17
-eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int (-1)), 
+eq_big_int (add_big_int (big_int_of_int 2) (big_int_of_int (-1)),
             big_int_of_int 1);;
 
 
@@ -110,52 +110,52 @@ testing_function "sub_big_int";;
 test 1
 eq_big_int (sub_big_int zero_big_int zero_big_int, zero_big_int);;
 test 2
-eq_big_int (sub_big_int zero_big_int (big_int_of_int 1), 
+eq_big_int (sub_big_int zero_big_int (big_int_of_int 1),
             big_int_of_int (-1));;
 test 3
-eq_big_int (sub_big_int (big_int_of_int 1) zero_big_int, 
+eq_big_int (sub_big_int (big_int_of_int 1) zero_big_int,
             big_int_of_int 1);;
 test 4
-eq_big_int (sub_big_int zero_big_int (big_int_of_int (-1)), 
+eq_big_int (sub_big_int zero_big_int (big_int_of_int (-1)),
             big_int_of_int 1);;
 test 5
-eq_big_int (sub_big_int (big_int_of_int (-1)) zero_big_int, 
+eq_big_int (sub_big_int (big_int_of_int (-1)) zero_big_int,
             big_int_of_int (-1));;
 test 6
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 1), 
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 1),
             zero_big_int);;
 test 7
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 2), 
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int 2),
             big_int_of_int (-1));;
 test 8
-eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int 1), 
+eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int 1),
             big_int_of_int 1);;
 test 9
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-1)), 
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-1)),
             zero_big_int);;
 test 10
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-2)), 
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int (-2)),
             big_int_of_int 1);;
 test 11
-eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int (-1)), 
+eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int (-1)),
             big_int_of_int (-1));;
 test 12
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-1)), 
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-1)),
             big_int_of_int 2);;
 test 13
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 1), 
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 1),
             big_int_of_int (-2));;
 test 14
-eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-2)), 
+eq_big_int (sub_big_int (big_int_of_int 1) (big_int_of_int (-2)),
             big_int_of_int 3);;
 test 15
-eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int 1), 
+eq_big_int (sub_big_int (big_int_of_int (-2)) (big_int_of_int 1),
             big_int_of_int (-3));;
 test 16
-eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 2), 
+eq_big_int (sub_big_int (big_int_of_int (-1)) (big_int_of_int 2),
             big_int_of_int (-3));;
 test 17
-eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int (-1)), 
+eq_big_int (sub_big_int (big_int_of_int 2) (big_int_of_int (-1)),
             big_int_of_int 3);;
 
 testing_function "mult_int_big_int";;
@@ -172,21 +172,21 @@ eq_big_int (mult_int_big_int 2 (big_int_of_int 3), big_int_of_int 6);;
 testing_function "mult_big_int";;
 
 test 1
-eq_big_int (mult_big_int zero_big_int zero_big_int, 
+eq_big_int (mult_big_int zero_big_int zero_big_int,
             zero_big_int);;
 test 2
-eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int 3), 
+eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int 3),
             big_int_of_int 6);;
 test 3
-eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int (-3)), 
+eq_big_int (mult_big_int (big_int_of_int 2) (big_int_of_int (-3)),
             big_int_of_int (-6));;
-test 4 
-eq_big_int (mult_big_int (big_int_of_string "12724951") 
-                         (big_int_of_string "81749606400"), 
+test 4
+eq_big_int (mult_big_int (big_int_of_string "12724951")
+                         (big_int_of_string "81749606400"),
             big_int_of_string "1040259735709286400");;
-test 5 
-eq_big_int (mult_big_int (big_int_of_string "26542080") 
-                          (big_int_of_string "81749606400"), 
+test 5
+eq_big_int (mult_big_int (big_int_of_string "26542080")
+                          (big_int_of_string "81749606400"),
             big_int_of_string "2169804593037312000");;
 
 testing_function "quomod_big_int";;
@@ -201,14 +201,14 @@ let (quotient, modulo) =
  test 3 eq_big_int (quotient, big_int_of_int (-1)) &&
  test 4 eq_big_int (modulo, zero_big_int);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int (-1)) (big_int_of_int 1) in
- test 5 eq_big_int (quotient, big_int_of_int (-1)) && 
+ test 5 eq_big_int (quotient, big_int_of_int (-1)) &&
  test 6 eq_big_int (modulo, zero_big_int);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int 3) (big_int_of_int 2) in
- test 7 eq_big_int (quotient, big_int_of_int 1) && 
+ test 7 eq_big_int (quotient, big_int_of_int 1) &&
  test 8 eq_big_int (modulo, big_int_of_int 1);;
 
 let (quotient, modulo) =
@@ -221,12 +221,12 @@ let (quotient, modulo) =
  test 11 eq_big_int (quotient, big_int_of_int (-2)) &&
  test 12 eq_big_int (modulo, big_int_of_int 1);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int 1) (big_int_of_int 2) in
- test 13 eq_big_int (quotient, zero_big_int) && 
+ test 13 eq_big_int (quotient, zero_big_int) &&
  test 14 eq_big_int (modulo, big_int_of_int 1);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int (-1)) (big_int_of_int 3) in
  test 15 eq_big_int (quotient, minus_big_int unit_big_int) &&
  test 16 eq_big_int (modulo, big_int_of_int 2);;
@@ -236,22 +236,22 @@ failwith_test 17
 Division_by_zero
 ;;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int 10) (big_int_of_int 20) in
  test 18 eq_big_int (quotient, big_int_of_int 0) &&
  test 19 eq_big_int (modulo, big_int_of_int 10);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int (-10)) (big_int_of_int 20) in
  test 20 eq_big_int (quotient, big_int_of_int (-1)) &&
  test 21 eq_big_int (modulo, big_int_of_int 10);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int 10) (big_int_of_int (-20)) in
  test 22 eq_big_int (quotient, big_int_of_int 0) &&
  test 23 eq_big_int (modulo, big_int_of_int 10);;
 
-let (quotient, modulo) = 
+let (quotient, modulo) =
       quomod_big_int (big_int_of_int (-10)) (big_int_of_int (-20)) in
  test 24 eq_big_int (quotient, big_int_of_int 1) &&
  test 25 eq_big_int (modulo, big_int_of_int 10);;
@@ -260,28 +260,28 @@ let (quotient, modulo) =
 testing_function "gcd_big_int";;
 
 test 1
-eq_big_int (gcd_big_int zero_big_int zero_big_int, 
+eq_big_int (gcd_big_int zero_big_int zero_big_int,
             zero_big_int);;
 test 2
-eq_big_int (gcd_big_int zero_big_int (big_int_of_int 1), 
+eq_big_int (gcd_big_int zero_big_int (big_int_of_int 1),
             big_int_of_int 1);;
 test 3
-eq_big_int (gcd_big_int (big_int_of_int 1) zero_big_int, 
+eq_big_int (gcd_big_int (big_int_of_int 1) zero_big_int,
             big_int_of_int 1);;
 test 4
-eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 2), 
+eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 2),
             big_int_of_int 1);;
 test 5
-eq_big_int (gcd_big_int (big_int_of_int 2) (big_int_of_int 1), 
+eq_big_int (gcd_big_int (big_int_of_int 2) (big_int_of_int 1),
             big_int_of_int 1);;
 test 6
-eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 1), 
+eq_big_int (gcd_big_int (big_int_of_int 1) (big_int_of_int 1),
             big_int_of_int 1);;
 test 7
-eq_big_int (gcd_big_int (big_int_of_int 9) (big_int_of_int 16), 
+eq_big_int (gcd_big_int (big_int_of_int 9) (big_int_of_int 16),
             big_int_of_int 1);;
 test 8
-eq_big_int (gcd_big_int (big_int_of_int 12) (big_int_of_int 16), 
+eq_big_int (gcd_big_int (big_int_of_int 12) (big_int_of_int 16),
             big_int_of_int 4);;
 
 for i = 9 to 28 do
@@ -404,7 +404,7 @@ let bi1 = big_int_of_string (implode (rev l)) in
 let bi2 = big_int_of_string (implode (rev ("3" :: tl l))) in
 
 test 10
-eq_big_int (bi1, (add_big_int (mult_big_int bi2 (big_int_of_string "10")) 
+eq_big_int (bi1, (add_big_int (mult_big_int bi2 (big_int_of_string "10"))
                               (big_int_of_string "2")))
 (* test 11
  &&
@@ -444,7 +444,7 @@ test 2
 eq_big_int (big_int_of_nat (power_base_int 10 8), big_int_of_int 100000000)
 ;;
 test 3
-eq_big_int (big_int_of_nat (power_base_int 2 (length_of_int + 2)), 
+eq_big_int (big_int_of_nat (power_base_int 2 (length_of_int + 2)),
             big_int_of_nat (let nat = make_nat 2 in
                               set_digit_nat nat 1 1;
                               nat))
@@ -933,12 +933,11 @@ test 3 eq_int (Hashtbl.hash (minus_big_int unit_big_int),
                161678167);;
 test 4 eq_int (Hashtbl.hash (big_int_of_string "123456789123456789"),
                755417385);;
-test 5 eq_int (Hashtbl.hash (sub_big_int 
+test 5 eq_int (Hashtbl.hash (sub_big_int
                                (big_int_of_string "123456789123456789")
                                (big_int_of_string "123456789123456789")),
                955772237);;
-test 6 eq_int (Hashtbl.hash (sub_big_int 
+test 6 eq_int (Hashtbl.hash (sub_big_int
                                (big_int_of_string "123456789123456789")
                                (big_int_of_string "123456789123456788")),
               992063522);;
-
index b47b39f8ee08e727d428e785fabbfd8aadd2966f..739ed37e90ab5ca32bd1102da56be3f8fad78d4d 100644 (file)
@@ -3,7 +3,7 @@ open Nat;;
 
 (* Can compare nats less than 2**32 *)
 let equal_nat n1 n2 =
- eq_nat n1 0 (num_digits_nat n1 0 1) 
+ eq_nat n1 0 (num_digits_nat n1 0 1)
         n2 0 (num_digits_nat n2 0 1);;
 
 testing_function "num_digits_nat";;
@@ -108,10 +108,10 @@ let set_mult_digit_nat n1 d1 l1 n2 d2 l2 n3 d3 =
 let s = "3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333" in
 test 21 equal_nat (
 nat_of_string s,
-(let nat = make_nat 15 in 
+(let nat = make_nat 15 in
   set_digit_nat nat 0 3;
-  set_mult_digit_nat nat 0 15 
-                 (nat_of_string (String.sub s 0 135)) 0 14 
+  set_mult_digit_nat nat 0 15
+                 (nat_of_string (String.sub s 0 135)) 0 14
                  (nat_of_int 10) 0;
   nat))
 ;;
index b26001bc7666e8756ba44d9aa60f35657c9d1a00..24b5d264a531d80c26c93c1ac3972a376361c11a 100644 (file)
@@ -12,10 +12,10 @@ eq_num (add_num (Int 1) (Int 3), Int 4);;
 test 2
 eq_num (add_num (Int 1) (Big_int (big_int_of_int 3)), Int 4);;
 test 3
-eq_num (add_num (Int 1) (Ratio (ratio_of_string "3/4")), 
+eq_num (add_num (Int 1) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "7/4"));;
 test 4
-eq_num (add_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")), 
+eq_num (add_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "7/4"));;
 test 5
 eq_num (add_num (Big_int (big_int_of_int 1)) (Big_int (big_int_of_int 3)),
@@ -27,10 +27,10 @@ test 7
 eq_num (add_num (Ratio (ratio_of_string "2/3")) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "17/12"));;
 test 8
-eq_num (add_num (Int least_int) (Int 1), 
+eq_num (add_num (Int least_int) (Int 1),
         Int (- (pred biggest_int)));;
 test 9
-eq_num (add_num (Int biggest_int) (Int 1), 
+eq_num (add_num (Int biggest_int) (Int 1),
         Big_int (minus_big_int (pred_big_int (big_int_of_int least_int))));;
 
 testing_function "sub_num";;
@@ -40,10 +40,10 @@ eq_num (sub_num (Int 1) (Int 3), Int (-2));;
 test 2
 eq_num (sub_num (Int 1) (Big_int (big_int_of_int 3)), Int (-2));;
 test 3
-eq_num (sub_num (Int 1) (Ratio (ratio_of_string "3/4")), 
+eq_num (sub_num (Int 1) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "1/4"));;
 test 4
-eq_num (sub_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")), 
+eq_num (sub_num (Big_int (big_int_of_int 1)) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "1/4"));;
 test 5
 eq_num (sub_num (Big_int (big_int_of_int 1)) (Big_int (big_int_of_int 3)),
@@ -55,7 +55,7 @@ test 8
 eq_num (sub_num (Ratio (ratio_of_string "2/3")) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "-1/12"));;
 test 9
-eq_num (sub_num (Int least_int) (Int (-1)), 
+eq_num (sub_num (Int least_int) (Int (-1)),
         Int (- (pred biggest_int)));;
 test 10
 eq_num (sub_num (Int (-1)) (Int biggest_int), pred_num (Int least_int));;
@@ -68,12 +68,12 @@ test 2
 eq_num (mult_num (Int 127) (Int (int_of_string "257")),
                   Int (int_of_string "32639"));;
 test 3
-eq_num (mult_num (Int 257) (Int (int_of_string "260")), 
+eq_num (mult_num (Int 257) (Int (int_of_string "260")),
         Big_int (big_int_of_string "66820"));;
 test 4
 eq_num (mult_num (Int 2) (Big_int (big_int_of_int 3)), Int 6);;
 test 5
-eq_num (mult_num (Int 10) (Ratio (ratio_of_string "3/4")), 
+eq_num (mult_num (Int 10) (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "15/2"));;
 test 6
 eq_num (mult_num (Big_int (big_int_of_int 10)) (Ratio (ratio_of_string "3/4")),
@@ -93,31 +93,31 @@ testing_function "div_num";;
 test 1
 eq_num (div_num (Int 6) (Int 3), Int 2);;
 test 2
-eq_num (div_num (Int (int_of_string "32639")) 
+eq_num (div_num (Int (int_of_string "32639"))
                  (Int (int_of_string "257")), Int 127);;
 test 3
-eq_num (div_num (Big_int (big_int_of_string "66820")) 
-                 (Int (int_of_string "257")), 
+eq_num (div_num (Big_int (big_int_of_string "66820"))
+                 (Int (int_of_string "257")),
         Int 260);;
 test 4
 eq_num (div_num (Int 6) (Big_int (big_int_of_int 3)), Int 2);;
 test 5
-eq_num (div_num (Ratio (ratio_of_string "15/2")) 
+eq_num (div_num (Ratio (ratio_of_string "15/2"))
                  (Int 10),
-        Ratio (ratio_of_string "3/4"));; 
+        Ratio (ratio_of_string "3/4"));;
 test 6
 eq_num (div_num (Big_int (big_int_of_int 6)) (Big_int (big_int_of_int 3)),
         Int 2);;
-test 7 
-eq_num (div_num (Ratio (ratio_of_string "15/2")) 
+test 7
+eq_num (div_num (Ratio (ratio_of_string "15/2"))
                  (Big_int (big_int_of_int 10)),
         Ratio (ratio_of_string "3/4"));;
 test 8
-eq_num (div_num (Ratio (ratio_of_string "15/2")) 
+eq_num (div_num (Ratio (ratio_of_string "15/2"))
                  (Ratio (ratio_of_string "3/4")),
         Big_int (big_int_of_int 10));;
 test 9
-eq_num (div_num (Ratio (ratio_of_string "1/2")) 
+eq_num (div_num (Ratio (ratio_of_string "1/2"))
                  (Ratio (ratio_of_string "3/4")),
         Ratio (ratio_of_string "2/3"));;
 
@@ -137,7 +137,7 @@ testing_function "num_of_ratio";;
 test 1
 eq_num (num_of_ratio (ratio_of_string "4/2"), Int 2);;
 test 2
-eq_num (num_of_ratio (ratio_of_string "11811160075/11"), 
+eq_num (num_of_ratio (ratio_of_string "11811160075/11"),
         Big_int (big_int_of_string "1073741825"));;
 test 3
 eq_num (num_of_ratio (ratio_of_string "123456789012/1234"),
@@ -205,13 +205,13 @@ test 2 eq (f1 1, false);;
 
 test 3 eq (f1 (0/1), true);;
 
-test 4 eq (f1 (let n = num_of_string "2000000000000000000000000" in n-n) , 
+test 4 eq (f1 (let n = num_of_string "2000000000000000000000000" in n-n) ,
             true);;
 
-test 5 eq (f1 (let n = num_of_string "2000000000000000000000000" in n/n-1) , 
+test 5 eq (f1 (let n = num_of_string "2000000000000000000000000" in n/n-1) ,
             true);;
 
-test 6 eq (f1 (let n = num_of_string "2000000000000000000000000" in n+1) , 
+test 6 eq (f1 (let n = num_of_string "2000000000000000000000000" in n+1) ,
             false);;
 
 test 7 eq (f1 (1/2), false);;
index 16046a7c04c4b4060fb2b2e0d05583afafad8c98..1e2762287f538ff8d656202c45a4d4a91e36ab09 100644 (file)
@@ -274,7 +274,7 @@ try
   test (sprintf "%B" true = "true");
   test (sprintf "%B" false = "false");
 
-  printf "ld/li positive\n%!";
+  printf "\nld/li positive\n%!";
   test (sprintf "%ld/%li" 42l 43l = "42/43");
   test (sprintf "%-4ld/%-5li" 42l 43l = "42  /43   ");
   test (sprintf "%04ld/%05li" 42l 43l = "0042/00043");
@@ -355,7 +355,7 @@ try
   (* Nativeint not tested: looks like too much work, and anyway it should
      work like Int32 or Int64. *)
 
-  printf "Ld/Li positive\n%!";
+  printf "\nLd/Li positive\n%!";
   test (sprintf "%Ld/%Li" 42L 43L = "42/43");
   test (sprintf "%-4Ld/%-5Li" 42L 43L = "42  /43   ");
   test (sprintf "%04Ld/%05Li" 42L 43L = "0042/00043");
index 693db2496bf119736cc3452bf7cd83e5e10c3e94..c30013eb635c811212d4667e86062a53eb5321ef 100644 (file)
@@ -1,87 +1,89 @@
 d/i positive
-0 1 2 3 4 5 6 7 8 
+ 0 1 2 3 4 5 6 7 8
 d/i negative
-9 10 11 12 13 14 15 16 17 
+ 9 10 11 12 13 14 15 16 17
 u positive
-18 19 20 21 22 23 24 25 26 
+ 18 19 20 21 22 23 24 25 26
 u negative
-27 
+ 27
 x positive
-28 29 30 31 32 33 34 35 36 
+ 28 29 30 31 32 33 34 35 36
 x negative
-37 
+ 37
 X positive
-38 39 40 41 42 43 44 45 46 
+ 38 39 40 41 42 43 44 45 46
 x negative
-47 
+ 47
 o positive
-48 49 50 51 52 53 54 55 56 
+ 48 49 50 51 52 53 54 55 56
 o negative
-57 
+ 57
 s
-58 59 60 61 62 63 64 65 66 67 68 69 70 71 
+ 58 59 60 61 62 63 64 65 66 67 68 69 70 71
 S
-72 73 74 75 76 77 78 79 80 
+ 72 73 74 75 76 77 78 79 80
 c
-81 82 83 84 
+ 81 82 83 84
 C
-85 86 87 88 89 
+ 85 86 87 88 89
 f
-90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 
+ 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
 F
-108 109 110 111 
+ 108 109 110 111
 e
-112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 
+ 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
 E
-130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 
+ 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
 B
-148 149 ld/li positive
-150 151 152 153 154 155 156 157 158 
+ 148 149
+ld/li positive
+ 150 151 152 153 154 155 156 157 158
 ld/li negative
-159 160 161 162 163 164 165 166 167 
+ 159 160 161 162 163 164 165 166 167
 lu positive
-168 169 170 171 172 173 174 175 176 
+ 168 169 170 171 172 173 174 175 176
 lu negative
-177 
+ 177
 lx positive
-178 179 180 181 182 183 184 185 186 
+ 178 179 180 181 182 183 184 185 186
 lx negative
-187 
+ 187
 lX positive
-188 189 190 191 192 193 194 195 196 
+ 188 189 190 191 192 193 194 195 196
 lx negative
-197 
+ 197
 lo positive
-198 199 200 201 202 203 204 205 206 
+ 198 199 200 201 202 203 204 205 206
 lo negative
-207 Ld/Li positive
-208 209 210 211 212 213 214 215 216 
+ 207
+Ld/Li positive
+ 208 209 210 211 212 213 214 215 216
 Ld/Li negative
-217 218 219 220 221 222 223 224 225 
+ 217 218 219 220 221 222 223 224 225
 Lu positive
-226 227 228 229 230 231 232 233 234 
+ 226 227 228 229 230 231 232 233 234
 Lu negative
-235 
+ 235
 Lx positive
-236 237 238 239 240 241 242 243 244 
+ 236 237 238 239 240 241 242 243 244
 Lx negative
-245 
+ 245
 LX positive
-246 247 248 249 250 251 252 253 254 
+ 246 247 248 249 250 251 252 253 254
 Lx negative
-255 
+ 255
 Lo positive
-256 257 258 259 260 261 262 263 264 
+ 256 257 258 259 260 261 262 263 264
 Lo negative
-265 
+ 265
 a
-266 
+ 266
 t
-267 
+ 267
 (...%)
-268 
+ 268
 ! % @ , and constants
-269 270 271 272 273 274 275 
+ 269 270 271 272 273 274 275
 end of tests
 
 All tests succeeded.
index 98209011fae2ee58d3d7ae0792abd28b614e1a7d..1ee1b4a27892bfd82c5ab93614b7a33c863fcff2 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                       *)
 (*************************************************************************)
 
-(* $Id: tscanf.ml 12210 2012-03-08 19:52:03Z doligez $
+(* $Id: tscanf.ml 12800 2012-07-30 18:59:07Z doligez $
 
 A testbed file for the module Scanf.
 
@@ -265,15 +265,15 @@ test (test10 ())
 
 (* %[] style *)
 let test11 () =
-  sscanf "Pierre       Weis    70" "%s %s %s"
+  sscanf "Pierre\tWeis\t70" "%s %s %s"
     (fun prenom nom poids ->
      prenom = "Pierre" && nom = "Weis" && int_of_string poids = 70)
   &&
-  sscanf "Jean-Luc     de Léage        68" "%[^        ] %[^   ] %d"
+  sscanf "Jean-Luc\tde Léage\t68" "%[^\t] %[^\t] %d"
     (fun prenom nom poids ->
      prenom = "Jean-Luc" && nom = "de Léage" && poids = 68)
   &&
-  sscanf "Daniel       de Rauglaudre   66" "%s@\t %s@\t %d"
+  sscanf "Daniel\tde Rauglaudre\t66" "%s@\t %s@\t %d"
     (fun prenom nom poids ->
      prenom = "Daniel" && nom = "de Rauglaudre" && poids = 66)
 ;;
index 3c9fa44201d1872a50993b11b01abb9873202e39..18fe92baf8d0672c438ce2e761adf7e32c13c39b 100644 (file)
@@ -1,2 +1,2 @@
-0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 
+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
 All tests succeeded.
index 1197fbf6d093b86e96ce6957e494be3f5592a842..c54764ea7f980091104eecc2c7bd1e2b0eb67811 100644 (file)
@@ -103,7 +103,7 @@ let test x v s1 s2 =
 
   check "split"
     (let (l, p, r) = M.split x s1 in
-     fun i -> 
+     fun i ->
        if i < x then img i l = img i s1
        else if i > x then img i r = img i s1
        else p = img i s1)
@@ -120,4 +120,3 @@ let rmap() =
 let _ =
   Random.init 42;
   for i = 1 to 25000 do test (rkey()) (rdata()) (rmap()) (rmap()) done
-  
index c4ab0441e01c6a0143bd3750e31f8b8fa15d0367..024342f8080e25564a0ffed14fe783dab48dfc5c 100644 (file)
@@ -102,7 +102,7 @@ let test x s1 s2 =
 
   check "split"
     (let (l, p, r) = S.split x s1 in
-     fun i -> 
+     fun i ->
        if i < x then S.mem i l = S.mem i s1
        else if i > x then S.mem i r = S.mem i s1
        else p = S.mem i s1)
@@ -117,4 +117,3 @@ let rset() =
 let _ =
   Random.init 42;
   for i = 1 to 25000 do test (relt()) (rset()) (rset()) done
-  
index 03c85ea407b84afedecb039602392768dea644f3..ab0c10ebb627b72e2e55bec99887aad3ad80929e 100644 (file)
@@ -34,7 +34,7 @@ let start_test msg =
 let num_failures = ref 0
 
 let test res1 res2 =
-  if res1 = res2 
+  if res1 = res2
   then print_char '.'
   else begin print_string " FAIL "; incr num_failures end
 
@@ -743,7 +743,7 @@ let automated_test() =
   test (Str.split_delim (Str.regexp "[ \t]+") " si non e vero\t")
        [""; "si"; "non"; "e"; "vero"; ""];
   test (Str.full_split (Str.regexp "[ \t]+") " si non\te vero\t")
-       [Str.Delim " "; Str.Text "si"; 
+       [Str.Delim " "; Str.Text "si";
         Str.Delim " "; Str.Text "non";
         Str.Delim "\t"; Str.Text "e";
         Str.Delim " "; Str.Text "vero"; Str.Delim "\t"];
@@ -752,7 +752,7 @@ let automated_test() =
   (* See "REX: XML Shallow Parsing with Regular Expressions",
      Robert D. Cameron, Simon Fraser University, CMPT TR 1998-17. *)
   start_test "XML tokenization";
-  begin 
+  begin
     let _TextSE = "[^<]+" in
     let _UntilHyphen = "[^-]*-" in
     let _Until2Hyphens = _UntilHyphen ^ "\\([^-]" ^ _UntilHyphen ^ "\\)*-" in
index acdc75cac082e8c33e5af05c8b27d1736b0dc212..52e367eabc8ef6f869bd37885c53d97060729133 100644 (file)
@@ -1,2 +1,2 @@
-0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 
+ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 All tests succeeded.
index d0d253b37d4f400138c15858cdd1dcd1fd4e5f35..1c1f232fc91c4036acaa3868a802881d3981485e 100644 (file)
@@ -2,7 +2,7 @@
 
 let compute_thread c = ignore c
 (*
-  while true do 
+  while true do
     print_char c; flush stdout;
     for i = 1 to 100000 do ignore(ref []) done
   done
@@ -14,6 +14,7 @@ let main () =
   print_string "Forking..."; print_newline();
   match Unix.fork() with
   | 0 ->
+      Thread.delay 0.5;
       print_string "In child..."; print_newline();
       Gc.minor();
       print_string "Child did minor GC."; print_newline();
@@ -23,10 +24,8 @@ let main () =
       exit 0
   | pid ->
       print_string "In parent..."; print_newline();
-      Thread.delay 2.0;
+      Thread.delay 4.0;
       print_string "Parent is exiting."; print_newline();
       exit 0
 
 let _ = main()
-
-      
index 907135b6224a663eba61284efbb493fddcc67004..e6d40a24780cea100e9e0bb4d65bc91b9f1ce4a7 100644 (file)
@@ -1,4 +1,4 @@
 ./program > test3.result &
 pid=$!
 sleep 5
-kill -9 $pid
\ No newline at end of file
+kill -9 $pid
index 4f1a16d087f6d91780b394a8009ce46dd6dc956e..0559da0f80c72bfb3f8e403aee2501778aea2ec4 100644 (file)
@@ -1 +1 @@
-./program < test4.data > test4.result 2> /dev/null || true
\ No newline at end of file
+./program < test4.data > test4.result 2> /dev/null || true
index 877d176e025cd7c68a75d082b3abb0e2c4dfbbe6..6973ea78ff6a3225b7d5b338ca863a6199191dfe 100644 (file)
@@ -1,4 +1,4 @@
 ./program > test5.result &
 pid=$!
-sleep 1
-kill -9 $pid
\ No newline at end of file
+sleep 3
+kill -9 $pid
index c5eb2dcd7b2fd4c5c2be00da1a5c0293067c3dd2..7cdb84123a01cdda85367c7f605a5c73dda14d9f 100644 (file)
@@ -1 +1 @@
-test `grep -E '^-?[0123456789]+$' test7.result | wc -l` = `cat test7.result | wc -l`
\ No newline at end of file
+test `grep -E '^-?[0123456789]+$' test7.result | wc -l` = `cat test7.result | wc -l`
index 2e8ef03a23d129dd1a109a843a30eead56ce3959..e7a5f0614a4ab7a77637b8d43d9b94f0a5e086da 100644 (file)
@@ -1 +1 @@
-sed -e 1q testsignal.result | grep -q '^[ab]*Got ctrl-C, exiting...$' 
+sed -e 1q testsignal.result | grep -q '^[ab]*Got ctrl-C, exiting...$'
index 897ef1733ab2998f474e9661eec4e286fb775b70..74c0d54df6a3a9272a9d614f4b465f0a47b7aabc 100644 (file)
@@ -1,4 +1,4 @@
 ./program > testsignal.result &
 pid=$!
 sleep 3
-kill -INT $pid
\ No newline at end of file
+kill -INT $pid
index cfc57833344236ee699e126bea6a189565dd0692..02006a7a8fd57999638b6a48f0d06bf6b28de554 100644 (file)
@@ -9,9 +9,9 @@ let gc_thread () =
 
 let stdin_thread () =
   while true do
-    print_string "> "; flush stdout;
+    print_string ">"; flush stdout;
     let s = read_line() in
-    print_string ">>> "; print_string s; print_newline()
+    print_string " >>> "; print_string s; print_newline()
   done
 
 let writer_thread (oc, size) =
index cd5f474fb648d8ea5b606efbef538691f4d90f77..f726cc46829ff645d9f03f2c7782860033e95cbc 100644 (file)
@@ -1,4 +1,4 @@
 > >>> abc
 > >>> def
 > >>> ghi
-> 
\ No newline at end of file
+>
\ No newline at end of file
index f4ad597bffbdde940f1dea2cc93e5291e27c5b7c..12ceeb64acb636750711db18f88d0bf3f1440821 100644 (file)
@@ -1 +1 @@
-./program < torture.data > torture.result 2> /dev/null || true
\ No newline at end of file
+./program < torture.data > torture.result 2> /dev/null || true
index 0045504df98a44d26bd010d6f361f5c90ee89cee..d45bd7d6618d50ba5282df57b9776f2b41df3eb7 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: equations.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: equations.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (****************** Equation manipulations *************)
 
 open Terms
 
-type rule = 
+type rule =
   { number: int;
     numvars: int;
     lhs: term;
@@ -53,7 +53,7 @@ let pretty_rule rule =
 
 
 let pretty_rules rules = List.iter pretty_rule rules
+
 (****************** Rewriting **************************)
 
 (* Top-level rewriting. Let eq:L=R be an equation, M be a term such that L<=M.
@@ -112,4 +112,3 @@ let rec mrewrite_all rules m =
     mrewrite_all rules (mrewrite1 rules m)
   with Failure _ ->
     m
-
index 01b9dcd2c364a9dcff781096242a7f518053ee4b..c9ea8aacfdc0e2420c7c6e0d83555a642c751a9b 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: equations.mli 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: equations.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Terms
 
-type rule = 
+type rule =
   { number: int;
     numvars: int;
     lhs: term;
index 4cbc37719d87db3725ded32fe93e3ebb2b5221b6..9af59194ab472a0e98d61de4447214aef32c14c3 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: kb.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: kb.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Terms
 open Equations
@@ -37,7 +37,7 @@ let rec super m = function
 
 
 (* Ex :
-let (m,_) = <<F(A,B)>> 
+let (m,_) = <<F(A,B)>>
 and (n,_) = <<H(F(A,x),F(x,y))>> in super m n
 ==> [[1],[2,Term ("B",[])];                      x <- B
      [2],[2,Term ("A",[]); 1,Term ("B",[])]]     x <- A  y <- B
@@ -109,7 +109,7 @@ let rec get_rule n = function
 
 (* Improved Knuth-Bendix completion procedure *)
 
-let kb_completion greater = 
+let kb_completion greater =
   let rec kbrec j rules =
   let rec process failures (k,l) eqs =
 (****
@@ -165,7 +165,7 @@ let kb_completion greater =
                   (strict_critical_pairs el (rename rl.numvars el))
         else
           try
-            let rk = get_rule k rules in 
+            let rk = get_rule k rules in
             let ek = (rk.lhs, rk.rhs) in
               process failures (k,l)
                       (mutual_critical_pairs el (rename rl.numvars ek))
@@ -185,4 +185,3 @@ let kb_complete greater complete_rules rules =
       kb_completion greater n complete_rules [] (n,n) eqs in
     print_string "Canonical set found :"; print_newline();
     pretty_rules (List.rev completed_rules)
-
index 8592ab0842b888ad96be6c0382ded1de8dd5d152..8e918c5847c9f3fbcbfa1251870450ae66f493a4 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: kbmain.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: kbmain.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Terms
 open Equations
@@ -72,11 +72,10 @@ let group_precedence op1 op2 =
     if r1 = r2 then Equal else
     if r1 > r2 then Greater else NotGE
 
-let group_order = rpo group_precedence lex_ext 
+let group_order = rpo group_precedence lex_ext
 
 let greater pair =
   match group_order pair with Greater -> true | _ -> false
 
 let _ =
   for i = 1 to 20 do kb_complete greater [] geom_rules done
-
index 245f9b406ae24119a085e0c9a892baa099441618..81b06196df63768712f03ca90b3a99037433782d 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: orderings.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: orderings.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (*********************** Recursive Path Ordering ****************************)
 
 open Terms
 
-type ordering = 
+type ordering =
     Greater
   | Equal
   | NotGE
@@ -65,10 +65,10 @@ let lex_ext order = function
       | ( _ , []) -> Greater
       | (x1::l1, x2::l2) ->
           match order (x1,x2) with
-            Greater -> if List.for_all (fun n' -> gt_ord order (m,n')) l2 
+            Greater -> if List.for_all (fun n' -> gt_ord order (m,n')) l2
                        then Greater else NotGE
           | Equal -> lexrec (l1,l2)
-          | NotGE -> if List.exists (fun m' -> ge_ord order (m',n)) l1 
+          | NotGE -> if List.exists (fun m' -> ge_ord order (m',n)) l1
                      then Greater else NotGE in
       lexrec (sons1, sons2)
   | _ -> failwith "lex_ext"
@@ -76,9 +76,9 @@ let lex_ext order = function
 
 (* Recursive path ordering *)
 
-let rpo op_order ext = 
+let rpo op_order ext =
   let rec rporec (m,n) =
-    if m = n then Equal else 
+    if m = n then Equal else
       match m with
           Var vm -> NotGE
         | Term(op1,sons1) ->
@@ -96,4 +96,3 @@ let rpo op_order ext =
                         if List.exists (fun m' -> ge_ord rporec (m',n)) sons1
                         then Greater else NotGE
   in rporec
-
index eb9dde132ff779b349f60e9af3f2222b6f7d59e5..5d5a4c2b8a7c08ce8f990abb31d853ff83524f48 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: orderings.mli 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: orderings.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Terms
 
-type ordering = 
+type ordering =
     Greater
   | Equal
   | NotGE
index 899750a27380979630a9551a2ec12223f2bc901b..bc3cd64b5a9cbed06a74e3ba78e314199ad3713c 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: terms.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: terms.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (****************** Term manipulations *****************)
 
-type term = 
+type term =
     Var of int
   | Term of string * term list
 
@@ -22,7 +22,7 @@ let rec union l1 l2 =
   match l1 with
     []   -> l2
   | a::r -> if List.mem a l2 then union r l2 else a :: union r l2
-  
+
 
 let rec vars = function
     Var n -> [n]
@@ -73,7 +73,7 @@ let matching term1 term2 =
 
 (* A naive unification algorithm. *)
 
-let compsubst subst1 subst2 = 
+let compsubst subst1 subst2 =
   (List.map (fun (v,t) -> (v, substitute subst1 t)) subst2) @ subst1
 
 
@@ -133,5 +133,3 @@ and pretty_close = function
         pretty_term m
   | m ->
       pretty_term m
-
-
index 7dc6c286f6c898ad096422e995e17c41d240a189..c80d8423f760bb3dac902fef77185fed25cc279a 100644 (file)
@@ -10,9 +10,9 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: terms.mli 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: terms.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
-type term = 
+type term =
     Var of int
   | Term of string * term list
 
index 73293e9ad9fe0ccf6174ba133ba8bac208213dbe..e5cdf36c3b46f48c7258ebda734e77f30ca21349 100644 (file)
@@ -16,7 +16,7 @@
  *     Longitudes, Paris, France), as detailed in Astronomy & Astrophysics
  *     282, 663 (1994)
  *
- *    Note that the code herein is design for the purpose of testing 
+ *    Note that the code herein is design for the purpose of testing
  *     computational performance; error handling and other such "niceties"
  *    is virtually non-existent.
  *
@@ -68,7 +68,7 @@ and a = [|
   [|  19.2184460618;     -3716e-10;  979e-10 |];
   [|  30.1103868694;    -16635e-10;  686e-10 |] |]
 
-and dlm =        
+and dlm =
   [| [| 252.25090552; 5381016286.88982;  -1.92789 |];
      [| 181.97980085; 2106641364.33548;   0.59381 |];
      [| 100.46645683; 1295977422.83429;  -2.04411 |];
@@ -151,7 +151,7 @@ and sa =
 
 (* tables giving the trigonometric terms to be added to the mean elements of
    the mean longitudes . *)
-and kq = 
+and kq =
   [| [|  3086.0; 15746.0; 69613.0; 59899.0; 75645.0; 88306.0; 12661.0; 2658.0;  0.0;   0.0 |];
      [| 21863.0; 32794.0; 10931.0;    73.0;  4387.0; 26934.0;  1473.0; 2157.0;  0.0;   0.0 |];
      [|    10.0; 16002.0; 21863.0; 10931.0;  1473.0; 32004.0;  4387.0;   73.0;  0.0;   0.0 |];
@@ -181,15 +181,15 @@ and sl =
      [|  71234.0;-41116.0; 5334.0;-4935.0;-1848.0;   66.0;  434.0;-1748.0;  3780.0; -701.0 |];
      [| -47645.0; 11647.0; 2166.0; 3194.0;  679.0;    0.0; -244.0; -419.0; -2531.0;   48.0 |] |]
 
-  
+
 (* Normalize angle into the range -pi <= A < +pi. *)
 let anpm a =
   let w = mod_float a twopi in
     if abs_float w >= pic then begin
       if a < 0.0 then
-       w +. twopi
+        w +. twopi
       else
-       w -. twopi
+        w -. twopi
     end else
       w
 
@@ -204,10 +204,10 @@ let planetpv epoch np pv =
   and de  = e.(np).(0) +. (e.(np).(1) +. e.(np).(2) *. t ) *. t
   and dp  = anpm ((3600.0 *. pi.(np).(0) +. (pi.(np).(1) +. pi.(np).(2) *. t ) *. t ) *. a2r )
   and  di  = (3600.0 *. dinc.(np).(0) +. (dinc.(np).(1) +. dinc.(np).(2) *. t ) *. t ) *. a2r
-  and doh = anpm ((3600.0 *. omega.(np).(0) +. (omega.(np).(1) +. omega.(np).(2) *. t ) *. t ) *. a2r )     
-             (* apply the trigonometric terms. *)
+  and doh = anpm ((3600.0 *. omega.(np).(0) +. (omega.(np).(1) +. omega.(np).(2) *. t ) *. t ) *. a2r )
+              (* apply the trigonometric terms. *)
   and dmu = 0.35953620 *. t in
-    
+
   (* loop invariant *)
   let kp = kp.(np) and kq = kq.(np) and ca = ca.(np) and sa = sa.(np)
   and cl = cl.(np) and sl = sl.(np) in
@@ -231,20 +231,20 @@ let planetpv epoch np pv =
     (* iterative solution of kepler's equation to get eccentric anomaly. *)
     let am = !dl -. dp in
     let ae = ref (am +. de *. sin am)
-    and k = ref 0 in 
+    and k = ref 0 in
     let dae = ref ((am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae)) in
       ae := !ae +. !dae;
       incr k;
       while !k < 10 or abs_float !dae >= 1e-12 do
-       dae := (am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae);
-       ae := !ae +. !dae;
-       incr k
+        dae := (am -. !ae +. de *. sin !ae) /. (1.0 -. de *. cos !ae);
+        ae := !ae +. !dae;
+        incr k
       done;
-      
+
       (* true anomaly. *)
       let ae2 = !ae /. 2.0 in
-      let at  = 2.0 *. atan2 (sqrt ((1.0 +. de) /. (1.0 -. de)) *. sin ae2)  (cos ae2) 
-                 (* distance (au) and speed (radians per day). *)
+      let at  = 2.0 *. atan2 (sqrt ((1.0 +. de) /. (1.0 -. de)) *. sin ae2)  (cos ae2)
+                  (* distance (au) and speed (radians per day). *)
       and r = !da *. (1.0 -. de *. cos !ae)
       and v = gaussk *. sqrt ((1.0 +. 1.0 /. amas.(np) ) /. (!da *. !da *. !da))
       and si2   = sin (di /. 2.0) in
@@ -253,7 +253,7 @@ let planetpv epoch np pv =
       and tl = at +. dp in
       let xsw = sin tl
       and xcw = cos tl in
-      let xm2  = 2.0 *. (xp *. xcw -. xq *. xsw ) 
+      let xm2  = 2.0 *. (xp *. xcw -. xq *. xsw )
       and xf = !da /. sqrt (1.0 -. de *. de)
       and ci2 = cos (di /. 2.0) in
       let xms = (de *. sin dp +. xsw) *. xf
@@ -265,42 +265,42 @@ let planetpv epoch np pv =
       and y = r *. (xsw +. xm2 *. xq)
       and z = r *. (-.xm2 *. ci2) in
 
-       (* rotate to equatorial. *)
-       pv.(0).(0) <- x;
-       pv.(0).(1) <- y *. coseps -. z *. sineps;
-       pv.(0).(2) <- y *. sineps +. z *. coseps;
+        (* rotate to equatorial. *)
+        pv.(0).(0) <- x;
+        pv.(0).(1) <- y *. coseps -. z *. sineps;
+        pv.(0).(2) <- y *. sineps +. z *. coseps;
 
-       (* velocity (j2000 ecliptic xdot,ydot,zdot in au/d). *)
-       let x = v *. ((-1.0 +. 2.0 *. xp *. xp) *. xms +. xpxq2 *. xmc)
-       and y = v *. (( 1.0 -. 2.0 *. xq *. xq ) *. xmc -. xpxq2 *. xms)
-       and z = v *. (2.0 *. ci2 *. (xp *. xms +. xq *. xmc)) in
+        (* velocity (j2000 ecliptic xdot,ydot,zdot in au/d). *)
+        let x = v *. ((-1.0 +. 2.0 *. xp *. xp) *. xms +. xpxq2 *. xmc)
+        and y = v *. (( 1.0 -. 2.0 *. xq *. xq ) *. xmc -. xpxq2 *. xms)
+        and z = v *. (2.0 *. ci2 *. (xp *. xms +. xq *. xmc)) in
 
-         (* rotate to equatorial *)
-         pv.(1).(0) <- x;
-         pv.(1).(1) <- y *. coseps -. z *. sineps;
-         pv.(1).(2) <- y *. sineps +. z *. coseps
+          (* rotate to equatorial *)
+          pv.(1).(0) <- x;
+          pv.(1).(1) <- y *. coseps -. z *. sineps;
+          pv.(1).(2) <- y *. sineps +. z *. coseps
 
 
-(* Computes RA, Declination, and distance from a state vector returned by 
+(* Computes RA, Declination, and distance from a state vector returned by
  * planetpv. *)
 let radecdist state rdd =
   (* Distance *)
   rdd.(2) <- sqrt (state.(0).(0) *. state.(0).(0)
-                +. state.(0).(1) *. state.(0).(1)
-                +. state.(0).(2) *. state.(0).(2));
+                 +. state.(0).(1) *. state.(0).(1)
+                 +. state.(0).(2) *. state.(0).(2));
   (* RA *)
   rdd.(0) <- atan2 state.(0).(1) state.(0).(0) *. r2h;
   if rdd.(0) < 0.0 then rdd.(0) <- rdd.(0) +. 24.0;
-  
+
   (* Declination *)
   rdd.(1) <- asin (state.(0).(2) /. rdd.(2)) *. r2d
-  
+
 
 
 (* Entry point. Calculate RA and Dec for noon on every day in 1900-2100 *)
 let _ =
   let jd = [| 0.0; 0.0 |]
-  and pv = [| [| 0.0; 0.0; 0.0 |]; [| 0.0; 0.0; 0.0 |] |] 
+  and pv = [| [| 0.0; 0.0; 0.0 |]; [| 0.0; 0.0; 0.0 |] |]
   and position = [| 0.0; 0.0; 0.0 |] in
   (* Test *)
   jd.(0) <- j2000;
@@ -317,8 +317,8 @@ let _ =
     for n = 0 to test_length - 1 do
       jd.(0) <- jd.(0) +. 1.0;
       for p = 0 to 7 do
-       planetpv jd p pv;
-       radecdist pv position;
+        planetpv jd p pv;
+        radecdist pv position;
       done
     done
   done
index f513e5ad5b147efc079c5b0dfc983c4808e61029..eb13b1e0a3469f0b4f1800c40e10c0be3d69d84d 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: fft.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: fft.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 let pi = 3.14159265358979323846
 
@@ -19,17 +19,17 @@ let tpi = 2.0 *. pi
 let fft px py np =
   let i = ref 2 in
   let m = ref 1 in
-  
+
   while (!i < np) do
-    i := !i + !i; 
+    i := !i + !i;
     m := !m + 1
   done;
 
-  let n = !i in  
-  
+  let n = !i in
+
   if n <> np then begin
     for i = np+1 to n do
-      px.(i) <- 0.0; 
+      px.(i) <- 0.0;
       py.(i) <- 0.0
     done;
     print_string "Use "; print_int n;
@@ -38,7 +38,7 @@ let fft px py np =
 
   let n2 = ref(n+n) in
   for k = 1 to !m-1 do
-    n2 := !n2 / 2; 
+    n2 := !n2 / 2;
     let n4 = !n2 / 4 in
     let e  = tpi /. float !n2 in
 
@@ -51,7 +51,7 @@ let fft px py np =
       let ss3 = sin(a3) in
       let is = ref j in
       let id = ref(2 * !n2) in
-  
+
         while !is < n do
           let i0r = ref !is in
           while !i0r < n do
@@ -71,13 +71,13 @@ let fft px py np =
              let r1 = r1 +. s2 in
              let s2 = r2 -. s1 in
              let r2 = r2 +. s1 in
-             px.(i2) <- r1*.cc1 -. s2*.ss1; 
+             px.(i2) <- r1*.cc1 -. s2*.ss1;
              py.(i2) <- -.s2*.cc1 -. r1*.ss1;
              px.(i3) <- s3*.cc3 +. r2*.ss3;
              py.(i3) <- r2*.cc3 -. s3*.ss3;
              i0r := i0 + !id
           done;
-          is := 2 * !id - !n2 + j; 
+          is := 2 * !id - !n2 + j;
           id := 4 * !id
         done
     done
@@ -89,7 +89,7 @@ let fft px py np =
 
   let is = ref 1 in
   let id = ref 4 in
-  
+
   while !is < n do
     let i0r = ref !is in
     while !i0r <= n do
@@ -103,7 +103,7 @@ let fft px py np =
       py.(i1) <- r1 -. py.(i1);
       i0r := i0 + !id
     done;
-    is := 2 * !id - 1; 
+    is := 2 * !id - 1;
     id := 4 * !id
   done;
 
@@ -112,11 +112,11 @@ let fft px py np =
 (*************************)
 
   let j = ref 1 in
-  
+
   for i = 1 to n - 1 do
     if i < !j then begin
       let xt = px.(!j) in
-      px.(!j) <- px.(i); 
+      px.(!j) <- px.(i);
       px.(i) <- xt;
       let xt = py.(!j) in
       py.(!j) <- py.(i);
@@ -124,7 +124,7 @@ let fft px py np =
     end;
     let k = ref(n / 2) in
     while !k < !j do
-      j := !j - !k; 
+      j := !j - !k;
       k := !k / 2
     done;
     j := !j + !k
@@ -170,12 +170,12 @@ let test np =
   for i = 0 to np-1 do
       let a = abs_float(pxr.(i+1) -. float i) in
       if !zr < a then begin
-         zr := a; 
+         zr := a;
          kr := i
       end;
       let a = abs_float(pxi.(i+1)) in
       if !zi < a then begin
-         zi := a; 
+         zi := a;
          ki := i
       end
   done;
@@ -186,4 +186,3 @@ let test np =
 
 let _ =
   let np = ref 16 in for i = 1 to 16 do test !np; np := !np*2 done
-
index 70c0c1f6fd7483ab352ca6c584afa8dd334f9490..5cc88a0eb9abf5a01f802adaa696c3fc440f6fd1 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: bdd.ml 12149 2012-02-10 16:15:24Z doligez $ *)
+(* $Id: bdd.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Translated to OCaml by Xavier Leroy *)
 (* Original code written in SML by ... *)
@@ -24,8 +24,8 @@ let rec eval bdd vars =
   | Node(l, v, _, h) ->
       if vars.(v) then eval h vars else eval l vars
 
-let getId bdd = 
-  match bdd with 
+let getId bdd =
+  match bdd with
     Node(_,_,id,_) -> id
   | Zero           -> 0
   | One            -> 1
@@ -42,10 +42,10 @@ let resize newSize =
       let newSz_1 = newSize-1 in
       let newArr  = Array.create newSize [] in
       let rec copyBucket bucket =
-                match bucket with 
+                match bucket with
                   []     -> ()
-                | n :: ns ->  
-                    match n with 
+                | n :: ns ->
+                    match n with
                     | Node(l,v,_,h) ->
                        let ind = hashVal (getId l) (getId h) v land newSz_1
                        in
@@ -80,18 +80,18 @@ let resetUnique () = (
 
 let mkNode low v high =
    let idl = getId low in
-   let idh = getId high 
+   let idh = getId high
    in
      if idl = idh
      then low
      else let ind      = hashVal idl idh v land  (!sz_1) in
           let bucket   = (!htab).(ind) in
-          let rec lookup b = 
-                    match b with 
+          let rec lookup b =
+                    match b with
                       [] -> let n = Node(low, v, (incr nodeC; !nodeC), high)
                             in
                              insert (getId low) (getId high) v ind bucket n; n
-                    | n :: ns -> 
+                    | n :: ns ->
                         match n with
                         | Node(l,v',id,h) ->
                            if v = v' && idl = getId l && idh = getId h
@@ -104,7 +104,7 @@ let mkNode low v high =
 type ordering = LESS | EQUAL | GREATER
 
 let cmpVar (x : int) (y : int) =
-  if x<y then LESS else if x>y then GREATER else EQUAL 
+  if x<y then LESS else if x>y then GREATER else EQUAL
 
 let zero = Zero
 let one  = One
@@ -123,7 +123,7 @@ let notslot1  = Array.create cacheSize 0
 let notslot2  = Array.create cacheSize one
 let hash x y  = ((x lsl 1)+y) mod cacheSize
 
-let rec not n = 
+let rec not n =
 match n with
   Zero -> One
 | One  -> Zero
@@ -134,9 +134,9 @@ match n with
                                in
                                  notslot1.(h) <- id; notslot2.(h) <- f; f
 
-let rec and2 n1 n2 = 
+let rec and2 n1 n2 =
 match n1 with
-  Node(l1, v1, i1, r1) 
+  Node(l1, v1, i1, r1)
   -> (match n2 with
         Node(l2, v2, i2, r2)
         -> let h = hash i1 i2
@@ -147,8 +147,8 @@ match n1 with
                           | LESS    -> mkNode (and2 l1 n2) v1 (and2 r1 n2)
                           | GREATER -> mkNode (and2 n1 l2) v2 (and2 n1 r2)
                   in
-                   andslot1.(h) <- i1; 
-                   andslot2.(h) <- i2; 
+                   andslot1.(h) <- i1;
+                   andslot2.(h) <- i2;
                    andslot3.(h) <- f;
                    f
      | Zero -> Zero
@@ -157,9 +157,9 @@ match n1 with
 |  One  -> n2
 
 
-let rec xor n1 n2 = 
+let rec xor n1 n2 =
 match n1 with
-  Node(l1, v1, i1, r1) 
+  Node(l1, v1, i1, r1)
   -> (match n2 with
         Node(l2, v2, i2, r2)
         -> let h = hash i1 i2
@@ -174,19 +174,19 @@ match n1 with
                    andslot2.(h) <- i2;
                    andslot3.(h) <- f;
                    f
-     | Zero -> n1 
+     | Zero -> n1
      | One  -> not n1)
 |  Zero -> n2
 |  One  -> not n2
 
-let hwb n = 
+let hwb n =
   let rec h i j = if i=j
                   then mkVar i
                   else  xor (and2 (not(mkVar j)) (h i (j-1)))
                             (and2 (mkVar j)      (g i (j-1)))
       and g i j = if i=j
                   then mkVar i
-                  else xor (and2 (not(mkVar i)) (h (i+1) j)) 
+                  else xor (and2 (not(mkVar i)) (h (i+1) j))
                            (and2 (mkVar i)      (g (i+1) j))
   in
      h 0 (n-1)
index e3dafa38b4ae1c6d613b119f4431aea4ecc4b335..6b6e3f2e477f691eb8e869ee8c94a9f9eef3098b 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: boyer.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: boyer.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Manipulations over terms *)
 
@@ -29,7 +29,7 @@ let rec print_term = function
       print_string head.name;
       List.iter (fun t -> print_string " "; print_term t) argl;
       print_string ")"
+
 let lemmas = ref ([] : head list)
 
 (* Replacement for property lists *)
@@ -120,13 +120,13 @@ let add t = add_lemma (cterm_to_term t)
 let _ =
 add (CProp
 ("equal",
- [CProp ("compile",[CVar 5]); 
+ [CProp ("compile",[CVar 5]);
   CProp
   ("reverse",
    [CProp ("codegen",[CProp ("optimize",[CVar 5]); CProp ("nil",[])])])]));
 add (CProp
 ("equal",
- [CProp ("eqp",[CVar 23; CVar 24]); 
+ [CProp ("eqp",[CVar 23; CVar 24]);
   CProp ("equal",[CProp ("fix",[CVar 23]); CProp ("fix",[CVar 24])])]));
 add (CProp
 ("equal",
@@ -139,120 +139,120 @@ add (CProp
  [CProp ("ge",[CVar 23; CVar 24]); CProp ("le",[CVar 24; CVar 23])]));
 add (CProp
 ("equal",
- [CProp ("boolean",[CVar 23]); 
+ [CProp ("boolean",[CVar 23]);
   CProp
   ("or",
-   [CProp ("equal",[CVar 23; CProp ("true",[])]); 
+   [CProp ("equal",[CVar 23; CProp ("true",[])]);
     CProp ("equal",[CVar 23; CProp ("false",[])])])]));
 add (CProp
 ("equal",
- [CProp ("iff",[CVar 23; CVar 24]); 
+ [CProp ("iff",[CVar 23; CVar 24]);
   CProp
   ("and",
-   [CProp ("implies",[CVar 23; CVar 24]); 
+   [CProp ("implies",[CVar 23; CVar 24]);
     CProp ("implies",[CVar 24; CVar 23])])]));
 add (CProp
 ("equal",
- [CProp ("even1",[CVar 23]); 
+ [CProp ("even1",[CVar 23]);
   CProp
   ("if",
-   [CProp ("zerop",[CVar 23]); CProp ("true",[]); 
+   [CProp ("zerop",[CVar 23]); CProp ("true",[]);
     CProp ("odd",[CProp ("sub1",[CVar 23])])])]));
 add (CProp
 ("equal",
- [CProp ("countps_",[CVar 11; CVar 15]); 
+ [CProp ("countps_",[CVar 11; CVar 15]);
   CProp ("countps_loop",[CVar 11; CVar 15; CProp ("zero",[])])]));
 add (CProp
 ("equal",
- [CProp ("fact_",[CVar 8]); 
+ [CProp ("fact_",[CVar 8]);
   CProp ("fact_loop",[CVar 8; CProp ("one",[])])]));
 add (CProp
 ("equal",
- [CProp ("reverse_",[CVar 23]); 
+ [CProp ("reverse_",[CVar 23]);
   CProp ("reverse_loop",[CVar 23; CProp ("nil",[])])]));
 add (CProp
 ("equal",
- [CProp ("divides",[CVar 23; CVar 24]); 
+ [CProp ("divides",[CVar 23; CVar 24]);
   CProp ("zerop",[CProp ("remainder",[CVar 24; CVar 23])])]));
 add (CProp
 ("equal",
- [CProp ("assume_true",[CVar 21; CVar 0]); 
+ [CProp ("assume_true",[CVar 21; CVar 0]);
   CProp ("cons",[CProp ("cons",[CVar 21; CProp ("true",[])]); CVar 0])]));
 add (CProp
 ("equal",
- [CProp ("assume_false",[CVar 21; CVar 0]); 
+ [CProp ("assume_false",[CVar 21; CVar 0]);
   CProp ("cons",[CProp ("cons",[CVar 21; CProp ("false",[])]); CVar 0])]));
 add (CProp
 ("equal",
- [CProp ("tautology_checker",[CVar 23]); 
+ [CProp ("tautology_checker",[CVar 23]);
   CProp ("tautologyp",[CProp ("normalize",[CVar 23]); CProp ("nil",[])])]));
 add (CProp
 ("equal",
- [CProp ("falsify",[CVar 23]); 
+ [CProp ("falsify",[CVar 23]);
   CProp ("falsify1",[CProp ("normalize",[CVar 23]); CProp ("nil",[])])]));
 add (CProp
 ("equal",
- [CProp ("prime",[CVar 23]); 
+ [CProp ("prime",[CVar 23]);
   CProp
   ("and",
-   [CProp ("not",[CProp ("zerop",[CVar 23])]); 
+   [CProp ("not",[CProp ("zerop",[CVar 23])]);
     CProp
     ("not",
-     [CProp ("equal",[CVar 23; CProp ("add1",[CProp ("zero",[])])])]); 
+     [CProp ("equal",[CVar 23; CProp ("add1",[CProp ("zero",[])])])]);
     CProp ("prime1",[CVar 23; CProp ("sub1",[CVar 23])])])]));
 add (CProp
 ("equal",
- [CProp ("and",[CVar 15; CVar 16]); 
+ [CProp ("and",[CVar 15; CVar 16]);
   CProp
   ("if",
-   [CVar 15; 
-    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]); 
+   [CVar 15;
+    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
     CProp ("false",[])])]));
 add (CProp
 ("equal",
- [CProp ("or",[CVar 15; CVar 16]); 
+ [CProp ("or",[CVar 15; CVar 16]);
   CProp
   ("if",
-   [CVar 15; CProp ("true",[]); 
-    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]); 
+   [CVar 15; CProp ("true",[]);
+    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
     CProp ("false",[])])]));
 add (CProp
 ("equal",
- [CProp ("not",[CVar 15]); 
+ [CProp ("not",[CVar 15]);
   CProp ("if",[CVar 15; CProp ("false",[]); CProp ("true",[])])]));
 add (CProp
 ("equal",
- [CProp ("implies",[CVar 15; CVar 16]); 
+ [CProp ("implies",[CVar 15; CVar 16]);
   CProp
   ("if",
-   [CVar 15; 
-    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]); 
+   [CVar 15;
+    CProp ("if",[CVar 16; CProp ("true",[]); CProp ("false",[])]);
     CProp ("true",[])])]));
 add (CProp
 ("equal",
- [CProp ("fix",[CVar 23]); 
+ [CProp ("fix",[CVar 23]);
   CProp ("if",[CProp ("numberp",[CVar 23]); CVar 23; CProp ("zero",[])])]));
 add (CProp
 ("equal",
- [CProp ("if",[CProp ("if",[CVar 0; CVar 1; CVar 2]); CVar 3; CVar 4]); 
+ [CProp ("if",[CProp ("if",[CVar 0; CVar 1; CVar 2]); CVar 3; CVar 4]);
   CProp
   ("if",
-   [CVar 0; CProp ("if",[CVar 1; CVar 3; CVar 4]); 
+   [CVar 0; CProp ("if",[CVar 1; CVar 3; CVar 4]);
     CProp ("if",[CVar 2; CVar 3; CVar 4])])]));
 add (CProp
 ("equal",
- [CProp ("zerop",[CVar 23]); 
+ [CProp ("zerop",[CVar 23]);
   CProp
   ("or",
-   [CProp ("equal",[CVar 23; CProp ("zero",[])]); 
+   [CProp ("equal",[CVar 23; CProp ("zero",[])]);
     CProp ("not",[CProp ("numberp",[CVar 23])])])]));
 add (CProp
 ("equal",
- [CProp ("plus",[CProp ("plus",[CVar 23; CVar 24]); CVar 25]); 
+ [CProp ("plus",[CProp ("plus",[CVar 23; CVar 24]); CVar 25]);
   CProp ("plus",[CVar 23; CProp ("plus",[CVar 24; CVar 25])])]));
 add (CProp
 ("equal",
- [CProp ("equal",[CProp ("plus",[CVar 0; CVar 1]); CProp ("zero",[])]); 
+ [CProp ("equal",[CProp ("plus",[CVar 0; CVar 1]); CProp ("zero",[])]);
   CProp ("and",[CProp ("zerop",[CVar 0]); CProp ("zerop",[CVar 1])])]));
 add (CProp
 ("equal",[CProp ("difference",[CVar 23; CVar 23]); CProp ("zero",[])]));
@@ -260,90 +260,90 @@ add (CProp
 ("equal",
  [CProp
   ("equal",
-   [CProp ("plus",[CVar 0; CVar 1]); CProp ("plus",[CVar 0; CVar 2])]); 
+   [CProp ("plus",[CVar 0; CVar 1]); CProp ("plus",[CVar 0; CVar 2])]);
   CProp ("equal",[CProp ("fix",[CVar 1]); CProp ("fix",[CVar 2])])]));
 add (CProp
 ("equal",
  [CProp
-  ("equal",[CProp ("zero",[]); CProp ("difference",[CVar 23; CVar 24])]); 
+  ("equal",[CProp ("zero",[]); CProp ("difference",[CVar 23; CVar 24])]);
   CProp ("not",[CProp ("gt",[CVar 24; CVar 23])])]));
 add (CProp
 ("equal",
- [CProp ("equal",[CVar 23; CProp ("difference",[CVar 23; CVar 24])]); 
+ [CProp ("equal",[CVar 23; CProp ("difference",[CVar 23; CVar 24])]);
   CProp
   ("and",
-   [CProp ("numberp",[CVar 23]); 
+   [CProp ("numberp",[CVar 23]);
     CProp
     ("or",
-     [CProp ("equal",[CVar 23; CProp ("zero",[])]); 
+     [CProp ("equal",[CVar 23; CProp ("zero",[])]);
       CProp ("zerop",[CVar 24])])])]));
 add (CProp
 ("equal",
  [CProp
   ("meaning",
-   [CProp ("plus_tree",[CProp ("append",[CVar 23; CVar 24])]); CVar 0]); 
+   [CProp ("plus_tree",[CProp ("append",[CVar 23; CVar 24])]); CVar 0]);
   CProp
   ("plus",
-   [CProp ("meaning",[CProp ("plus_tree",[CVar 23]); CVar 0]); 
+   [CProp ("meaning",[CProp ("plus_tree",[CVar 23]); CVar 0]);
     CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0])])]));
 add (CProp
 ("equal",
  [CProp
   ("meaning",
-   [CProp ("plus_tree",[CProp ("plus_fringe",[CVar 23])]); CVar 0]); 
+   [CProp ("plus_tree",[CProp ("plus_fringe",[CVar 23])]); CVar 0]);
   CProp ("fix",[CProp ("meaning",[CVar 23; CVar 0])])]));
 add (CProp
 ("equal",
- [CProp ("append",[CProp ("append",[CVar 23; CVar 24]); CVar 25]); 
+ [CProp ("append",[CProp ("append",[CVar 23; CVar 24]); CVar 25]);
   CProp ("append",[CVar 23; CProp ("append",[CVar 24; CVar 25])])]));
 add (CProp
 ("equal",
- [CProp ("reverse",[CProp ("append",[CVar 0; CVar 1])]); 
+ [CProp ("reverse",[CProp ("append",[CVar 0; CVar 1])]);
   CProp
   ("append",[CProp ("reverse",[CVar 1]); CProp ("reverse",[CVar 0])])]));
 add (CProp
 ("equal",
- [CProp ("times",[CVar 23; CProp ("plus",[CVar 24; CVar 25])]); 
+ [CProp ("times",[CVar 23; CProp ("plus",[CVar 24; CVar 25])]);
   CProp
   ("plus",
-   [CProp ("times",[CVar 23; CVar 24]); 
+   [CProp ("times",[CVar 23; CVar 24]);
     CProp ("times",[CVar 23; CVar 25])])]));
 add (CProp
 ("equal",
- [CProp ("times",[CProp ("times",[CVar 23; CVar 24]); CVar 25]); 
+ [CProp ("times",[CProp ("times",[CVar 23; CVar 24]); CVar 25]);
   CProp ("times",[CVar 23; CProp ("times",[CVar 24; CVar 25])])]));
 add (CProp
 ("equal",
  [CProp
-  ("equal",[CProp ("times",[CVar 23; CVar 24]); CProp ("zero",[])]); 
+  ("equal",[CProp ("times",[CVar 23; CVar 24]); CProp ("zero",[])]);
   CProp ("or",[CProp ("zerop",[CVar 23]); CProp ("zerop",[CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("exec",[CProp ("append",[CVar 23; CVar 24]); CVar 15; CVar 4]); 
+ [CProp ("exec",[CProp ("append",[CVar 23; CVar 24]); CVar 15; CVar 4]);
   CProp
   ("exec",[CVar 24; CProp ("exec",[CVar 23; CVar 15; CVar 4]); CVar 4])]));
 add (CProp
 ("equal",
- [CProp ("mc_flatten",[CVar 23; CVar 24]); 
+ [CProp ("mc_flatten",[CVar 23; CVar 24]);
   CProp ("append",[CProp ("flatten",[CVar 23]); CVar 24])]));
 add (CProp
 ("equal",
- [CProp ("member",[CVar 23; CProp ("append",[CVar 0; CVar 1])]); 
+ [CProp ("member",[CVar 23; CProp ("append",[CVar 0; CVar 1])]);
   CProp
   ("or",
-   [CProp ("member",[CVar 23; CVar 0]); 
+   [CProp ("member",[CVar 23; CVar 0]);
     CProp ("member",[CVar 23; CVar 1])])]));
 add (CProp
 ("equal",
- [CProp ("member",[CVar 23; CProp ("reverse",[CVar 24])]); 
+ [CProp ("member",[CVar 23; CProp ("reverse",[CVar 24])]);
   CProp ("member",[CVar 23; CVar 24])]));
 add (CProp
 ("equal",
- [CProp ("length",[CProp ("reverse",[CVar 23])]); 
+ [CProp ("length",[CProp ("reverse",[CVar 23])]);
   CProp ("length",[CVar 23])]));
 add (CProp
 ("equal",
- [CProp ("member",[CVar 0; CProp ("intersect",[CVar 1; CVar 2])]); 
+ [CProp ("member",[CVar 0; CProp ("intersect",[CVar 1; CVar 2])]);
   CProp
   ("and",
    [CProp ("member",[CVar 0; CVar 1]); CProp ("member",[CVar 0; CVar 2])])]));
@@ -351,89 +351,89 @@ add (CProp
 ("equal",[CProp ("nth",[CProp ("zero",[]); CVar 8]); CProp ("zero",[])]));
 add (CProp
 ("equal",
- [CProp ("exp",[CVar 8; CProp ("plus",[CVar 9; CVar 10])]); 
+ [CProp ("exp",[CVar 8; CProp ("plus",[CVar 9; CVar 10])]);
   CProp
   ("times",
    [CProp ("exp",[CVar 8; CVar 9]); CProp ("exp",[CVar 8; CVar 10])])]));
 add (CProp
 ("equal",
- [CProp ("exp",[CVar 8; CProp ("times",[CVar 9; CVar 10])]); 
+ [CProp ("exp",[CVar 8; CProp ("times",[CVar 9; CVar 10])]);
   CProp ("exp",[CProp ("exp",[CVar 8; CVar 9]); CVar 10])]));
 add (CProp
 ("equal",
- [CProp ("reverse_loop",[CVar 23; CVar 24]); 
+ [CProp ("reverse_loop",[CVar 23; CVar 24]);
   CProp ("append",[CProp ("reverse",[CVar 23]); CVar 24])]));
 add (CProp
 ("equal",
- [CProp ("reverse_loop",[CVar 23; CProp ("nil",[])]); 
+ [CProp ("reverse_loop",[CVar 23; CProp ("nil",[])]);
   CProp ("reverse",[CVar 23])]));
 add (CProp
 ("equal",
- [CProp ("count_list",[CVar 25; CProp ("sort_lp",[CVar 23; CVar 24])]); 
+ [CProp ("count_list",[CVar 25; CProp ("sort_lp",[CVar 23; CVar 24])]);
   CProp
   ("plus",
-   [CProp ("count_list",[CVar 25; CVar 23]); 
+   [CProp ("count_list",[CVar 25; CVar 23]);
     CProp ("count_list",[CVar 25; CVar 24])])]));
 add (CProp
 ("equal",
  [CProp
   ("equal",
-   [CProp ("append",[CVar 0; CVar 1]); CProp ("append",[CVar 0; CVar 2])]); 
+   [CProp ("append",[CVar 0; CVar 1]); CProp ("append",[CVar 0; CVar 2])]);
   CProp ("equal",[CVar 1; CVar 2])]));
 add (CProp
 ("equal",
  [CProp
   ("plus",
-   [CProp ("remainder",[CVar 23; CVar 24]); 
-    CProp ("times",[CVar 24; CProp ("quotient",[CVar 23; CVar 24])])]); 
+   [CProp ("remainder",[CVar 23; CVar 24]);
+    CProp ("times",[CVar 24; CProp ("quotient",[CVar 23; CVar 24])])]);
   CProp ("fix",[CVar 23])]));
 add (CProp
 ("equal",
  [CProp
-  ("power_eval",[CProp ("big_plus",[CVar 11; CVar 8; CVar 1]); CVar 1]); 
+  ("power_eval",[CProp ("big_plus",[CVar 11; CVar 8; CVar 1]); CVar 1]);
   CProp ("plus",[CProp ("power_eval",[CVar 11; CVar 1]); CVar 8])]));
 add (CProp
 ("equal",
  [CProp
   ("power_eval",
-   [CProp ("big_plus",[CVar 23; CVar 24; CVar 8; CVar 1]); CVar 1]); 
+   [CProp ("big_plus",[CVar 23; CVar 24; CVar 8; CVar 1]); CVar 1]);
   CProp
   ("plus",
-   [CVar 8; 
+   [CVar 8;
     CProp
     ("plus",
-     [CProp ("power_eval",[CVar 23; CVar 1]); 
+     [CProp ("power_eval",[CVar 23; CVar 1]);
       CProp ("power_eval",[CVar 24; CVar 1])])])]));
 add (CProp
 ("equal",
  [CProp ("remainder",[CVar 24; CProp ("one",[])]); CProp ("zero",[])]));
 add (CProp
 ("equal",
- [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 24]); 
+ [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 24]);
   CProp ("not",[CProp ("zerop",[CVar 24])])]));
 add (CProp
 ("equal",[CProp ("remainder",[CVar 23; CVar 23]); CProp ("zero",[])]));
 add (CProp
 ("equal",
- [CProp ("lt",[CProp ("quotient",[CVar 8; CVar 9]); CVar 8]); 
+ [CProp ("lt",[CProp ("quotient",[CVar 8; CVar 9]); CVar 8]);
   CProp
   ("and",
-   [CProp ("not",[CProp ("zerop",[CVar 8])]); 
+   [CProp ("not",[CProp ("zerop",[CVar 8])]);
     CProp
     ("or",
-     [CProp ("zerop",[CVar 9]); 
+     [CProp ("zerop",[CVar 9]);
       CProp ("not",[CProp ("equal",[CVar 9; CProp ("one",[])])])])])]));
 add (CProp
 ("equal",
- [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 23]); 
+ [CProp ("lt",[CProp ("remainder",[CVar 23; CVar 24]); CVar 23]);
   CProp
   ("and",
-   [CProp ("not",[CProp ("zerop",[CVar 24])]); 
-    CProp ("not",[CProp ("zerop",[CVar 23])]); 
+   [CProp ("not",[CProp ("zerop",[CVar 24])]);
+    CProp ("not",[CProp ("zerop",[CVar 23])]);
     CProp ("not",[CProp ("lt",[CVar 23; CVar 24])])])]));
 add (CProp
 ("equal",
- [CProp ("power_eval",[CProp ("power_rep",[CVar 8; CVar 1]); CVar 1]); 
+ [CProp ("power_eval",[CProp ("power_rep",[CVar 8; CVar 1]); CVar 1]);
   CProp ("fix",[CVar 8])]));
 add (CProp
 ("equal",
@@ -441,199 +441,199 @@ add (CProp
   ("power_eval",
    [CProp
     ("big_plus",
-     [CProp ("power_rep",[CVar 8; CVar 1]); 
-      CProp ("power_rep",[CVar 9; CVar 1]); CProp ("zero",[]); 
-      CVar 1]); 
-    CVar 1]); 
+     [CProp ("power_rep",[CVar 8; CVar 1]);
+      CProp ("power_rep",[CVar 9; CVar 1]); CProp ("zero",[]);
+      CVar 1]);
+    CVar 1]);
   CProp ("plus",[CVar 8; CVar 9])]));
 add (CProp
 ("equal",
  [CProp ("gcd",[CVar 23; CVar 24]); CProp ("gcd",[CVar 24; CVar 23])]));
 add (CProp
 ("equal",
- [CProp ("nth",[CProp ("append",[CVar 0; CVar 1]); CVar 8]); 
+ [CProp ("nth",[CProp ("append",[CVar 0; CVar 1]); CVar 8]);
   CProp
   ("append",
-   [CProp ("nth",[CVar 0; CVar 8]); 
+   [CProp ("nth",[CVar 0; CVar 8]);
     CProp
     ("nth",
      [CVar 1; CProp ("difference",[CVar 8; CProp ("length",[CVar 0])])])])]));
 add (CProp
 ("equal",
- [CProp ("difference",[CProp ("plus",[CVar 23; CVar 24]); CVar 23]); 
+ [CProp ("difference",[CProp ("plus",[CVar 23; CVar 24]); CVar 23]);
   CProp ("fix",[CVar 24])]));
 add (CProp
 ("equal",
- [CProp ("difference",[CProp ("plus",[CVar 24; CVar 23]); CVar 23]); 
+ [CProp ("difference",[CProp ("plus",[CVar 24; CVar 23]); CVar 23]);
   CProp ("fix",[CVar 24])]));
 add (CProp
 ("equal",
  [CProp
   ("difference",
-   [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]); 
+   [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]);
   CProp ("difference",[CVar 24; CVar 25])]));
 add (CProp
 ("equal",
- [CProp ("times",[CVar 23; CProp ("difference",[CVar 2; CVar 22])]); 
+ [CProp ("times",[CVar 23; CProp ("difference",[CVar 2; CVar 22])]);
   CProp
   ("difference",
-   [CProp ("times",[CVar 2; CVar 23]); 
+   [CProp ("times",[CVar 2; CVar 23]);
     CProp ("times",[CVar 22; CVar 23])])]));
 add (CProp
 ("equal",
- [CProp ("remainder",[CProp ("times",[CVar 23; CVar 25]); CVar 25]); 
+ [CProp ("remainder",[CProp ("times",[CVar 23; CVar 25]); CVar 25]);
   CProp ("zero",[])]));
 add (CProp
 ("equal",
  [CProp
   ("difference",
-   [CProp ("plus",[CVar 1; CProp ("plus",[CVar 0; CVar 2])]); CVar 0]); 
+   [CProp ("plus",[CVar 1; CProp ("plus",[CVar 0; CVar 2])]); CVar 0]);
   CProp ("plus",[CVar 1; CVar 2])]));
 add (CProp
 ("equal",
  [CProp
   ("difference",
-   [CProp ("add1",[CProp ("plus",[CVar 24; CVar 25])]); CVar 25]); 
+   [CProp ("add1",[CProp ("plus",[CVar 24; CVar 25])]); CVar 25]);
   CProp ("add1",[CVar 24])]));
 add (CProp
 ("equal",
  [CProp
   ("lt",
-   [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]); 
+   [CProp ("plus",[CVar 23; CVar 24]); CProp ("plus",[CVar 23; CVar 25])]);
   CProp ("lt",[CVar 24; CVar 25])]));
 add (CProp
 ("equal",
  [CProp
   ("lt",
-   [CProp ("times",[CVar 23; CVar 25]); 
-    CProp ("times",[CVar 24; CVar 25])]); 
+   [CProp ("times",[CVar 23; CVar 25]);
+    CProp ("times",[CVar 24; CVar 25])]);
   CProp
   ("and",
-   [CProp ("not",[CProp ("zerop",[CVar 25])]); 
+   [CProp ("not",[CProp ("zerop",[CVar 25])]);
     CProp ("lt",[CVar 23; CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("lt",[CVar 24; CProp ("plus",[CVar 23; CVar 24])]); 
+ [CProp ("lt",[CVar 24; CProp ("plus",[CVar 23; CVar 24])]);
   CProp ("not",[CProp ("zerop",[CVar 23])])]));
 add (CProp
 ("equal",
  [CProp
   ("gcd",
-   [CProp ("times",[CVar 23; CVar 25]); 
-    CProp ("times",[CVar 24; CVar 25])]); 
+   [CProp ("times",[CVar 23; CVar 25]);
+    CProp ("times",[CVar 24; CVar 25])]);
   CProp ("times",[CVar 25; CProp ("gcd",[CVar 23; CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("value",[CProp ("normalize",[CVar 23]); CVar 0]); 
+ [CProp ("value",[CProp ("normalize",[CVar 23]); CVar 0]);
   CProp ("value",[CVar 23; CVar 0])]));
 add (CProp
 ("equal",
  [CProp
   ("equal",
-   [CProp ("flatten",[CVar 23]); 
-    CProp ("cons",[CVar 24; CProp ("nil",[])])]); 
+   [CProp ("flatten",[CVar 23]);
+    CProp ("cons",[CVar 24; CProp ("nil",[])])]);
   CProp
   ("and",
    [CProp ("nlistp",[CVar 23]); CProp ("equal",[CVar 23; CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("listp",[CProp ("gother",[CVar 23])]); 
+ [CProp ("listp",[CProp ("gother",[CVar 23])]);
   CProp ("listp",[CVar 23])]));
 add (CProp
 ("equal",
- [CProp ("samefringe",[CVar 23; CVar 24]); 
+ [CProp ("samefringe",[CVar 23; CVar 24]);
   CProp
   ("equal",[CProp ("flatten",[CVar 23]); CProp ("flatten",[CVar 24])])]));
 add (CProp
 ("equal",
  [CProp
   ("equal",
-   [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("zero",[])]); 
+   [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("zero",[])]);
   CProp
   ("and",
    [CProp
     ("or",
-     [CProp ("zerop",[CVar 24]); 
-      CProp ("equal",[CVar 24; CProp ("one",[])])]); 
+     [CProp ("zerop",[CVar 24]);
+      CProp ("equal",[CVar 24; CProp ("one",[])])]);
     CProp ("equal",[CVar 23; CProp ("zero",[])])])]));
 add (CProp
 ("equal",
  [CProp
   ("equal",
-   [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("one",[])]); 
+   [CProp ("greatest_factor",[CVar 23; CVar 24]); CProp ("one",[])]);
   CProp ("equal",[CVar 23; CProp ("one",[])])]));
 add (CProp
 ("equal",
- [CProp ("numberp",[CProp ("greatest_factor",[CVar 23; CVar 24])]); 
+ [CProp ("numberp",[CProp ("greatest_factor",[CVar 23; CVar 24])]);
   CProp
   ("not",
    [CProp
     ("and",
      [CProp
       ("or",
-       [CProp ("zerop",[CVar 24]); 
-        CProp ("equal",[CVar 24; CProp ("one",[])])]); 
+       [CProp ("zerop",[CVar 24]);
+        CProp ("equal",[CVar 24; CProp ("one",[])])]);
       CProp ("not",[CProp ("numberp",[CVar 23])])])])]));
 add (CProp
 ("equal",
- [CProp ("times_list",[CProp ("append",[CVar 23; CVar 24])]); 
+ [CProp ("times_list",[CProp ("append",[CVar 23; CVar 24])]);
   CProp
   ("times",
    [CProp ("times_list",[CVar 23]); CProp ("times_list",[CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("prime_list",[CProp ("append",[CVar 23; CVar 24])]); 
+ [CProp ("prime_list",[CProp ("append",[CVar 23; CVar 24])]);
   CProp
   ("and",
    [CProp ("prime_list",[CVar 23]); CProp ("prime_list",[CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("equal",[CVar 25; CProp ("times",[CVar 22; CVar 25])]); 
+ [CProp ("equal",[CVar 25; CProp ("times",[CVar 22; CVar 25])]);
   CProp
   ("and",
-   [CProp ("numberp",[CVar 25]); 
+   [CProp ("numberp",[CVar 25]);
     CProp
     ("or",
-     [CProp ("equal",[CVar 25; CProp ("zero",[])]); 
+     [CProp ("equal",[CVar 25; CProp ("zero",[])]);
       CProp ("equal",[CVar 22; CProp ("one",[])])])])]));
 add (CProp
 ("equal",
- [CProp ("ge",[CVar 23; CVar 24]); 
+ [CProp ("ge",[CVar 23; CVar 24]);
   CProp ("not",[CProp ("lt",[CVar 23; CVar 24])])]));
 add (CProp
 ("equal",
- [CProp ("equal",[CVar 23; CProp ("times",[CVar 23; CVar 24])]); 
+ [CProp ("equal",[CVar 23; CProp ("times",[CVar 23; CVar 24])]);
   CProp
   ("or",
-   [CProp ("equal",[CVar 23; CProp ("zero",[])]); 
+   [CProp ("equal",[CVar 23; CProp ("zero",[])]);
     CProp
     ("and",
-     [CProp ("numberp",[CVar 23]); 
+     [CProp ("numberp",[CVar 23]);
       CProp ("equal",[CVar 24; CProp ("one",[])])])])]));
 add (CProp
 ("equal",
- [CProp ("remainder",[CProp ("times",[CVar 24; CVar 23]); CVar 24]); 
+ [CProp ("remainder",[CProp ("times",[CVar 24; CVar 23]); CVar 24]);
   CProp ("zero",[])]));
 add (CProp
 ("equal",
- [CProp ("equal",[CProp ("times",[CVar 0; CVar 1]); CProp ("one",[])]); 
+ [CProp ("equal",[CProp ("times",[CVar 0; CVar 1]); CProp ("one",[])]);
   CProp
   ("and",
-   [CProp ("not",[CProp ("equal",[CVar 0; CProp ("zero",[])])]); 
-    CProp ("not",[CProp ("equal",[CVar 1; CProp ("zero",[])])]); 
-    CProp ("numberp",[CVar 0]); CProp ("numberp",[CVar 1]); 
-    CProp ("equal",[CProp ("sub1",[CVar 0]); CProp ("zero",[])]); 
+   [CProp ("not",[CProp ("equal",[CVar 0; CProp ("zero",[])])]);
+    CProp ("not",[CProp ("equal",[CVar 1; CProp ("zero",[])])]);
+    CProp ("numberp",[CVar 0]); CProp ("numberp",[CVar 1]);
+    CProp ("equal",[CProp ("sub1",[CVar 0]); CProp ("zero",[])]);
     CProp ("equal",[CProp ("sub1",[CVar 1]); CProp ("zero",[])])])]));
 add (CProp
 ("equal",
  [CProp
   ("lt",
-   [CProp ("length",[CProp ("delete",[CVar 23; CVar 11])]); 
-    CProp ("length",[CVar 11])]); 
+   [CProp ("length",[CProp ("delete",[CVar 23; CVar 11])]);
+    CProp ("length",[CVar 11])]);
   CProp ("member",[CVar 23; CVar 11])]));
 add (CProp
 ("equal",
- [CProp ("sort2",[CProp ("delete",[CVar 23; CVar 11])]); 
+ [CProp ("sort2",[CProp ("delete",[CVar 23; CVar 11])]);
   CProp ("delete",[CVar 23; CProp ("sort2",[CVar 11])])]));
 add (CProp ("equal",[CProp ("dsort",[CVar 23]); CProp ("sort2",[CVar 23])]));
 add (CProp
@@ -642,145 +642,145 @@ add (CProp
   ("length",
    [CProp
     ("cons",
-     [CVar 0; 
+     [CVar 0;
       CProp
       ("cons",
-       [CVar 1; 
+       [CVar 1;
         CProp
         ("cons",
-         [CVar 2; 
+         [CVar 2;
           CProp
           ("cons",
-           [CVar 3; 
+           [CVar 3;
             CProp ("cons",[CVar 4; CProp ("cons",[CVar 5; CVar 6])])])])])])])
   ; CProp ("plus",[CProp ("six",[]); CProp ("length",[CVar 6])])]));
 add (CProp
 ("equal",
  [CProp
   ("difference",
-   [CProp ("add1",[CProp ("add1",[CVar 23])]); CProp ("two",[])]); 
+   [CProp ("add1",[CProp ("add1",[CVar 23])]); CProp ("two",[])]);
   CProp ("fix",[CVar 23])]));
 add (CProp
 ("equal",
  [CProp
   ("quotient",
-   [CProp ("plus",[CVar 23; CProp ("plus",[CVar 23; CVar 24])]); 
-    CProp ("two",[])]); 
+   [CProp ("plus",[CVar 23; CProp ("plus",[CVar 23; CVar 24])]);
+    CProp ("two",[])]);
   CProp
   ("plus",[CVar 23; CProp ("quotient",[CVar 24; CProp ("two",[])])])]));
 add (CProp
 ("equal",
- [CProp ("sigma",[CProp ("zero",[]); CVar 8]); 
+ [CProp ("sigma",[CProp ("zero",[]); CVar 8]);
   CProp
   ("quotient",
    [CProp ("times",[CVar 8; CProp ("add1",[CVar 8])]); CProp ("two",[])])]));
 add (CProp
 ("equal",
- [CProp ("plus",[CVar 23; CProp ("add1",[CVar 24])]); 
+ [CProp ("plus",[CVar 23; CProp ("add1",[CVar 24])]);
   CProp
   ("if",
-   [CProp ("numberp",[CVar 24]); 
-    CProp ("add1",[CProp ("plus",[CVar 23; CVar 24])]); 
+   [CProp ("numberp",[CVar 24]);
+    CProp ("add1",[CProp ("plus",[CVar 23; CVar 24])]);
     CProp ("add1",[CVar 23])])]));
 add (CProp
 ("equal",
  [CProp
   ("equal",
-   [CProp ("difference",[CVar 23; CVar 24]); 
-    CProp ("difference",[CVar 25; CVar 24])]); 
+   [CProp ("difference",[CVar 23; CVar 24]);
+    CProp ("difference",[CVar 25; CVar 24])]);
   CProp
   ("if",
-   [CProp ("lt",[CVar 23; CVar 24]); 
-    CProp ("not",[CProp ("lt",[CVar 24; CVar 25])]); 
+   [CProp ("lt",[CVar 23; CVar 24]);
+    CProp ("not",[CProp ("lt",[CVar 24; CVar 25])]);
     CProp
     ("if",
-     [CProp ("lt",[CVar 25; CVar 24]); 
-      CProp ("not",[CProp ("lt",[CVar 24; CVar 23])]); 
+     [CProp ("lt",[CVar 25; CVar 24]);
+      CProp ("not",[CProp ("lt",[CVar 24; CVar 23])]);
       CProp ("equal",[CProp ("fix",[CVar 23]); CProp ("fix",[CVar 25])])])])])
 );
 add (CProp
 ("equal",
  [CProp
   ("meaning",
-   [CProp ("plus_tree",[CProp ("delete",[CVar 23; CVar 24])]); CVar 0]); 
+   [CProp ("plus_tree",[CProp ("delete",[CVar 23; CVar 24])]); CVar 0]);
   CProp
   ("if",
-   [CProp ("member",[CVar 23; CVar 24]); 
+   [CProp ("member",[CVar 23; CVar 24]);
     CProp
     ("difference",
-     [CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0]); 
-      CProp ("meaning",[CVar 23; CVar 0])]); 
+     [CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0]);
+      CProp ("meaning",[CVar 23; CVar 0])]);
     CProp ("meaning",[CProp ("plus_tree",[CVar 24]); CVar 0])])]));
 add (CProp
 ("equal",
- [CProp ("times",[CVar 23; CProp ("add1",[CVar 24])]); 
+ [CProp ("times",[CVar 23; CProp ("add1",[CVar 24])]);
   CProp
   ("if",
-   [CProp ("numberp",[CVar 24]); 
+   [CProp ("numberp",[CVar 24]);
     CProp
     ("plus",
-     [CVar 23; CProp ("times",[CVar 23; CVar 24]); 
+     [CVar 23; CProp ("times",[CVar 23; CVar 24]);
       CProp ("fix",[CVar 23])])])]));
 add (CProp
 ("equal",
- [CProp ("nth",[CProp ("nil",[]); CVar 8]); 
+ [CProp ("nth",[CProp ("nil",[]); CVar 8]);
   CProp
   ("if",[CProp ("zerop",[CVar 8]); CProp ("nil",[]); CProp ("zero",[])])]));
 add (CProp
 ("equal",
- [CProp ("last",[CProp ("append",[CVar 0; CVar 1])]); 
+ [CProp ("last",[CProp ("append",[CVar 0; CVar 1])]);
   CProp
   ("if",
-   [CProp ("listp",[CVar 1]); CProp ("last",[CVar 1]); 
+   [CProp ("listp",[CVar 1]); CProp ("last",[CVar 1]);
     CProp
     ("if",
-     [CProp ("listp",[CVar 0]); 
-      CProp ("cons",[CProp ("car",[CProp ("last",[CVar 0])]); CVar 1]); 
+     [CProp ("listp",[CVar 0]);
+      CProp ("cons",[CProp ("car",[CProp ("last",[CVar 0])]); CVar 1]);
       CVar 1])])]));
 add (CProp
 ("equal",
- [CProp ("equal",[CProp ("lt",[CVar 23; CVar 24]); CVar 25]); 
+ [CProp ("equal",[CProp ("lt",[CVar 23; CVar 24]); CVar 25]);
   CProp
   ("if",
-   [CProp ("lt",[CVar 23; CVar 24]); 
-    CProp ("equal",[CProp ("true",[]); CVar 25]); 
+   [CProp ("lt",[CVar 23; CVar 24]);
+    CProp ("equal",[CProp ("true",[]); CVar 25]);
     CProp ("equal",[CProp ("false",[]); CVar 25])])]));
 add (CProp
 ("equal",
- [CProp ("assignment",[CVar 23; CProp ("append",[CVar 0; CVar 1])]); 
+ [CProp ("assignment",[CVar 23; CProp ("append",[CVar 0; CVar 1])]);
   CProp
   ("if",
-   [CProp ("assignedp",[CVar 23; CVar 0]); 
-    CProp ("assignment",[CVar 23; CVar 0]); 
+   [CProp ("assignedp",[CVar 23; CVar 0]);
+    CProp ("assignment",[CVar 23; CVar 0]);
     CProp ("assignment",[CVar 23; CVar 1])])]));
 add (CProp
 ("equal",
- [CProp ("car",[CProp ("gother",[CVar 23])]); 
+ [CProp ("car",[CProp ("gother",[CVar 23])]);
   CProp
   ("if",
-   [CProp ("listp",[CVar 23]); 
+   [CProp ("listp",[CVar 23]);
     CProp ("car",[CProp ("flatten",[CVar 23])]); CProp ("zero",[])])]));
 add (CProp
 ("equal",
- [CProp ("flatten",[CProp ("cdr",[CProp ("gother",[CVar 23])])]); 
+ [CProp ("flatten",[CProp ("cdr",[CProp ("gother",[CVar 23])])]);
   CProp
   ("if",
-   [CProp ("listp",[CVar 23]); 
-    CProp ("cdr",[CProp ("flatten",[CVar 23])]); 
+   [CProp ("listp",[CVar 23]);
+    CProp ("cdr",[CProp ("flatten",[CVar 23])]);
     CProp ("cons",[CProp ("zero",[]); CProp ("nil",[])])])]));
 add (CProp
 ("equal",
- [CProp ("quotient",[CProp ("times",[CVar 24; CVar 23]); CVar 24]); 
+ [CProp ("quotient",[CProp ("times",[CVar 24; CVar 23]); CVar 24]);
   CProp
   ("if",
-   [CProp ("zerop",[CVar 24]); CProp ("zero",[]); 
+   [CProp ("zerop",[CVar 24]); CProp ("zero",[]);
     CProp ("fix",[CVar 23])])]));
 add (CProp
 ("equal",
- [CProp ("get",[CVar 9; CProp ("set",[CVar 8; CVar 21; CVar 12])]); 
+ [CProp ("get",[CVar 9; CProp ("set",[CVar 8; CVar 21; CVar 12])]);
   CProp
   ("if",
-   [CProp ("eqp",[CVar 9; CVar 8]); CVar 21; 
+   [CProp ("eqp",[CVar 9; CVar 8]); CVar 21;
     CProp ("get",[CVar 9; CVar 12])])]))
 
 (* Tautology checker *)
@@ -822,7 +822,7 @@ let rec tautologyp x true_lst false_lst =
   end
 
 
-let tautp x = 
+let tautp x =
 (*  print_term x; print_string"\n"; *)
   let y = rewrite x in
 (*    print_term y; print_string "\n"; *)
index 7919670c9ef5b68ff725e08181c46fbdf3b745c7..71fe1610031d79a143c65cbd2e233a3c3f0b4fa8 100644 (file)
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: fib.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: fib.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 let rec fib n =
   if n < 2 then 1 else fib(n-1) + fib(n-2)
 
 let _ =
   let n =
-    if Array.length Sys.argv >= 2 
+    if Array.length Sys.argv >= 2
     then int_of_string Sys.argv.(1)
     else 40 in
   print_int(fib n); print_newline(); exit 0
-
index 542c9579a8ae6bf07acb1ba3d6a1fa58653cdac5..09c8c483d3e44dbf607ca750535eaa507abbff8c 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: nucleic.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: nucleic.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Use floating-point arithmetic *)
 
@@ -60,14 +60,14 @@ pt_theta p
    matrices don't have the perspective terms and are the transpose of
    Paul's one.  See also "M\"antyl\"a, M. (1985) An Introduction to
    Solid Modeling, Computer Science Press" Appendix A.
-  
+
    The components of a transformation matrix are named like this:
-  
+
     a  b  c
     d  e  f
     g  h  i
    tx ty tz
-  
+
    The components tx, ty, and tz are the translation vector.
 *)
 
@@ -208,7 +208,7 @@ tfo_align p1 p2 p3
 
 (*
    Numbering of atoms follows the paper:
-  
+
    IUPAC-IUB Joint Commission on Biochemical Nomenclature (JCBN)
    (1983) Abbreviations and Symbols for the Description of
    Conformations of Polynucleotide Chains.  Eur. J. Biochem 131,
@@ -273,7 +273,7 @@ nuc_C1'
   = c1'
 
 let
-nuc_C2 
+nuc_C2
 (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
    p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
    c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
@@ -287,7 +287,7 @@ nuc_C3'
   = c3'
 
 let
-nuc_C4 
+nuc_C4
 (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
    p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
    c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
@@ -301,7 +301,7 @@ nuc_C4'
   = c4'
 
 let
-nuc_N1 
+nuc_N1
 (N(dgf_base_tfo,p_o3'_275_tfo,p_o3'_180_tfo,p_o3'_60_tfo,
    p,o1p,o2p,o5',c5',h5',h5'',c4',h4',o4',c1',h1',c2',h2'',o2',h2',
    c3',h3',o3',n1,n3,c2,c4,c5,c6,_))
@@ -2896,13 +2896,13 @@ let rec search (partial_inst : variable list) l constr =
 (* -- DOMAINS ---------------------------------------------------------------*)
 
 (* Primary structure:   strand A CUGCCACGUCUG, strand B CAGACGUGGCAG
-  
+
    Secondary structure: strand A CUGCCACGUCUG
                                  ||||||||||||
                                  GACGGUGCAGAC strand B
-  
+
    Tertiary structure:
-  
+
       5' end of strand A C1----G12 3' end of strand B
                        U2-------A11
                       G3-------C10
@@ -2915,13 +2915,13 @@ let rec search (partial_inst : variable list) l constr =
                       G3--------C10
                        A2-------U11
      5' end of strand B C1----G12 3' end of strand A
-  
+
    "helix", "stacked" and "connected" describe the spatial relationship
    between two consecutive nucleotides. E.g. the nucleotides C1 and U2
    from the strand A.
-  
+
    "wc" (stands for Watson-Crick and is a type of base-pairing),
-   and "wc-dumas" describe the spatial relationship between 
+   and "wc-dumas" describe the spatial relationship between
    nucleotides from two chains that are growing in opposite directions.
    E.g. the nucleotides C1 from strand A and G12 from strand B.
 *)
@@ -2965,7 +2965,7 @@ let
 reference n i partial_inst = [ mk_var i tfo_id n ]
 
 (* The transformation matrix for wc is from:
-  
+
    Chandrasekaran R. et al (1989) A Re-Examination of the Crystal
    Structure of A-DNA Using Fiber Diffraction Data. J. Biomol.
    Struct. & Dynamics 6(6):1189-1202.
@@ -3047,7 +3047,7 @@ let
 a38_g37 nucl i j partial_inst
   = mk_var i (dgf_base a38_g37_tfo (get_var j partial_inst) nucl) nucl
 
-let   
+let
 stacked3' nucl i j partial_inst
   = (a38_g37 nucl i j partial_inst) :: (helix3' nucl i j partial_inst)
 
@@ -3146,7 +3146,7 @@ pseudoknot_domains
      stacked5' rU   5  4; (*   | 4.5 Angstroms *)
      stacked5' rC   6  5  (* <-'               *)
     ]
-  
+
 (* Pseudoknot constraint *)
 
 let
@@ -3212,7 +3212,7 @@ var_most_distant_atom v =
   let max_dist = ref 0.0 in
   for i = 0 to pred (Array.length atoms) do
     let p = atoms.(i) in
-    let distance = 
+    let distance =
       let pos = absolute_pos v p
       in sqrt ((pos.x * pos.x) + (pos.y * pos.y) + (pos.z * pos.z)) in
     if distance > !max_dist then max_dist := distance
index c36f304d69bc1b885f08c8ed4431971fa93194ed..0e8685f16e0c6df9e89e4a633779f7ed57805215 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: sieve.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: sieve.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Eratosthene's sieve *)
 
@@ -51,6 +51,6 @@ let rec do_list f = function
 
 
 let _ =
-  do_list (fun n -> print_int n; print_string " ") (sieve 50000);
+  do_list (fun n -> print_string " "; print_int n) (sieve 50000);
   print_newline();
   exit 0
index eb96be005a8b96c1ffcc0ea16694b1e9b02d3417..24f5cc544ac0275f8adc50c686a57ff58755b30a 100644 (file)
@@ -1 +1 @@
-2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003 5009 5011 5021 5023 5039 5051 5059 5077 5081 5087 5099 5101 5107 5113 5119 5147 5153 5167 5171 5179 5189 5197 5209 5227 5231 5233 5237 5261 5273 5279 5281 5297 5303 5309 5323 5333 5347 5351 5381 5387 5393 5399 5407 5413 5417 5419 5431 5437 5441 5443 5449 5471 5477 5479 5483 5501 5503 5507 5519 5521 5527 5531 5557 5563 5569 5573 5581 5591 5623 5639 5641 5647 5651 5653 5657 5659 5669 5683 5689 5693 5701 5711 5717 5737 5741 5743 5749 5779 5783 5791 5801 5807 5813 5821 5827 5839 5843 5849 5851 5857 5861 5867 5869 5879 5881 5897 5903 5923 5927 5939 5953 5981 5987 6007 6011 6029 6037 6043 6047 6053 6067 6073 6079 6089 6091 6101 6113 6121 6131 6133 6143 6151 6163 6173 6197 6199 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 6781 6791 6793 6803 6823 6827 6829 6833 6841 6857 6863 6869 6871 6883 6899 6907 6911 6917 6947 6949 6959 6961 6967 6971 6977 6983 6991 6997 7001 7013 7019 7027 7039 7043 7057 7069 7079 7103 7109 7121 7127 7129 7151 7159 7177 7187 7193 7207 7211 7213 7219 7229 7237 7243 7247 7253 7283 7297 7307 7309 7321 7331 7333 7349 7351 7369 7393 7411 7417 7433 7451 7457 7459 7477 7481 7487 7489 7499 7507 7517 7523 7529 7537 7541 7547 7549 7559 7561 7573 7577 7583 7589 7591 7603 7607 7621 7639 7643 7649 7669 7673 7681 7687 7691 7699 7703 7717 7723 7727 7741 7753 7757 7759 7789 7793 7817 7823 7829 7841 7853 7867 7873 7877 7879 7883 7901 7907 7919 7927 7933 7937 7949 7951 7963 7993 8009 8011 8017 8039 8053 8059 8069 8081 8087 8089 8093 8101 8111 8117 8123 8147 8161 8167 8171 8179 8191 8209 8219 8221 8231 8233 8237 8243 8263 8269 8273 8287 8291 8293 8297 8311 8317 8329 8353 8363 8369 8377 8387 8389 8419 8423 8429 8431 8443 8447 8461 8467 8501 8513 8521 8527 8537 8539 8543 8563 8573 8581 8597 8599 8609 8623 8627 8629 8641 8647 8663 8669 8677 8681 8689 8693 8699 8707 8713 8719 8731 8737 8741 8747 8753 8761 8779 8783 8803 8807 8819 8821 8831 8837 8839 8849 8861 8863 8867 8887 8893 8923 8929 8933 8941 8951 8963 8969 8971 8999 9001 9007 9011 9013 9029 9041 9043 9049 9059 9067 9091 9103 9109 9127 9133 9137 9151 9157 9161 9173 9181 9187 9199 9203 9209 9221 9227 9239 9241 9257 9277 9281 9283 9293 9311 9319 9323 9337 9341 9343 9349 9371 9377 9391 9397 9403 9413 9419 9421 9431 9433 9437 9439 9461 9463 9467 9473 9479 9491 9497 9511 9521 9533 9539 9547 9551 9587 9601 9613 9619 9623 9629 9631 9643 9649 9661 9677 9679 9689 9697 9719 9721 9733 9739 9743 9749 9767 9769 9781 9787 9791 9803 9811 9817 9829 9833 9839 9851 9857 9859 9871 9883 9887 9901 9907 9923 9929 9931 9941 9949 9967 9973 10007 10009 10037 10039 10061 10067 10069 10079 10091 10093 10099 10103 10111 10133 10139 10141 10151 10159 10163 10169 10177 10181 10193 10211 10223 10243 10247 10253 10259 10267 10271 10273 10289 10301 10303 10313 10321 10331 10333 10337 10343 10357 10369 10391 10399 10427 10429 10433 10453 10457 10459 10463 10477 10487 10499 10501 10513 10529 10531 10559 10567 10589 10597 10601 10607 10613 10627 10631 10639 10651 10657 10663 10667 10687 10691 10709 10711 10723 10729 10733 10739 10753 10771 10781 10789 10799 10831 10837 10847 10853 10859 10861 10867 10883 10889 10891 10903 10909 10937 10939 10949 10957 10973 10979 10987 10993 11003 11027 11047 11057 11059 11069 11071 11083 11087 11093 11113 11117 11119 11131 11149 11159 11161 11171 11173 11177 11197 11213 11239 11243 11251 11257 11261 11273 11279 11287 11299 11311 11317 11321 11329 11351 11353 11369 11383 11393 11399 11411 11423 11437 11443 11447 11467 11471 11483 11489 11491 11497 11503 11519 11527 11549 11551 11579 11587 11593 11597 11617 11621 11633 11657 11677 11681 11689 11699 11701 11717 11719 11731 11743 11777 11779 11783 11789 11801 11807 11813 11821 11827 11831 11833 11839 11863 11867 11887 11897 11903 11909 11923 11927 11933 11939 11941 11953 11959 11969 11971 11981 11987 12007 12011 12037 12041 12043 12049 12071 12073 12097 12101 12107 12109 12113 12119 12143 12149 12157 12161 12163 12197 12203 12211 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 12329 12343 12347 12373 12377 12379 12391 12401 12409 12413 12421 12433 12437 12451 12457 12473 12479 12487 12491 12497 12503 12511 12517 12527 12539 12541 12547 12553 12569 12577 12583 12589 12601 12611 12613 12619 12637 12641 12647 12653 12659 12671 12689 12697 12703 12713 12721 12739 12743 12757 12763 12781 12791 12799 12809 12821 12823 12829 12841 12853 12889 12893 12899 12907 12911 12917 12919 12923 12941 12953 12959 12967 12973 12979 12983 13001 13003 13007 13009 13033 13037 13043 13049 13063 13093 13099 13103 13109 13121 13127 13147 13151 13159 13163 13171 13177 13183 13187 13217 13219 13229 13241 13249 13259 13267 13291 13297 13309 13313 13327 13331 13337 13339 13367 13381 13397 13399 13411 13417 13421 13441 13451 13457 13463 13469 13477 13487 13499 13513 13523 13537 13553 13567 13577 13591 13597 13613 13619 13627 13633 13649 13669 13679 13681 13687 13691 13693 13697 13709 13711 13721 13723 13729 13751 13757 13759 13763 13781 13789 13799 13807 13829 13831 13841 13859 13873 13877 13879 13883 13901 13903 13907 13913 13921 13931 13933 13963 13967 13997 13999 14009 14011 14029 14033 14051 14057 14071 14081 14083 14087 14107 14143 14149 14153 14159 14173 14177 14197 14207 14221 14243 14249 14251 14281 14293 14303 14321 14323 14327 14341 14347 14369 14387 14389 14401 14407 14411 14419 14423 14431 14437 14447 14449 14461 14479 14489 14503 14519 14533 14537 14543 14549 14551 14557 14561 14563 14591 14593 14621 14627 14629 14633 14639 14653 14657 14669 14683 14699 14713 14717 14723 14731 14737 14741 14747 14753 14759 14767 14771 14779 14783 14797 14813 14821 14827 14831 14843 14851 14867 14869 14879 14887 14891 14897 14923 14929 14939 14947 14951 14957 14969 14983 15013 15017 15031 15053 15061 15073 15077 15083 15091 15101 15107 15121 15131 15137 15139 15149 15161 15173 15187 15193 15199 15217 15227 15233 15241 15259 15263 15269 15271 15277 15287 15289 15299 15307 15313 15319 15329 15331 15349 15359 15361 15373 15377 15383 15391 15401 15413 15427 15439 15443 15451 15461 15467 15473 15493 15497 15511 15527 15541 15551 15559 15569 15581 15583 15601 15607 15619 15629 15641 15643 15647 15649 15661 15667 15671 15679 15683 15727 15731 15733 15737 15739 15749 15761 15767 15773 15787 15791 15797 15803 15809 15817 15823 15859 15877 15881 15887 15889 15901 15907 15913 15919 15923 15937 15959 15971 15973 15991 16001 16007 16033 16057 16061 16063 16067 16069 16073 16087 16091 16097 16103 16111 16127 16139 16141 16183 16187 16189 16193 16217 16223 16229 16231 16249 16253 16267 16273 16301 16319 16333 16339 16349 16361 16363 16369 16381 16411 16417 16421 16427 16433 16447 16451 16453 16477 16481 16487 16493 16519 16529 16547 16553 16561 16567 16573 16603 16607 16619 16631 16633 16649 16651 16657 16661 16673 16691 16693 16699 16703 16729 16741 16747 16759 16763 16787 16811 16823 16829 16831 16843 16871 16879 16883 16889 16901 16903 16921 16927 16931 16937 16943 16963 16979 16981 16987 16993 17011 17021 17027 17029 17033 17041 17047 17053 17077 17093 17099 17107 17117 17123 17137 17159 17167 17183 17189 17191 17203 17207 17209 17231 17239 17257 17291 17293 17299 17317 17321 17327 17333 17341 17351 17359 17377 17383 17387 17389 17393 17401 17417 17419 17431 17443 17449 17467 17471 17477 17483 17489 17491 17497 17509 17519 17539 17551 17569 17573 17579 17581 17597 17599 17609 17623 17627 17657 17659 17669 17681 17683 17707 17713 17729 17737 17747 17749 17761 17783 17789 17791 17807 17827 17837 17839 17851 17863 17881 17891 17903 17909 17911 17921 17923 17929 17939 17957 17959 17971 17977 17981 17987 17989 18013 18041 18043 18047 18049 18059 18061 18077 18089 18097 18119 18121 18127 18131 18133 18143 18149 18169 18181 18191 18199 18211 18217 18223 18229 18233 18251 18253 18257 18269 18287 18289 18301 18307 18311 18313 18329 18341 18353 18367 18371 18379 18397 18401 18413 18427 18433 18439 18443 18451 18457 18461 18481 18493 18503 18517 18521 18523 18539 18541 18553 18583 18587 18593 18617 18637 18661 18671 18679 18691 18701 18713 18719 18731 18743 18749 18757 18773 18787 18793 18797 18803 18839 18859 18869 18899 18911 18913 18917 18919 18947 18959 18973 18979 19001 19009 19013 19031 19037 19051 19069 19073 19079 19081 19087 19121 19139 19141 19157 19163 19181 19183 19207 19211 19213 19219 19231 19237 19249 19259 19267 19273 19289 19301 19309 19319 19333 19373 19379 19381 19387 19391 19403 19417 19421 19423 19427 19429 19433 19441 19447 19457 19463 19469 19471 19477 19483 19489 19501 19507 19531 19541 19543 19553 19559 19571 19577 19583 19597 19603 19609 19661 19681 19687 19697 19699 19709 19717 19727 19739 19751 19753 19759 19763 19777 19793 19801 19813 19819 19841 19843 19853 19861 19867 19889 19891 19913 19919 19927 19937 19949 19961 19963 19973 19979 19991 19993 19997 20011 20021 20023 20029 20047 20051 20063 20071 20089 20101 20107 20113 20117 20123 20129 20143 20147 20149 20161 20173 20177 20183 20201 20219 20231 20233 20249 20261 20269 20287 20297 20323 20327 20333 20341 20347 20353 20357 20359 20369 20389 20393 20399 20407 20411 20431 20441 20443 20477 20479 20483 20507 20509 20521 20533 20543 20549 20551 20563 20593 20599 20611 20627 20639 20641 20663 20681 20693 20707 20717 20719 20731 20743 20747 20749 20753 20759 20771 20773 20789 20807 20809 20849 20857 20873 20879 20887 20897 20899 20903 20921 20929 20939 20947 20959 20963 20981 20983 21001 21011 21013 21017 21019 21023 21031 21059 21061 21067 21089 21101 21107 21121 21139 21143 21149 21157 21163 21169 21179 21187 21191 21193 21211 21221 21227 21247 21269 21277 21283 21313 21317 21319 21323 21341 21347 21377 21379 21383 21391 21397 21401 21407 21419 21433 21467 21481 21487 21491 21493 21499 21503 21517 21521 21523 21529 21557 21559 21563 21569 21577 21587 21589 21599 21601 21611 21613 21617 21647 21649 21661 21673 21683 21701 21713 21727 21737 21739 21751 21757 21767 21773 21787 21799 21803 21817 21821 21839 21841 21851 21859 21863 21871 21881 21893 21911 21929 21937 21943 21961 21977 21991 21997 22003 22013 22027 22031 22037 22039 22051 22063 22067 22073 22079 22091 22093 22109 22111 22123 22129 22133 22147 22153 22157 22159 22171 22189 22193 22229 22247 22259 22271 22273 22277 22279 22283 22291 22303 22307 22343 22349 22367 22369 22381 22391 22397 22409 22433 22441 22447 22453 22469 22481 22483 22501 22511 22531 22541 22543 22549 22567 22571 22573 22613 22619 22621 22637 22639 22643 22651 22669 22679 22691 22697 22699 22709 22717 22721 22727 22739 22741 22751 22769 22777 22783 22787 22807 22811 22817 22853 22859 22861 22871 22877 22901 22907 22921 22937 22943 22961 22963 22973 22993 23003 23011 23017 23021 23027 23029 23039 23041 23053 23057 23059 23063 23071 23081 23087 23099 23117 23131 23143 23159 23167 23173 23189 23197 23201 23203 23209 23227 23251 23269 23279 23291 23293 23297 23311 23321 23327 23333 23339 23357 23369 23371 23399 23417 23431 23447 23459 23473 23497 23509 23531 23537 23539 23549 23557 23561 23563 23567 23581 23593 23599 23603 23609 23623 23627 23629 23633 23663 23669 23671 23677 23687 23689 23719 23741 23743 23747 23753 23761 23767 23773 23789 23801 23813 23819 23827 23831 23833 23857 23869 23873 23879 23887 23893 23899 23909 23911 23917 23929 23957 23971 23977 23981 23993 24001 24007 24019 24023 24029 24043 24049 24061 24071 24077 24083 24091 24097 24103 24107 24109 24113 24121 24133 24137 24151 24169 24179 24181 24197 24203 24223 24229 24239 24247 24251 24281 24317 24329 24337 24359 24371 24373 24379 24391 24407 24413 24419 24421 24439 24443 24469 24473 24481 24499 24509 24517 24527 24533 24547 24551 24571 24593 24611 24623 24631 24659 24671 24677 24683 24691 24697 24709 24733 24749 24763 24767 24781 24793 24799 24809 24821 24841 24847 24851 24859 24877 24889 24907 24917 24919 24923 24943 24953 24967 24971 24977 24979 24989 25013 25031 25033 25037 25057 25073 25087 25097 25111 25117 25121 25127 25147 25153 25163 25169 25171 25183 25189 25219 25229 25237 25243 25247 25253 25261 25301 25303 25307 25309 25321 25339 25343 25349 25357 25367 25373 25391 25409 25411 25423 25439 25447 25453 25457 25463 25469 25471 25523 25537 25541 25561 25577 25579 25583 25589 25601 25603 25609 25621 25633 25639 25643 25657 25667 25673 25679 25693 25703 25717 25733 25741 25747 25759 25763 25771 25793 25799 25801 25819 25841 25847 25849 25867 25873 25889 25903 25913 25919 25931 25933 25939 25943 25951 25969 25981 25997 25999 26003 26017 26021 26029 26041 26053 26083 26099 26107 26111 26113 26119 26141 26153 26161 26171 26177 26183 26189 26203 26209 26227 26237 26249 26251 26261 26263 26267 26293 26297 26309 26317 26321 26339 26347 26357 26371 26387 26393 26399 26407 26417 26423 26431 26437 26449 26459 26479 26489 26497 26501 26513 26539 26557 26561 26573 26591 26597 26627 26633 26641 26647 26669 26681 26683 26687 26693 26699 26701 26711 26713 26717 26723 26729 26731 26737 26759 26777 26783 26801 26813 26821 26833 26839 26849 26861 26863 26879 26881 26891 26893 26903 26921 26927 26947 26951 26953 26959 26981 26987 26993 27011 27017 27031 27043 27059 27061 27067 27073 27077 27091 27103 27107 27109 27127 27143 27179 27191 27197 27211 27239 27241 27253 27259 27271 27277 27281 27283 27299 27329 27337 27361 27367 27397 27407 27409 27427 27431 27437 27449 27457 27479 27481 27487 27509 27527 27529 27539 27541 27551 27581 27583 27611 27617 27631 27647 27653 27673 27689 27691 27697 27701 27733 27737 27739 27743 27749 27751 27763 27767 27773 27779 27791 27793 27799 27803 27809 27817 27823 27827 27847 27851 27883 27893 27901 27917 27919 27941 27943 27947 27953 27961 27967 27983 27997 28001 28019 28027 28031 28051 28057 28069 28081 28087 28097 28099 28109 28111 28123 28151 28163 28181 28183 28201 28211 28219 28229 28277 28279 28283 28289 28297 28307 28309 28319 28349 28351 28387 28393 28403 28409 28411 28429 28433 28439 28447 28463 28477 28493 28499 28513 28517 28537 28541 28547 28549 28559 28571 28573 28579 28591 28597 28603 28607 28619 28621 28627 28631 28643 28649 28657 28661 28663 28669 28687 28697 28703 28711 28723 28729 28751 28753 28759 28771 28789 28793 28807 28813 28817 28837 28843 28859 28867 28871 28879 28901 28909 28921 28927 28933 28949 28961 28979 29009 29017 29021 29023 29027 29033 29059 29063 29077 29101 29123 29129 29131 29137 29147 29153 29167 29173 29179 29191 29201 29207 29209 29221 29231 29243 29251 29269 29287 29297 29303 29311 29327 29333 29339 29347 29363 29383 29387 29389 29399 29401 29411 29423 29429 29437 29443 29453 29473 29483 29501 29527 29531 29537 29567 29569 29573 29581 29587 29599 29611 29629 29633 29641 29663 29669 29671 29683 29717 29723 29741 29753 29759 29761 29789 29803 29819 29833 29837 29851 29863 29867 29873 29879 29881 29917 29921 29927 29947 29959 29983 29989 30011 30013 30029 30047 30059 30071 30089 30091 30097 30103 30109 30113 30119 30133 30137 30139 30161 30169 30181 30187 30197 30203 30211 30223 30241 30253 30259 30269 30271 30293 30307 30313 30319 30323 30341 30347 30367 30389 30391 30403 30427 30431 30449 30467 30469 30491 30493 30497 30509 30517 30529 30539 30553 30557 30559 30577 30593 30631 30637 30643 30649 30661 30671 30677 30689 30697 30703 30707 30713 30727 30757 30763 30773 30781 30803 30809 30817 30829 30839 30841 30851 30853 30859 30869 30871 30881 30893 30911 30931 30937 30941 30949 30971 30977 30983 31013 31019 31033 31039 31051 31063 31069 31079 31081 31091 31121 31123 31139 31147 31151 31153 31159 31177 31181 31183 31189 31193 31219 31223 31231 31237 31247 31249 31253 31259 31267 31271 31277 31307 31319 31321 31327 31333 31337 31357 31379 31387 31391 31393 31397 31469 31477 31481 31489 31511 31513 31517 31531 31541 31543 31547 31567 31573 31583 31601 31607 31627 31643 31649 31657 31663 31667 31687 31699 31721 31723 31727 31729 31741 31751 31769 31771 31793 31799 31817 31847 31849 31859 31873 31883 31891 31907 31957 31963 31973 31981 31991 32003 32009 32027 32029 32051 32057 32059 32063 32069 32077 32083 32089 32099 32117 32119 32141 32143 32159 32173 32183 32189 32191 32203 32213 32233 32237 32251 32257 32261 32297 32299 32303 32309 32321 32323 32327 32341 32353 32359 32363 32369 32371 32377 32381 32401 32411 32413 32423 32429 32441 32443 32467 32479 32491 32497 32503 32507 32531 32533 32537 32561 32563 32569 32573 32579 32587 32603 32609 32611 32621 32633 32647 32653 32687 32693 32707 32713 32717 32719 32749 32771 32779 32783 32789 32797 32801 32803 32831 32833 32839 32843 32869 32887 32909 32911 32917 32933 32939 32941 32957 32969 32971 32983 32987 32993 32999 33013 33023 33029 33037 33049 33053 33071 33073 33083 33091 33107 33113 33119 33149 33151 33161 33179 33181 33191 33199 33203 33211 33223 33247 33287 33289 33301 33311 33317 33329 33331 33343 33347 33349 33353 33359 33377 33391 33403 33409 33413 33427 33457 33461 33469 33479 33487 33493 33503 33521 33529 33533 33547 33563 33569 33577 33581 33587 33589 33599 33601 33613 33617 33619 33623 33629 33637 33641 33647 33679 33703 33713 33721 33739 33749 33751 33757 33767 33769 33773 33791 33797 33809 33811 33827 33829 33851 33857 33863 33871 33889 33893 33911 33923 33931 33937 33941 33961 33967 33997 34019 34031 34033 34039 34057 34061 34123 34127 34129 34141 34147 34157 34159 34171 34183 34211 34213 34217 34231 34253 34259 34261 34267 34273 34283 34297 34301 34303 34313 34319 34327 34337 34351 34361 34367 34369 34381 34403 34421 34429 34439 34457 34469 34471 34483 34487 34499 34501 34511 34513 34519 34537 34543 34549 34583 34589 34591 34603 34607 34613 34631 34649 34651 34667 34673 34679 34687 34693 34703 34721 34729 34739 34747 34757 34759 34763 34781 34807 34819 34841 34843 34847 34849 34871 34877 34883 34897 34913 34919 34939 34949 34961 34963 34981 35023 35027 35051 35053 35059 35069 35081 35083 35089 35099 35107 35111 35117 35129 35141 35149 35153 35159 35171 35201 35221 35227 35251 35257 35267 35279 35281 35291 35311 35317 35323 35327 35339 35353 35363 35381 35393 35401 35407 35419 35423 35437 35447 35449 35461 35491 35507 35509 35521 35527 35531 35533 35537 35543 35569 35573 35591 35593 35597 35603 35617 35671 35677 35729 35731 35747 35753 35759 35771 35797 35801 35803 35809 35831 35837 35839 35851 35863 35869 35879 35897 35899 35911 35923 35933 35951 35963 35969 35977 35983 35993 35999 36007 36011 36013 36017 36037 36061 36067 36073 36083 36097 36107 36109 36131 36137 36151 36161 36187 36191 36209 36217 36229 36241 36251 36263 36269 36277 36293 36299 36307 36313 36319 36341 36343 36353 36373 36383 36389 36433 36451 36457 36467 36469 36473 36479 36493 36497 36523 36527 36529 36541 36551 36559 36563 36571 36583 36587 36599 36607 36629 36637 36643 36653 36671 36677 36683 36691 36697 36709 36713 36721 36739 36749 36761 36767 36779 36781 36787 36791 36793 36809 36821 36833 36847 36857 36871 36877 36887 36899 36901 36913 36919 36923 36929 36931 36943 36947 36973 36979 36997 37003 37013 37019 37021 37039 37049 37057 37061 37087 37097 37117 37123 37139 37159 37171 37181 37189 37199 37201 37217 37223 37243 37253 37273 37277 37307 37309 37313 37321 37337 37339 37357 37361 37363 37369 37379 37397 37409 37423 37441 37447 37463 37483 37489 37493 37501 37507 37511 37517 37529 37537 37547 37549 37561 37567 37571 37573 37579 37589 37591 37607 37619 37633 37643 37649 37657 37663 37691 37693 37699 37717 37747 37781 37783 37799 37811 37813 37831 37847 37853 37861 37871 37879 37889 37897 37907 37951 37957 37963 37967 37987 37991 37993 37997 38011 38039 38047 38053 38069 38083 38113 38119 38149 38153 38167 38177 38183 38189 38197 38201 38219 38231 38237 38239 38261 38273 38281 38287 38299 38303 38317 38321 38327 38329 38333 38351 38371 38377 38393 38431 38447 38449 38453 38459 38461 38501 38543 38557 38561 38567 38569 38593 38603 38609 38611 38629 38639 38651 38653 38669 38671 38677 38693 38699 38707 38711 38713 38723 38729 38737 38747 38749 38767 38783 38791 38803 38821 38833 38839 38851 38861 38867 38873 38891 38903 38917 38921 38923 38933 38953 38959 38971 38977 38993 39019 39023 39041 39043 39047 39079 39089 39097 39103 39107 39113 39119 39133 39139 39157 39161 39163 39181 39191 39199 39209 39217 39227 39229 39233 39239 39241 39251 39293 39301 39313 39317 39323 39341 39343 39359 39367 39371 39373 39383 39397 39409 39419 39439 39443 39451 39461 39499 39503 39509 39511 39521 39541 39551 39563 39569 39581 39607 39619 39623 39631 39659 39667 39671 39679 39703 39709 39719 39727 39733 39749 39761 39769 39779 39791 39799 39821 39827 39829 39839 39841 39847 39857 39863 39869 39877 39883 39887 39901 39929 39937 39953 39971 39979 39983 39989 40009 40013 40031 40037 40039 40063 40087 40093 40099 40111 40123 40127 40129 40151 40153 40163 40169 40177 40189 40193 40213 40231 40237 40241 40253 40277 40283 40289 40343 40351 40357 40361 40387 40423 40427 40429 40433 40459 40471 40483 40487 40493 40499 40507 40519 40529 40531 40543 40559 40577 40583 40591 40597 40609 40627 40637 40639 40693 40697 40699 40709 40739 40751 40759 40763 40771 40787 40801 40813 40819 40823 40829 40841 40847 40849 40853 40867 40879 40883 40897 40903 40927 40933 40939 40949 40961 40973 40993 41011 41017 41023 41039 41047 41051 41057 41077 41081 41113 41117 41131 41141 41143 41149 41161 41177 41179 41183 41189 41201 41203 41213 41221 41227 41231 41233 41243 41257 41263 41269 41281 41299 41333 41341 41351 41357 41381 41387 41389 41399 41411 41413 41443 41453 41467 41479 41491 41507 41513 41519 41521 41539 41543 41549 41579 41593 41597 41603 41609 41611 41617 41621 41627 41641 41647 41651 41659 41669 41681 41687 41719 41729 41737 41759 41761 41771 41777 41801 41809 41813 41843 41849 41851 41863 41879 41887 41893 41897 41903 41911 41927 41941 41947 41953 41957 41959 41969 41981 41983 41999 42013 42017 42019 42023 42043 42061 42071 42073 42083 42089 42101 42131 42139 42157 42169 42179 42181 42187 42193 42197 42209 42221 42223 42227 42239 42257 42281 42283 42293 42299 42307 42323 42331 42337 42349 42359 42373 42379 42391 42397 42403 42407 42409 42433 42437 42443 42451 42457 42461 42463 42467 42473 42487 42491 42499 42509 42533 42557 42569 42571 42577 42589 42611 42641 42643 42649 42667 42677 42683 42689 42697 42701 42703 42709 42719 42727 42737 42743 42751 42767 42773 42787 42793 42797 42821 42829 42839 42841 42853 42859 42863 42899 42901 42923 42929 42937 42943 42953 42961 42967 42979 42989 43003 43013 43019 43037 43049 43051 43063 43067 43093 43103 43117 43133 43151 43159 43177 43189 43201 43207 43223 43237 43261 43271 43283 43291 43313 43319 43321 43331 43391 43397 43399 43403 43411 43427 43441 43451 43457 43481 43487 43499 43517 43541 43543 43573 43577 43579 43591 43597 43607 43609 43613 43627 43633 43649 43651 43661 43669 43691 43711 43717 43721 43753 43759 43777 43781 43783 43787 43789 43793 43801 43853 43867 43889 43891 43913 43933 43943 43951 43961 43963 43969 43973 43987 43991 43997 44017 44021 44027 44029 44041 44053 44059 44071 44087 44089 44101 44111 44119 44123 44129 44131 44159 44171 44179 44189 44201 44203 44207 44221 44249 44257 44263 44267 44269 44273 44279 44281 44293 44351 44357 44371 44381 44383 44389 44417 44449 44453 44483 44491 44497 44501 44507 44519 44531 44533 44537 44543 44549 44563 44579 44587 44617 44621 44623 44633 44641 44647 44651 44657 44683 44687 44699 44701 44711 44729 44741 44753 44771 44773 44777 44789 44797 44809 44819 44839 44843 44851 44867 44879 44887 44893 44909 44917 44927 44939 44953 44959 44963 44971 44983 44987 45007 45013 45053 45061 45077 45083 45119 45121 45127 45131 45137 45139 45161 45179 45181 45191 45197 45233 45247 45259 45263 45281 45289 45293 45307 45317 45319 45329 45337 45341 45343 45361 45377 45389 45403 45413 45427 45433 45439 45481 45491 45497 45503 45523 45533 45541 45553 45557 45569 45587 45589 45599 45613 45631 45641 45659 45667 45673 45677 45691 45697 45707 45737 45751 45757 45763 45767 45779 45817 45821 45823 45827 45833 45841 45853 45863 45869 45887 45893 45943 45949 45953 45959 45971 45979 45989 46021 46027 46049 46051 46061 46073 46091 46093 46099 46103 46133 46141 46147 46153 46171 46181 46183 46187 46199 46219 46229 46237 46261 46271 46273 46279 46301 46307 46309 46327 46337 46349 46351 46381 46399 46411 46439 46441 46447 46451 46457 46471 46477 46489 46499 46507 46511 46523 46549 46559 46567 46573 46589 46591 46601 46619 46633 46639 46643 46649 46663 46679 46681 46687 46691 46703 46723 46727 46747 46751 46757 46769 46771 46807 46811 46817 46819 46829 46831 46853 46861 46867 46877 46889 46901 46919 46933 46957 46993 46997 47017 47041 47051 47057 47059 47087 47093 47111 47119 47123 47129 47137 47143 47147 47149 47161 47189 47207 47221 47237 47251 47269 47279 47287 47293 47297 47303 47309 47317 47339 47351 47353 47363 47381 47387 47389 47407 47417 47419 47431 47441 47459 47491 47497 47501 47507 47513 47521 47527 47533 47543 47563 47569 47581 47591 47599 47609 47623 47629 47639 47653 47657 47659 47681 47699 47701 47711 47713 47717 47737 47741 47743 47777 47779 47791 47797 47807 47809 47819 47837 47843 47857 47869 47881 47903 47911 47917 47933 47939 47947 47951 47963 47969 47977 47981 48017 48023 48029 48049 48073 48079 48091 48109 48119 48121 48131 48157 48163 48179 48187 48193 48197 48221 48239 48247 48259 48271 48281 48299 48311 48313 48337 48341 48353 48371 48383 48397 48407 48409 48413 48437 48449 48463 48473 48479 48481 48487 48491 48497 48523 48527 48533 48539 48541 48563 48571 48589 48593 48611 48619 48623 48647 48649 48661 48673 48677 48679 48731 48733 48751 48757 48761 48767 48779 48781 48787 48799 48809 48817 48821 48823 48847 48857 48859 48869 48871 48883 48889 48907 48947 48953 48973 48989 48991 49003 49009 49019 49031 49033 49037 49043 49057 49069 49081 49103 49109 49117 49121 49123 49139 49157 49169 49171 49177 49193 49199 49201 49207 49211 49223 49253 49261 49277 49279 49297 49307 49331 49333 49339 49363 49367 49369 49391 49393 49409 49411 49417 49429 49433 49451 49459 49463 49477 49481 49499 49523 49529 49531 49537 49547 49549 49559 49597 49603 49613 49627 49633 49639 49663 49667 49669 49681 49697 49711 49727 49739 49741 49747 49757 49783 49787 49789 49801 49807 49811 49823 49831 49843 49853 49871 49877 49891 49919 49921 49927 49937 49939 49943 49957 49991 49993 49999 
+ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 2749 2753 2767 2777 2789 2791 2797 2801 2803 2819 2833 2837 2843 2851 2857 2861 2879 2887 2897 2903 2909 2917 2927 2939 2953 2957 2963 2969 2971 2999 3001 3011 3019 3023 3037 3041 3049 3061 3067 3079 3083 3089 3109 3119 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 3257 3259 3271 3299 3301 3307 3313 3319 3323 3329 3331 3343 3347 3359 3361 3371 3373 3389 3391 3407 3413 3433 3449 3457 3461 3463 3467 3469 3491 3499 3511 3517 3527 3529 3533 3539 3541 3547 3557 3559 3571 3581 3583 3593 3607 3613 3617 3623 3631 3637 3643 3659 3671 3673 3677 3691 3697 3701 3709 3719 3727 3733 3739 3761 3767 3769 3779 3793 3797 3803 3821 3823 3833 3847 3851 3853 3863 3877 3881 3889 3907 3911 3917 3919 3923 3929 3931 3943 3947 3967 3989 4001 4003 4007 4013 4019 4021 4027 4049 4051 4057 4073 4079 4091 4093 4099 4111 4127 4129 4133 4139 4153 4157 4159 4177 4201 4211 4217 4219 4229 4231 4241 4243 4253 4259 4261 4271 4273 4283 4289 4297 4327 4337 4339 4349 4357 4363 4373 4391 4397 4409 4421 4423 4441 4447 4451 4457 4463 4481 4483 4493 4507 4513 4517 4519 4523 4547 4549 4561 4567 4583 4591 4597 4603 4621 4637 4639 4643 4649 4651 4657 4663 4673 4679 4691 4703 4721 4723 4729 4733 4751 4759 4783 4787 4789 4793 4799 4801 4813 4817 4831 4861 4871 4877 4889 4903 4909 4919 4931 4933 4937 4943 4951 4957 4967 4969 4973 4987 4993 4999 5003 5009 5011 5021 5023 5039 5051 5059 5077 5081 5087 5099 5101 5107 5113 5119 5147 5153 5167 5171 5179 5189 5197 5209 5227 5231 5233 5237 5261 5273 5279 5281 5297 5303 5309 5323 5333 5347 5351 5381 5387 5393 5399 5407 5413 5417 5419 5431 5437 5441 5443 5449 5471 5477 5479 5483 5501 5503 5507 5519 5521 5527 5531 5557 5563 5569 5573 5581 5591 5623 5639 5641 5647 5651 5653 5657 5659 5669 5683 5689 5693 5701 5711 5717 5737 5741 5743 5749 5779 5783 5791 5801 5807 5813 5821 5827 5839 5843 5849 5851 5857 5861 5867 5869 5879 5881 5897 5903 5923 5927 5939 5953 5981 5987 6007 6011 6029 6037 6043 6047 6053 6067 6073 6079 6089 6091 6101 6113 6121 6131 6133 6143 6151 6163 6173 6197 6199 6203 6211 6217 6221 6229 6247 6257 6263 6269 6271 6277 6287 6299 6301 6311 6317 6323 6329 6337 6343 6353 6359 6361 6367 6373 6379 6389 6397 6421 6427 6449 6451 6469 6473 6481 6491 6521 6529 6547 6551 6553 6563 6569 6571 6577 6581 6599 6607 6619 6637 6653 6659 6661 6673 6679 6689 6691 6701 6703 6709 6719 6733 6737 6761 6763 6779 6781 6791 6793 6803 6823 6827 6829 6833 6841 6857 6863 6869 6871 6883 6899 6907 6911 6917 6947 6949 6959 6961 6967 6971 6977 6983 6991 6997 7001 7013 7019 7027 7039 7043 7057 7069 7079 7103 7109 7121 7127 7129 7151 7159 7177 7187 7193 7207 7211 7213 7219 7229 7237 7243 7247 7253 7283 7297 7307 7309 7321 7331 7333 7349 7351 7369 7393 7411 7417 7433 7451 7457 7459 7477 7481 7487 7489 7499 7507 7517 7523 7529 7537 7541 7547 7549 7559 7561 7573 7577 7583 7589 7591 7603 7607 7621 7639 7643 7649 7669 7673 7681 7687 7691 7699 7703 7717 7723 7727 7741 7753 7757 7759 7789 7793 7817 7823 7829 7841 7853 7867 7873 7877 7879 7883 7901 7907 7919 7927 7933 7937 7949 7951 7963 7993 8009 8011 8017 8039 8053 8059 8069 8081 8087 8089 8093 8101 8111 8117 8123 8147 8161 8167 8171 8179 8191 8209 8219 8221 8231 8233 8237 8243 8263 8269 8273 8287 8291 8293 8297 8311 8317 8329 8353 8363 8369 8377 8387 8389 8419 8423 8429 8431 8443 8447 8461 8467 8501 8513 8521 8527 8537 8539 8543 8563 8573 8581 8597 8599 8609 8623 8627 8629 8641 8647 8663 8669 8677 8681 8689 8693 8699 8707 8713 8719 8731 8737 8741 8747 8753 8761 8779 8783 8803 8807 8819 8821 8831 8837 8839 8849 8861 8863 8867 8887 8893 8923 8929 8933 8941 8951 8963 8969 8971 8999 9001 9007 9011 9013 9029 9041 9043 9049 9059 9067 9091 9103 9109 9127 9133 9137 9151 9157 9161 9173 9181 9187 9199 9203 9209 9221 9227 9239 9241 9257 9277 9281 9283 9293 9311 9319 9323 9337 9341 9343 9349 9371 9377 9391 9397 9403 9413 9419 9421 9431 9433 9437 9439 9461 9463 9467 9473 9479 9491 9497 9511 9521 9533 9539 9547 9551 9587 9601 9613 9619 9623 9629 9631 9643 9649 9661 9677 9679 9689 9697 9719 9721 9733 9739 9743 9749 9767 9769 9781 9787 9791 9803 9811 9817 9829 9833 9839 9851 9857 9859 9871 9883 9887 9901 9907 9923 9929 9931 9941 9949 9967 9973 10007 10009 10037 10039 10061 10067 10069 10079 10091 10093 10099 10103 10111 10133 10139 10141 10151 10159 10163 10169 10177 10181 10193 10211 10223 10243 10247 10253 10259 10267 10271 10273 10289 10301 10303 10313 10321 10331 10333 10337 10343 10357 10369 10391 10399 10427 10429 10433 10453 10457 10459 10463 10477 10487 10499 10501 10513 10529 10531 10559 10567 10589 10597 10601 10607 10613 10627 10631 10639 10651 10657 10663 10667 10687 10691 10709 10711 10723 10729 10733 10739 10753 10771 10781 10789 10799 10831 10837 10847 10853 10859 10861 10867 10883 10889 10891 10903 10909 10937 10939 10949 10957 10973 10979 10987 10993 11003 11027 11047 11057 11059 11069 11071 11083 11087 11093 11113 11117 11119 11131 11149 11159 11161 11171 11173 11177 11197 11213 11239 11243 11251 11257 11261 11273 11279 11287 11299 11311 11317 11321 11329 11351 11353 11369 11383 11393 11399 11411 11423 11437 11443 11447 11467 11471 11483 11489 11491 11497 11503 11519 11527 11549 11551 11579 11587 11593 11597 11617 11621 11633 11657 11677 11681 11689 11699 11701 11717 11719 11731 11743 11777 11779 11783 11789 11801 11807 11813 11821 11827 11831 11833 11839 11863 11867 11887 11897 11903 11909 11923 11927 11933 11939 11941 11953 11959 11969 11971 11981 11987 12007 12011 12037 12041 12043 12049 12071 12073 12097 12101 12107 12109 12113 12119 12143 12149 12157 12161 12163 12197 12203 12211 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 12329 12343 12347 12373 12377 12379 12391 12401 12409 12413 12421 12433 12437 12451 12457 12473 12479 12487 12491 12497 12503 12511 12517 12527 12539 12541 12547 12553 12569 12577 12583 12589 12601 12611 12613 12619 12637 12641 12647 12653 12659 12671 12689 12697 12703 12713 12721 12739 12743 12757 12763 12781 12791 12799 12809 12821 12823 12829 12841 12853 12889 12893 12899 12907 12911 12917 12919 12923 12941 12953 12959 12967 12973 12979 12983 13001 13003 13007 13009 13033 13037 13043 13049 13063 13093 13099 13103 13109 13121 13127 13147 13151 13159 13163 13171 13177 13183 13187 13217 13219 13229 13241 13249 13259 13267 13291 13297 13309 13313 13327 13331 13337 13339 13367 13381 13397 13399 13411 13417 13421 13441 13451 13457 13463 13469 13477 13487 13499 13513 13523 13537 13553 13567 13577 13591 13597 13613 13619 13627 13633 13649 13669 13679 13681 13687 13691 13693 13697 13709 13711 13721 13723 13729 13751 13757 13759 13763 13781 13789 13799 13807 13829 13831 13841 13859 13873 13877 13879 13883 13901 13903 13907 13913 13921 13931 13933 13963 13967 13997 13999 14009 14011 14029 14033 14051 14057 14071 14081 14083 14087 14107 14143 14149 14153 14159 14173 14177 14197 14207 14221 14243 14249 14251 14281 14293 14303 14321 14323 14327 14341 14347 14369 14387 14389 14401 14407 14411 14419 14423 14431 14437 14447 14449 14461 14479 14489 14503 14519 14533 14537 14543 14549 14551 14557 14561 14563 14591 14593 14621 14627 14629 14633 14639 14653 14657 14669 14683 14699 14713 14717 14723 14731 14737 14741 14747 14753 14759 14767 14771 14779 14783 14797 14813 14821 14827 14831 14843 14851 14867 14869 14879 14887 14891 14897 14923 14929 14939 14947 14951 14957 14969 14983 15013 15017 15031 15053 15061 15073 15077 15083 15091 15101 15107 15121 15131 15137 15139 15149 15161 15173 15187 15193 15199 15217 15227 15233 15241 15259 15263 15269 15271 15277 15287 15289 15299 15307 15313 15319 15329 15331 15349 15359 15361 15373 15377 15383 15391 15401 15413 15427 15439 15443 15451 15461 15467 15473 15493 15497 15511 15527 15541 15551 15559 15569 15581 15583 15601 15607 15619 15629 15641 15643 15647 15649 15661 15667 15671 15679 15683 15727 15731 15733 15737 15739 15749 15761 15767 15773 15787 15791 15797 15803 15809 15817 15823 15859 15877 15881 15887 15889 15901 15907 15913 15919 15923 15937 15959 15971 15973 15991 16001 16007 16033 16057 16061 16063 16067 16069 16073 16087 16091 16097 16103 16111 16127 16139 16141 16183 16187 16189 16193 16217 16223 16229 16231 16249 16253 16267 16273 16301 16319 16333 16339 16349 16361 16363 16369 16381 16411 16417 16421 16427 16433 16447 16451 16453 16477 16481 16487 16493 16519 16529 16547 16553 16561 16567 16573 16603 16607 16619 16631 16633 16649 16651 16657 16661 16673 16691 16693 16699 16703 16729 16741 16747 16759 16763 16787 16811 16823 16829 16831 16843 16871 16879 16883 16889 16901 16903 16921 16927 16931 16937 16943 16963 16979 16981 16987 16993 17011 17021 17027 17029 17033 17041 17047 17053 17077 17093 17099 17107 17117 17123 17137 17159 17167 17183 17189 17191 17203 17207 17209 17231 17239 17257 17291 17293 17299 17317 17321 17327 17333 17341 17351 17359 17377 17383 17387 17389 17393 17401 17417 17419 17431 17443 17449 17467 17471 17477 17483 17489 17491 17497 17509 17519 17539 17551 17569 17573 17579 17581 17597 17599 17609 17623 17627 17657 17659 17669 17681 17683 17707 17713 17729 17737 17747 17749 17761 17783 17789 17791 17807 17827 17837 17839 17851 17863 17881 17891 17903 17909 17911 17921 17923 17929 17939 17957 17959 17971 17977 17981 17987 17989 18013 18041 18043 18047 18049 18059 18061 18077 18089 18097 18119 18121 18127 18131 18133 18143 18149 18169 18181 18191 18199 18211 18217 18223 18229 18233 18251 18253 18257 18269 18287 18289 18301 18307 18311 18313 18329 18341 18353 18367 18371 18379 18397 18401 18413 18427 18433 18439 18443 18451 18457 18461 18481 18493 18503 18517 18521 18523 18539 18541 18553 18583 18587 18593 18617 18637 18661 18671 18679 18691 18701 18713 18719 18731 18743 18749 18757 18773 18787 18793 18797 18803 18839 18859 18869 18899 18911 18913 18917 18919 18947 18959 18973 18979 19001 19009 19013 19031 19037 19051 19069 19073 19079 19081 19087 19121 19139 19141 19157 19163 19181 19183 19207 19211 19213 19219 19231 19237 19249 19259 19267 19273 19289 19301 19309 19319 19333 19373 19379 19381 19387 19391 19403 19417 19421 19423 19427 19429 19433 19441 19447 19457 19463 19469 19471 19477 19483 19489 19501 19507 19531 19541 19543 19553 19559 19571 19577 19583 19597 19603 19609 19661 19681 19687 19697 19699 19709 19717 19727 19739 19751 19753 19759 19763 19777 19793 19801 19813 19819 19841 19843 19853 19861 19867 19889 19891 19913 19919 19927 19937 19949 19961 19963 19973 19979 19991 19993 19997 20011 20021 20023 20029 20047 20051 20063 20071 20089 20101 20107 20113 20117 20123 20129 20143 20147 20149 20161 20173 20177 20183 20201 20219 20231 20233 20249 20261 20269 20287 20297 20323 20327 20333 20341 20347 20353 20357 20359 20369 20389 20393 20399 20407 20411 20431 20441 20443 20477 20479 20483 20507 20509 20521 20533 20543 20549 20551 20563 20593 20599 20611 20627 20639 20641 20663 20681 20693 20707 20717 20719 20731 20743 20747 20749 20753 20759 20771 20773 20789 20807 20809 20849 20857 20873 20879 20887 20897 20899 20903 20921 20929 20939 20947 20959 20963 20981 20983 21001 21011 21013 21017 21019 21023 21031 21059 21061 21067 21089 21101 21107 21121 21139 21143 21149 21157 21163 21169 21179 21187 21191 21193 21211 21221 21227 21247 21269 21277 21283 21313 21317 21319 21323 21341 21347 21377 21379 21383 21391 21397 21401 21407 21419 21433 21467 21481 21487 21491 21493 21499 21503 21517 21521 21523 21529 21557 21559 21563 21569 21577 21587 21589 21599 21601 21611 21613 21617 21647 21649 21661 21673 21683 21701 21713 21727 21737 21739 21751 21757 21767 21773 21787 21799 21803 21817 21821 21839 21841 21851 21859 21863 21871 21881 21893 21911 21929 21937 21943 21961 21977 21991 21997 22003 22013 22027 22031 22037 22039 22051 22063 22067 22073 22079 22091 22093 22109 22111 22123 22129 22133 22147 22153 22157 22159 22171 22189 22193 22229 22247 22259 22271 22273 22277 22279 22283 22291 22303 22307 22343 22349 22367 22369 22381 22391 22397 22409 22433 22441 22447 22453 22469 22481 22483 22501 22511 22531 22541 22543 22549 22567 22571 22573 22613 22619 22621 22637 22639 22643 22651 22669 22679 22691 22697 22699 22709 22717 22721 22727 22739 22741 22751 22769 22777 22783 22787 22807 22811 22817 22853 22859 22861 22871 22877 22901 22907 22921 22937 22943 22961 22963 22973 22993 23003 23011 23017 23021 23027 23029 23039 23041 23053 23057 23059 23063 23071 23081 23087 23099 23117 23131 23143 23159 23167 23173 23189 23197 23201 23203 23209 23227 23251 23269 23279 23291 23293 23297 23311 23321 23327 23333 23339 23357 23369 23371 23399 23417 23431 23447 23459 23473 23497 23509 23531 23537 23539 23549 23557 23561 23563 23567 23581 23593 23599 23603 23609 23623 23627 23629 23633 23663 23669 23671 23677 23687 23689 23719 23741 23743 23747 23753 23761 23767 23773 23789 23801 23813 23819 23827 23831 23833 23857 23869 23873 23879 23887 23893 23899 23909 23911 23917 23929 23957 23971 23977 23981 23993 24001 24007 24019 24023 24029 24043 24049 24061 24071 24077 24083 24091 24097 24103 24107 24109 24113 24121 24133 24137 24151 24169 24179 24181 24197 24203 24223 24229 24239 24247 24251 24281 24317 24329 24337 24359 24371 24373 24379 24391 24407 24413 24419 24421 24439 24443 24469 24473 24481 24499 24509 24517 24527 24533 24547 24551 24571 24593 24611 24623 24631 24659 24671 24677 24683 24691 24697 24709 24733 24749 24763 24767 24781 24793 24799 24809 24821 24841 24847 24851 24859 24877 24889 24907 24917 24919 24923 24943 24953 24967 24971 24977 24979 24989 25013 25031 25033 25037 25057 25073 25087 25097 25111 25117 25121 25127 25147 25153 25163 25169 25171 25183 25189 25219 25229 25237 25243 25247 25253 25261 25301 25303 25307 25309 25321 25339 25343 25349 25357 25367 25373 25391 25409 25411 25423 25439 25447 25453 25457 25463 25469 25471 25523 25537 25541 25561 25577 25579 25583 25589 25601 25603 25609 25621 25633 25639 25643 25657 25667 25673 25679 25693 25703 25717 25733 25741 25747 25759 25763 25771 25793 25799 25801 25819 25841 25847 25849 25867 25873 25889 25903 25913 25919 25931 25933 25939 25943 25951 25969 25981 25997 25999 26003 26017 26021 26029 26041 26053 26083 26099 26107 26111 26113 26119 26141 26153 26161 26171 26177 26183 26189 26203 26209 26227 26237 26249 26251 26261 26263 26267 26293 26297 26309 26317 26321 26339 26347 26357 26371 26387 26393 26399 26407 26417 26423 26431 26437 26449 26459 26479 26489 26497 26501 26513 26539 26557 26561 26573 26591 26597 26627 26633 26641 26647 26669 26681 26683 26687 26693 26699 26701 26711 26713 26717 26723 26729 26731 26737 26759 26777 26783 26801 26813 26821 26833 26839 26849 26861 26863 26879 26881 26891 26893 26903 26921 26927 26947 26951 26953 26959 26981 26987 26993 27011 27017 27031 27043 27059 27061 27067 27073 27077 27091 27103 27107 27109 27127 27143 27179 27191 27197 27211 27239 27241 27253 27259 27271 27277 27281 27283 27299 27329 27337 27361 27367 27397 27407 27409 27427 27431 27437 27449 27457 27479 27481 27487 27509 27527 27529 27539 27541 27551 27581 27583 27611 27617 27631 27647 27653 27673 27689 27691 27697 27701 27733 27737 27739 27743 27749 27751 27763 27767 27773 27779 27791 27793 27799 27803 27809 27817 27823 27827 27847 27851 27883 27893 27901 27917 27919 27941 27943 27947 27953 27961 27967 27983 27997 28001 28019 28027 28031 28051 28057 28069 28081 28087 28097 28099 28109 28111 28123 28151 28163 28181 28183 28201 28211 28219 28229 28277 28279 28283 28289 28297 28307 28309 28319 28349 28351 28387 28393 28403 28409 28411 28429 28433 28439 28447 28463 28477 28493 28499 28513 28517 28537 28541 28547 28549 28559 28571 28573 28579 28591 28597 28603 28607 28619 28621 28627 28631 28643 28649 28657 28661 28663 28669 28687 28697 28703 28711 28723 28729 28751 28753 28759 28771 28789 28793 28807 28813 28817 28837 28843 28859 28867 28871 28879 28901 28909 28921 28927 28933 28949 28961 28979 29009 29017 29021 29023 29027 29033 29059 29063 29077 29101 29123 29129 29131 29137 29147 29153 29167 29173 29179 29191 29201 29207 29209 29221 29231 29243 29251 29269 29287 29297 29303 29311 29327 29333 29339 29347 29363 29383 29387 29389 29399 29401 29411 29423 29429 29437 29443 29453 29473 29483 29501 29527 29531 29537 29567 29569 29573 29581 29587 29599 29611 29629 29633 29641 29663 29669 29671 29683 29717 29723 29741 29753 29759 29761 29789 29803 29819 29833 29837 29851 29863 29867 29873 29879 29881 29917 29921 29927 29947 29959 29983 29989 30011 30013 30029 30047 30059 30071 30089 30091 30097 30103 30109 30113 30119 30133 30137 30139 30161 30169 30181 30187 30197 30203 30211 30223 30241 30253 30259 30269 30271 30293 30307 30313 30319 30323 30341 30347 30367 30389 30391 30403 30427 30431 30449 30467 30469 30491 30493 30497 30509 30517 30529 30539 30553 30557 30559 30577 30593 30631 30637 30643 30649 30661 30671 30677 30689 30697 30703 30707 30713 30727 30757 30763 30773 30781 30803 30809 30817 30829 30839 30841 30851 30853 30859 30869 30871 30881 30893 30911 30931 30937 30941 30949 30971 30977 30983 31013 31019 31033 31039 31051 31063 31069 31079 31081 31091 31121 31123 31139 31147 31151 31153 31159 31177 31181 31183 31189 31193 31219 31223 31231 31237 31247 31249 31253 31259 31267 31271 31277 31307 31319 31321 31327 31333 31337 31357 31379 31387 31391 31393 31397 31469 31477 31481 31489 31511 31513 31517 31531 31541 31543 31547 31567 31573 31583 31601 31607 31627 31643 31649 31657 31663 31667 31687 31699 31721 31723 31727 31729 31741 31751 31769 31771 31793 31799 31817 31847 31849 31859 31873 31883 31891 31907 31957 31963 31973 31981 31991 32003 32009 32027 32029 32051 32057 32059 32063 32069 32077 32083 32089 32099 32117 32119 32141 32143 32159 32173 32183 32189 32191 32203 32213 32233 32237 32251 32257 32261 32297 32299 32303 32309 32321 32323 32327 32341 32353 32359 32363 32369 32371 32377 32381 32401 32411 32413 32423 32429 32441 32443 32467 32479 32491 32497 32503 32507 32531 32533 32537 32561 32563 32569 32573 32579 32587 32603 32609 32611 32621 32633 32647 32653 32687 32693 32707 32713 32717 32719 32749 32771 32779 32783 32789 32797 32801 32803 32831 32833 32839 32843 32869 32887 32909 32911 32917 32933 32939 32941 32957 32969 32971 32983 32987 32993 32999 33013 33023 33029 33037 33049 33053 33071 33073 33083 33091 33107 33113 33119 33149 33151 33161 33179 33181 33191 33199 33203 33211 33223 33247 33287 33289 33301 33311 33317 33329 33331 33343 33347 33349 33353 33359 33377 33391 33403 33409 33413 33427 33457 33461 33469 33479 33487 33493 33503 33521 33529 33533 33547 33563 33569 33577 33581 33587 33589 33599 33601 33613 33617 33619 33623 33629 33637 33641 33647 33679 33703 33713 33721 33739 33749 33751 33757 33767 33769 33773 33791 33797 33809 33811 33827 33829 33851 33857 33863 33871 33889 33893 33911 33923 33931 33937 33941 33961 33967 33997 34019 34031 34033 34039 34057 34061 34123 34127 34129 34141 34147 34157 34159 34171 34183 34211 34213 34217 34231 34253 34259 34261 34267 34273 34283 34297 34301 34303 34313 34319 34327 34337 34351 34361 34367 34369 34381 34403 34421 34429 34439 34457 34469 34471 34483 34487 34499 34501 34511 34513 34519 34537 34543 34549 34583 34589 34591 34603 34607 34613 34631 34649 34651 34667 34673 34679 34687 34693 34703 34721 34729 34739 34747 34757 34759 34763 34781 34807 34819 34841 34843 34847 34849 34871 34877 34883 34897 34913 34919 34939 34949 34961 34963 34981 35023 35027 35051 35053 35059 35069 35081 35083 35089 35099 35107 35111 35117 35129 35141 35149 35153 35159 35171 35201 35221 35227 35251 35257 35267 35279 35281 35291 35311 35317 35323 35327 35339 35353 35363 35381 35393 35401 35407 35419 35423 35437 35447 35449 35461 35491 35507 35509 35521 35527 35531 35533 35537 35543 35569 35573 35591 35593 35597 35603 35617 35671 35677 35729 35731 35747 35753 35759 35771 35797 35801 35803 35809 35831 35837 35839 35851 35863 35869 35879 35897 35899 35911 35923 35933 35951 35963 35969 35977 35983 35993 35999 36007 36011 36013 36017 36037 36061 36067 36073 36083 36097 36107 36109 36131 36137 36151 36161 36187 36191 36209 36217 36229 36241 36251 36263 36269 36277 36293 36299 36307 36313 36319 36341 36343 36353 36373 36383 36389 36433 36451 36457 36467 36469 36473 36479 36493 36497 36523 36527 36529 36541 36551 36559 36563 36571 36583 36587 36599 36607 36629 36637 36643 36653 36671 36677 36683 36691 36697 36709 36713 36721 36739 36749 36761 36767 36779 36781 36787 36791 36793 36809 36821 36833 36847 36857 36871 36877 36887 36899 36901 36913 36919 36923 36929 36931 36943 36947 36973 36979 36997 37003 37013 37019 37021 37039 37049 37057 37061 37087 37097 37117 37123 37139 37159 37171 37181 37189 37199 37201 37217 37223 37243 37253 37273 37277 37307 37309 37313 37321 37337 37339 37357 37361 37363 37369 37379 37397 37409 37423 37441 37447 37463 37483 37489 37493 37501 37507 37511 37517 37529 37537 37547 37549 37561 37567 37571 37573 37579 37589 37591 37607 37619 37633 37643 37649 37657 37663 37691 37693 37699 37717 37747 37781 37783 37799 37811 37813 37831 37847 37853 37861 37871 37879 37889 37897 37907 37951 37957 37963 37967 37987 37991 37993 37997 38011 38039 38047 38053 38069 38083 38113 38119 38149 38153 38167 38177 38183 38189 38197 38201 38219 38231 38237 38239 38261 38273 38281 38287 38299 38303 38317 38321 38327 38329 38333 38351 38371 38377 38393 38431 38447 38449 38453 38459 38461 38501 38543 38557 38561 38567 38569 38593 38603 38609 38611 38629 38639 38651 38653 38669 38671 38677 38693 38699 38707 38711 38713 38723 38729 38737 38747 38749 38767 38783 38791 38803 38821 38833 38839 38851 38861 38867 38873 38891 38903 38917 38921 38923 38933 38953 38959 38971 38977 38993 39019 39023 39041 39043 39047 39079 39089 39097 39103 39107 39113 39119 39133 39139 39157 39161 39163 39181 39191 39199 39209 39217 39227 39229 39233 39239 39241 39251 39293 39301 39313 39317 39323 39341 39343 39359 39367 39371 39373 39383 39397 39409 39419 39439 39443 39451 39461 39499 39503 39509 39511 39521 39541 39551 39563 39569 39581 39607 39619 39623 39631 39659 39667 39671 39679 39703 39709 39719 39727 39733 39749 39761 39769 39779 39791 39799 39821 39827 39829 39839 39841 39847 39857 39863 39869 39877 39883 39887 39901 39929 39937 39953 39971 39979 39983 39989 40009 40013 40031 40037 40039 40063 40087 40093 40099 40111 40123 40127 40129 40151 40153 40163 40169 40177 40189 40193 40213 40231 40237 40241 40253 40277 40283 40289 40343 40351 40357 40361 40387 40423 40427 40429 40433 40459 40471 40483 40487 40493 40499 40507 40519 40529 40531 40543 40559 40577 40583 40591 40597 40609 40627 40637 40639 40693 40697 40699 40709 40739 40751 40759 40763 40771 40787 40801 40813 40819 40823 40829 40841 40847 40849 40853 40867 40879 40883 40897 40903 40927 40933 40939 40949 40961 40973 40993 41011 41017 41023 41039 41047 41051 41057 41077 41081 41113 41117 41131 41141 41143 41149 41161 41177 41179 41183 41189 41201 41203 41213 41221 41227 41231 41233 41243 41257 41263 41269 41281 41299 41333 41341 41351 41357 41381 41387 41389 41399 41411 41413 41443 41453 41467 41479 41491 41507 41513 41519 41521 41539 41543 41549 41579 41593 41597 41603 41609 41611 41617 41621 41627 41641 41647 41651 41659 41669 41681 41687 41719 41729 41737 41759 41761 41771 41777 41801 41809 41813 41843 41849 41851 41863 41879 41887 41893 41897 41903 41911 41927 41941 41947 41953 41957 41959 41969 41981 41983 41999 42013 42017 42019 42023 42043 42061 42071 42073 42083 42089 42101 42131 42139 42157 42169 42179 42181 42187 42193 42197 42209 42221 42223 42227 42239 42257 42281 42283 42293 42299 42307 42323 42331 42337 42349 42359 42373 42379 42391 42397 42403 42407 42409 42433 42437 42443 42451 42457 42461 42463 42467 42473 42487 42491 42499 42509 42533 42557 42569 42571 42577 42589 42611 42641 42643 42649 42667 42677 42683 42689 42697 42701 42703 42709 42719 42727 42737 42743 42751 42767 42773 42787 42793 42797 42821 42829 42839 42841 42853 42859 42863 42899 42901 42923 42929 42937 42943 42953 42961 42967 42979 42989 43003 43013 43019 43037 43049 43051 43063 43067 43093 43103 43117 43133 43151 43159 43177 43189 43201 43207 43223 43237 43261 43271 43283 43291 43313 43319 43321 43331 43391 43397 43399 43403 43411 43427 43441 43451 43457 43481 43487 43499 43517 43541 43543 43573 43577 43579 43591 43597 43607 43609 43613 43627 43633 43649 43651 43661 43669 43691 43711 43717 43721 43753 43759 43777 43781 43783 43787 43789 43793 43801 43853 43867 43889 43891 43913 43933 43943 43951 43961 43963 43969 43973 43987 43991 43997 44017 44021 44027 44029 44041 44053 44059 44071 44087 44089 44101 44111 44119 44123 44129 44131 44159 44171 44179 44189 44201 44203 44207 44221 44249 44257 44263 44267 44269 44273 44279 44281 44293 44351 44357 44371 44381 44383 44389 44417 44449 44453 44483 44491 44497 44501 44507 44519 44531 44533 44537 44543 44549 44563 44579 44587 44617 44621 44623 44633 44641 44647 44651 44657 44683 44687 44699 44701 44711 44729 44741 44753 44771 44773 44777 44789 44797 44809 44819 44839 44843 44851 44867 44879 44887 44893 44909 44917 44927 44939 44953 44959 44963 44971 44983 44987 45007 45013 45053 45061 45077 45083 45119 45121 45127 45131 45137 45139 45161 45179 45181 45191 45197 45233 45247 45259 45263 45281 45289 45293 45307 45317 45319 45329 45337 45341 45343 45361 45377 45389 45403 45413 45427 45433 45439 45481 45491 45497 45503 45523 45533 45541 45553 45557 45569 45587 45589 45599 45613 45631 45641 45659 45667 45673 45677 45691 45697 45707 45737 45751 45757 45763 45767 45779 45817 45821 45823 45827 45833 45841 45853 45863 45869 45887 45893 45943 45949 45953 45959 45971 45979 45989 46021 46027 46049 46051 46061 46073 46091 46093 46099 46103 46133 46141 46147 46153 46171 46181 46183 46187 46199 46219 46229 46237 46261 46271 46273 46279 46301 46307 46309 46327 46337 46349 46351 46381 46399 46411 46439 46441 46447 46451 46457 46471 46477 46489 46499 46507 46511 46523 46549 46559 46567 46573 46589 46591 46601 46619 46633 46639 46643 46649 46663 46679 46681 46687 46691 46703 46723 46727 46747 46751 46757 46769 46771 46807 46811 46817 46819 46829 46831 46853 46861 46867 46877 46889 46901 46919 46933 46957 46993 46997 47017 47041 47051 47057 47059 47087 47093 47111 47119 47123 47129 47137 47143 47147 47149 47161 47189 47207 47221 47237 47251 47269 47279 47287 47293 47297 47303 47309 47317 47339 47351 47353 47363 47381 47387 47389 47407 47417 47419 47431 47441 47459 47491 47497 47501 47507 47513 47521 47527 47533 47543 47563 47569 47581 47591 47599 47609 47623 47629 47639 47653 47657 47659 47681 47699 47701 47711 47713 47717 47737 47741 47743 47777 47779 47791 47797 47807 47809 47819 47837 47843 47857 47869 47881 47903 47911 47917 47933 47939 47947 47951 47963 47969 47977 47981 48017 48023 48029 48049 48073 48079 48091 48109 48119 48121 48131 48157 48163 48179 48187 48193 48197 48221 48239 48247 48259 48271 48281 48299 48311 48313 48337 48341 48353 48371 48383 48397 48407 48409 48413 48437 48449 48463 48473 48479 48481 48487 48491 48497 48523 48527 48533 48539 48541 48563 48571 48589 48593 48611 48619 48623 48647 48649 48661 48673 48677 48679 48731 48733 48751 48757 48761 48767 48779 48781 48787 48799 48809 48817 48821 48823 48847 48857 48859 48869 48871 48883 48889 48907 48947 48953 48973 48989 48991 49003 49009 49019 49031 49033 49037 49043 49057 49069 49081 49103 49109 49117 49121 49123 49139 49157 49169 49171 49177 49193 49199 49201 49207 49211 49223 49253 49261 49277 49279 49297 49307 49331 49333 49339 49363 49367 49369 49391 49393 49409 49411 49417 49429 49433 49451 49459 49463 49477 49481 49499 49523 49529 49531 49537 49547 49549 49559 49597 49603 49613 49627 49633 49639 49663 49667 49669 49681 49697 49711 49727 49739 49741 49747 49757 49783 49787 49789 49801 49807 49811 49823 49831 49843 49853 49871 49877 49891 49919 49921 49927 49937 49939 49943 49957 49991 49993 49999
index deec040cbb8e86309a14e663cbfefdc31bdb1ab0..f7b244c9c39ee3d87bcd60746c13f922740f8e4f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: takc.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: takc.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 let rec tak x y z =
   if x > y then tak (tak (x-1) y z) (tak (y-1) z x) (tak (z-1) x y)
@@ -20,4 +20,3 @@ let rec repeat n =
   if n <= 0 then 0 else tak 18 12 6 + repeat(n-1)
 
 let _ = print_int (repeat 2000); print_newline(); exit 0
-
diff --git a/testsuite/tests/regression/pr5757/Makefile b/testsuite/tests/regression/pr5757/Makefile
new file mode 100644 (file)
index 0000000..a31a394
--- /dev/null
@@ -0,0 +1,4 @@
+MAIN_MODULE=pr5757
+
+include ../../../makefiles/Makefile.one
+include ../../../makefiles/Makefile.common
diff --git a/testsuite/tests/regression/pr5757/pr5757.ml b/testsuite/tests/regression/pr5757/pr5757.ml
new file mode 100644 (file)
index 0000000..22b36d7
--- /dev/null
@@ -0,0 +1,5 @@
+Random.init 3;;
+for i = 0 to 100_000 do
+  ignore (String.create (Random.int 1_000_000))
+done;;
+Printf.printf "hello world\n";;
diff --git a/testsuite/tests/regression/pr5757/pr5757.reference b/testsuite/tests/regression/pr5757/pr5757.reference
new file mode 100644 (file)
index 0000000..3b18e51
--- /dev/null
@@ -0,0 +1 @@
+hello world
index c382320bf37d2d6fb660d4eed66b2a2ae430f27a..3f8efd9577d66f3eb035709995fd0486b146882d 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: gram_aux.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: gram_aux.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Auxiliaries for the parser. *)
 
@@ -44,4 +44,3 @@ let rec subtract l1 l2 =
   match l1 with
     [] -> []
   | a::l -> if List.mem a l2 then subtract l l2 else a :: subtract l l2
-
index 7e5a1dce0ffb920da774a536e3d70093a0c44c09..20602988ab85b5b4d3bb0114525bb31940dc6737 100644 (file)
@@ -10,7 +10,7 @@
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: grammar.mly 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: grammar.mly 12800 2012-07-30 18:59:07Z doligez $ */
 
 /* The grammar for lexer definitions */
 
@@ -50,7 +50,7 @@ header:
 other_definitions:
     other_definitions Tand definition
         { $3::$1 }
-  |     
+  |
         { [] }
 ;
 definition:
@@ -111,4 +111,3 @@ char_class1:
 ;
 
 %%
-
index 2381a98935d364daa6f4d46361aee747559faf07..2485d39b2f3fa776d10c1f43b464c6d7dd9e53e2 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: input 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: input 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* The lexical analyzer for lexer definitions. *)
 
@@ -21,27 +21,27 @@ open Scan_aux
 }
 
 rule main = parse
-    [' ' '\010' '\013' '\009' ] + 
+    [' ' '\010' '\013' '\009' ] +
     { main lexbuf }
-  | "(*" 
+  | "(*"
     { comment_depth := 1;
       comment lexbuf;
       main lexbuf }
   | (['A'-'Z' 'a'-'z'] | '_' ['A'-'Z' 'a'-'z' '\'' '0'-'9'])
-    ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) * 
+    ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) *
     { match Lexing.lexeme lexbuf with
         "rule" -> Trule
       | "parse" -> Tparse
       | "and" -> Tand
       | "eof" -> Teof
       | s -> Tident s }
-  | '"' 
+  | '"'
     { reset_string_buffer();
       string lexbuf;
       Tstring(get_stored_string()) }
-  | "'" 
+  | "'"
     { Tchar(char lexbuf) }
-  | '{' 
+  | '{'
     { let n1 = Lexing.lexeme_end lexbuf in
         brace_depth := 1;
         let n2 = action lexbuf in
@@ -66,68 +66,68 @@ rule main = parse
     { raise(Lexical_error("illegal character " ^ Lexing.lexeme lexbuf)) }
 
 and action = parse
-    '{' 
+    '{'
     { incr brace_depth;
       action lexbuf }
-  | '}' 
+  | '}'
     { decr brace_depth;
       if !brace_depth = 0 then Lexing.lexeme_start lexbuf else action lexbuf }
-  | '"' 
+  | '"'
     { reset_string_buffer();
       string lexbuf;
       reset_string_buffer();
       action lexbuf }
   | '\''
     { let _ = char lexbuf in action lexbuf }
-  | "(*" 
+  | "(*"
     { comment_depth := 1;
       comment lexbuf;
       action lexbuf }
-  | eof 
+  | eof
     { raise (Lexical_error "unterminated action") }
-  | _ 
+  | _
     { action lexbuf }
-      
+
 and string = parse
-    '"' 
+    '"'
     { () }
   | '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
     { string lexbuf }
-  | '\\' ['\\' '"' 'n' 't' 'b' 'r'] 
+  | '\\' ['\\' '"' 'n' 't' 'b' 'r']
     { store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
       string lexbuf }
-  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] 
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
     { store_string_char(char_for_decimal_code lexbuf 1);
       string lexbuf }
-  | eof 
+  | eof
     { raise(Lexical_error "unterminated string") }
-  | _ 
+  | _
     { store_string_char(Lexing.lexeme_char lexbuf 0);
       string lexbuf }
 
 and char = parse
-    [^ '\\'] "'" 
+    [^ '\\'] "'"
     { Lexing.lexeme_char lexbuf 0 }
-  | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'" 
+  | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'"
     { char_for_backslash (Lexing.lexeme_char lexbuf 1) }
-  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" 
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
     { char_for_decimal_code lexbuf 1 }
-  | _ 
+  | _
     { raise(Lexical_error "bad character constant") }
 
 and comment = parse
-    "(*" 
+    "(*"
     { incr comment_depth; comment lexbuf }
-  | "*)" 
+  | "*)"
     { decr comment_depth;
       if !comment_depth = 0 then () else comment lexbuf }
-  | '"' 
+  | '"'
     { reset_string_buffer();
       string lexbuf;
       reset_string_buffer();
       comment lexbuf }
-  | eof 
+  | eof
     { raise(Lexical_error "unterminated comment") }
-  | _ 
+  | _
     { comment lexbuf }
 ;;
index 57d17c08d1627d3181bd4986327ddca5aefc5633..002bf72c7ef7fe75fd5306ade51033739f1dd435 100644 (file)
@@ -309,4 +309,3 @@ and char lexbuf =
 and comment lexbuf =
   Lexing.init lexbuf;
   state_4 lexbuf
-
index a4eb6a967a24a339f08a59167b59e600e32f47c3..7b00ec926f61992592cd651c1ff4133dd1a79258 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: lexgen.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: lexgen.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Compiling a lexer definition *)
 
@@ -200,7 +200,7 @@ let memory = (Hashtbl.create 131 : (transition list, int) Hashtbl.t)
 let todo = ref ([] : (transition list * int) list)
 let next = ref 0
 
-let get_state st = 
+let get_state st =
   try
     Hashtbl.find memory st
   with Not_found ->
@@ -222,7 +222,7 @@ let goto_state = function
   | ps -> Goto (get_state ps)
 
 
-let transition_from chars follow pos_set = 
+let transition_from chars follow pos_set =
   let tr = Array.create 256 []
   and shift = Array.create 256 Backtrack in
     List.iter
@@ -263,4 +263,3 @@ let make_dfa lexdef =
     Array.create (number_of_states()) (Perform 0) in
   List.iter (fun (auto, i) -> v.(i) <- auto) states;
   (initial_states, v, actions)
-
index 7711833a4cc50d0d2c24f2f8a163c82ac049a485..f3dac422910d44f94ae1dd1e97f37ae1cfd58d6f 100644 (file)
@@ -310,4 +310,3 @@ and char lexbuf =
 and comment lexbuf =
   Lexing.init lexbuf;
   state_4 lexbuf
-
index 9d3948a84fc7cf9c2c483bdda987468e9ae7921e..44334b809d2e7634014d550d3bbc58dc028eee9c 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: output.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: output.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Generating a DFA as a set of mutually recursive functions *)
 
@@ -137,7 +137,7 @@ let output_state state_num = function
 
 
 (* 3- Generating the entry points *)
-          
+
 let rec output_entries = function
     [] -> failwith "output_entries"
   | (name,state_num) :: rest ->
@@ -146,7 +146,7 @@ let rec output_entries = function
       output_string !oc ("  state_" ^ string_of_int state_num ^
                         " lexbuf\n");
       match rest with
-        [] -> output_string !oc "\n"; ()
+        [] -> ()
       | _  -> output_string !oc "\nand "; output_entries rest
 
 
@@ -164,6 +164,3 @@ let output_lexdef header (initial_st, st, actions) =
     output_state i st.(i)
   done;
   output_entries initial_st
-
-
-
index cdadcfe8268c76185075310b9d113cf1e68e0877..25b48b36c310abc42f588c967e56da4def0db3d9 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: scan_aux.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: scan_aux.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Auxiliaries for the lexical analyzer *)
 
@@ -57,4 +57,3 @@ let char_for_decimal_code lexbuf i =
   Char.chr(100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
             10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
                  (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48))
-
index 251f04c2d4f33d50b1f91c733b14b4c85c8b966d..2fc897dbda7814164b94245257e4369ed4c66e5b 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: scanner.mll 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: scanner.mll 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* The lexical analyzer for lexer definitions. *)
 
@@ -21,27 +21,27 @@ open Scan_aux
 }
 
 rule main = parse
-    [' ' '\010' '\013' '\009' ] + 
+    [' ' '\010' '\013' '\009' ] +
     { main lexbuf }
-  | "(*" 
+  | "(*"
     { comment_depth := 1;
       comment lexbuf;
       main lexbuf }
   | (['A'-'Z' 'a'-'z'] | '_' ['A'-'Z' 'a'-'z' '\'' '0'-'9'])
-    ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) * 
+    ( '_' ? ['A'-'Z' 'a'-'z' ''' '0'-'9'] ) *
     { match Lexing.lexeme lexbuf with
         "rule" -> Trule
       | "parse" -> Tparse
       | "and" -> Tand
       | "eof" -> Teof
       | s -> Tident s }
-  | '"' 
+  | '"'
     { reset_string_buffer();
       string lexbuf;
       Tstring(get_stored_string()) }
-  | "'" 
+  | "'"
     { Tchar(char lexbuf) }
-  | '{' 
+  | '{'
     { let n1 = Lexing.lexeme_end lexbuf in
         brace_depth := 1;
         let n2 = action lexbuf in
@@ -66,67 +66,67 @@ rule main = parse
     { raise(Lexical_error("illegal character " ^ Lexing.lexeme lexbuf)) }
 
 and action = parse
-    '{' 
+    '{'
     { incr brace_depth;
       action lexbuf }
-  | '}' 
+  | '}'
     { decr brace_depth;
       if !brace_depth = 0 then Lexing.lexeme_start lexbuf else action lexbuf }
-  | '"' 
+  | '"'
     { reset_string_buffer();
       string lexbuf;
       reset_string_buffer();
       action lexbuf }
   | '\''
     { let _ = char lexbuf in action lexbuf }
-  | "(*" 
+  | "(*"
     { comment_depth := 1;
       comment lexbuf;
       action lexbuf }
-  | eof 
+  | eof
     { raise (Lexical_error "unterminated action") }
-  | _ 
+  | _
     { action lexbuf }
-      
+
 and string = parse
-    '"' 
+    '"'
     { () }
   | '\\' [' ' '\010' '\013' '\009' '\026' '\012'] +
     { string lexbuf }
-  | '\\' ['\\' '"' 'n' 't' 'b' 'r'] 
+  | '\\' ['\\' '"' 'n' 't' 'b' 'r']
     { store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
       string lexbuf }
-  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] 
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9']
     { store_string_char(char_for_decimal_code lexbuf 1);
       string lexbuf }
-  | eof 
+  | eof
     { raise(Lexical_error "unterminated string") }
-  | _ 
+  | _
     { store_string_char(Lexing.lexeme_char lexbuf 0);
       string lexbuf }
 
 and char = parse
-    [^ '\\'] "'" 
+    [^ '\\'] "'"
     { Lexing.lexeme_char lexbuf 0 }
-  | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'" 
+  | '\\' ['\\' '\'' 'n' 't' 'b' 'r'] "'"
     { char_for_backslash (Lexing.lexeme_char lexbuf 1) }
-  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" 
+  | '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'"
     { char_for_decimal_code lexbuf 1 }
-  | _ 
+  | _
     { raise(Lexical_error "bad character constant") }
 
 and comment = parse
-    "(*" 
+    "(*"
     { incr comment_depth; comment lexbuf }
-  | "*)" 
+  | "*)"
     { decr comment_depth;
       if !comment_depth = 0 then () else comment lexbuf }
-  | '"' 
+  | '"'
     { reset_string_buffer();
       string lexbuf;
       reset_string_buffer();
       comment lexbuf }
-  | eof 
+  | eof
     { raise(Lexical_error "unterminated comment") }
-  | _ 
+  | _
     { comment lexbuf }
index 59a15398ba24fdbb166334ff7635a08761b5b1c4..11aadaa92e0d1557f7d8450f776c0443fdbec308 100644 (file)
@@ -7,7 +7,7 @@ ocamlc -nostdlib -I ../../stdlib \
   t301-object.ml -o t301-object.byte
 
 ***)
-(* $Id: t301-object.ml 11123 2011-07-20 09:17:07Z doligez $ *)
+(* $Id: t301-object.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 
 class c = object (self)
@@ -26,4 +26,4 @@ let (x,y,z) = f () in
   if y <> 2 then raise Not_found;
   if z <> 4 then raise Not_found;;
 
-(**** eof $Id: t301-object.ml 11123 2011-07-20 09:17:07Z doligez $ *)
+(**** eof $Id: t301-object.ml 12800 2012-07-30 18:59:07Z doligez $ *)
index 4dd76258f2e285a11ad522cf92f20b00e35d50f0..aef0d33d610643c3d360146486c3ecfa8a08e504 100644 (file)
@@ -9,7 +9,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: odoc_test.ml 12354 2012-04-13 13:49:23Z doligez $ *)
+(* $Id: odoc_test.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (** Custom generator to perform test on ocamldoc. *)
 
@@ -27,64 +27,64 @@ class string_gen =
     inherit Odoc_info.Scan.scanner
 
     val mutable test_kinds = []
-    val mutable fmt = Format.str_formatter 
+    val mutable fmt = Format.str_formatter
 
     method must_display_types = List.mem Types_display test_kinds
 
     method set_test_kinds_from_module m =
       test_kinds <- List.fold_left
-         (fun acc (s, _) ->
-           match s with
-             "test_types_display" -> Types_display :: acc
-           | _ -> acc
-         )
-         []
-         (
-          match m.m_info with
-            None -> []
-          | Some i -> i.i_custom
-         )
+          (fun acc (s, _) ->
+            match s with
+              "test_types_display" -> Types_display :: acc
+            | _ -> acc
+          )
+          []
+          (
+           match m.m_info with
+             None -> []
+           | Some i -> i.i_custom
+          )
     method! scan_type t =
       match test_kinds with
-       [] -> ()
-      |        _ ->
-         p fmt "# type %s:\n" t.ty_name;
-         if self#must_display_types then
-           (
-            p fmt "# manifest (Odoc_info.string_of_type_expr):\n<[%s]>\n"
-              (match t.ty_manifest with
-                None -> "None"
-              | Some e -> Odoc_info.string_of_type_expr e
-              );
-           );
+        [] -> ()
+      | _ ->
+          p fmt "# type %s:\n" t.ty_name;
+          if self#must_display_types then
+            (
+             p fmt "# manifest (Odoc_info.string_of_type_expr):\n<[%s]>\n"
+               (match t.ty_manifest with
+                 None -> "None"
+               | Some e -> Odoc_info.string_of_type_expr e
+               );
+            );
 
 
     method! scan_module_pre m =
       p fmt "#\n# module %s:\n" m.m_name ;
       if self#must_display_types then
-       (
-        p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
-          (Odoc_info.string_of_module_type m.m_type);
-        p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
-          (Odoc_info.string_of_module_type ~complete: true m.m_type);
-       );
+        (
+         p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
+           (Odoc_info.string_of_module_type m.m_type);
+         p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
+           (Odoc_info.string_of_module_type ~complete: true m.m_type);
+        );
       true
 
     method! scan_module_type_pre m =
       p fmt "#\n# module type %s:\n" m.mt_name ;
       if self#must_display_types then
-       (
-        p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
-          (match m.mt_type with
-            None -> "None"
-          | Some t -> Odoc_info.string_of_module_type t
-          );
-        p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
-          (match m.mt_type with
-            None -> "None"
-          | Some t -> Odoc_info.string_of_module_type ~complete: true t
-          );
-       );
+        (
+         p fmt "# Odoc_info.string_of_module_type:\n<[%s]>\n"
+           (match m.mt_type with
+             None -> "None"
+           | Some t -> Odoc_info.string_of_module_type t
+           );
+         p fmt "# Odoc_info.string_of_module_type ~complete: true :\n<[%s]>\n"
+           (match m.mt_type with
+             None -> "None"
+           | Some t -> Odoc_info.string_of_module_type ~complete: true t
+           );
+        );
       true
 
     method generate (module_list: Odoc_info.Module.t_module list) =
@@ -92,15 +92,15 @@ class string_gen =
       fmt <- Format.formatter_of_out_channel oc;
       (
        try
-        List.iter
-          (fun m -> 
-            self#set_test_kinds_from_module m;
-            self#scan_module_list [m];
-          )
-          module_list
+         List.iter
+           (fun m ->
+             self#set_test_kinds_from_module m;
+             self#scan_module_list [m];
+           )
+           module_list
        with
-        e ->
-          prerr_endline (Printexc.to_string e)
+         e ->
+           prerr_endline (Printexc.to_string e)
       );
       Format.pp_print_flush fmt ();
       close_out oc
index 6caf3d7afcd0f582e42f50ea92cf6c67e33ea79c..d253be43dbc25cb3f1048fe655a240db47dab039 100644 (file)
@@ -7,7 +7,7 @@ let x = 1
 
 
 module M = struct
-  let y = 2 
+  let y = 2
 
 end
 
index 43f1857d5670accd0875baa8358ba3ce80f28d27..3d06cc59696bbd3eb3af34373c96887aa01c9da7 100644 (file)
@@ -4,4 +4,4 @@ module Bar = struct type t = int let x = 2 end;;
 
 module type MT2 = sig type t val x : t end;;
 module type Gee = MT2 with type t = float ;;
-module T = (val (if true then (module Foo:MT2 with type t = int) else (module Bar: MT2 with type t = int)) : MT2 with type t = int);;
\ No newline at end of file
+module T = (val (if true then (module Foo:MT2 with type t = int) else (module Bar: MT2 with type t = int)) : MT2 with type t = int);;
index 905af534636a2324a930b2b99770efdeffea8d70..268d35d49272ca18c32b87029c4904cc2ad6ec10 100644 (file)
@@ -139,4 +139,3 @@ end
 let () =
   print_endline (Print.to_string int 10);
   print_endline (Print.to_string (pair int (pair str int)) (123, ("A", 456)))
-
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index 895be5a05c4c9e3e78141409e3fb9e6c0e95b784..2636d5b4246151fb738ab9f960746cdae18985d9 100644 (file)
@@ -18,7 +18,7 @@ type variant =
   | VString of string
   | VList of variant list
   | VPair of variant * variant
+
 let rec variantize: type t. t ty -> t -> variant =
   fun ty x ->
     (* type t is abstract here *)
@@ -31,9 +31,9 @@ let rec variantize: type t. t ty -> t -> variant =
     | Pair (ty1, ty2) ->
         VPair (variantize ty1 (fst x), variantize ty2 (snd x))
         (* t = ('a, 'b) for some 'a and 'b *)
+
 exception VariantMismatch
+
 let rec devariantize: type t. t ty -> variant -> t =
   fun ty v ->
     match ty, v with
@@ -54,16 +54,16 @@ type 'a ty =
   | List: 'a ty -> 'a list ty
   | Pair: ('a ty * 'b ty) -> ('a * 'b) ty
   | Record: 'a record -> 'a ty
+
 and 'a record =
     {
      path: string;
      fields: 'a field_ list;
     }
+
 and 'a field_ =
   | Field: ('a, 'b) field -> 'a field_
+
 and ('a, 'b) field =
     {
      label: string;
@@ -98,7 +98,7 @@ let rec variantize: type t. t ty -> t -> variant =
           (List.map (fun (Field{field_type; label; get}) ->
                        (label, variantize field_type (get x))) fields)
 ;;
+
 (* Extraction *)
 
 type 'a ty =
@@ -107,7 +107,7 @@ type 'a ty =
   | List: 'a ty -> 'a list ty
   | Pair: ('a ty * 'b ty) -> ('a * 'b) ty
   | Record: ('a, 'builder) record -> 'a ty
+
 and ('a, 'builder) record =
     {
      path: string;
@@ -115,10 +115,10 @@ and ('a, 'builder) record =
      create_builder: (unit -> 'builder);
      of_builder: ('builder -> 'a);
     }
+
 and ('a, 'builder) field =
   | Field: ('a, 'builder, 'b) field_ -> ('a, 'builder) field
+
 and ('a, 'builder, 'b) field_ =
   {
    label: string;
@@ -126,7 +126,7 @@ and ('a, 'builder, 'b) field_ =
    get: ('a -> 'b);
    set: ('builder -> 'b -> unit);
   }
+
 let rec devariantize: type t. t ty -> variant -> t =
   fun ty v ->
     match ty, v with
@@ -154,7 +154,7 @@ type my_record  =
      a: int;
      b: string list;
     }
+
 let my_record =
   let fields =
     [
index 3fb5730aaeeaf525ec52ceb57efd3dda1cdbc715..3ba7cc8b84f2d1c412d3ac9feef04827beafe8e6 100644 (file)
@@ -1,23 +1,23 @@
-module Exp = 
+module Exp =
   struct
 
-    type _ t = 
+    type _ t =
       | IntLit : int -> int t
       | BoolLit : bool -> bool t
       | Pair : 'a t * 'b t -> ('a * 'b) t
       | App : ('a -> 'b) t * 'a t -> 'b t
-      | Abs : ('a -> 'b) -> ('a -> 'b) t 
+      | Abs : ('a -> 'b) -> ('a -> 'b) t
 
 
-    let rec eval : type s . s t -> s = 
+    let rec eval : type s . s t -> s =
       function
-       | IntLit x -> x
-       | BoolLit y -> y
-       | Pair (x,y) ->
+        | IntLit x -> x
+        | BoolLit y -> y
+        | Pair (x,y) ->
             (eval x,eval y)
-       | App (f,a) ->
-           (eval f) (eval a)
-       | Abs f -> f 
+        | App (f,a) ->
+            (eval f) (eval a)
+        | Abs f -> f
 
     let discern : type a. a t -> _ = function
         IntLit _ -> 1
@@ -28,70 +28,70 @@ module Exp =
   end
 ;;
 
-module List = 
+module List =
   struct
     type zero
-    type _ t = 
+    type _ t =
       | Nil : zero t
       | Cons : 'a * 'b t -> ('a * 'b) t
     let head =
       function
-       | Cons (a,b) -> a
+        | Cons (a,b) -> a
     let tail =
       function
-       | Cons (a,b) -> b
-    let rec length : type a . a t -> int = 
+        | Cons (a,b) -> b
+    let rec length : type a . a t -> int =
       function
-       | Nil -> 0
-       | Cons (a,b) -> length b
+        | Nil -> 0
+        | Cons (a,b) -> length b
   end
 ;;
 
-module Nonexhaustive = 
+module Nonexhaustive =
   struct
-    type 'a u = 
-      | C1 : int -> int u 
+    type 'a u =
+      | C1 : int -> int u
       | C2 : bool -> bool u
-           
-    type 'a v = 
+
+    type 'a v =
       | C1 : int -> int v
 
-    let unexhaustive : type s . s u -> s = 
+    let unexhaustive : type s . s u -> s =
       function
-       | C2 x -> x
+        | C2 x -> x
 
 
-    module M : sig type t type u end = 
+    module M : sig type t type u end =
       struct
         type t = int
         type u = bool
-      end          
-    type 'a t = 
-      | Foo : M.t -> M.t t 
+      end
+    type 'a t =
+      | Foo : M.t -> M.t t
       | Bar : M.u -> M.u t
     let same_type : type s . s t * s t -> bool  =
       function
-       | Foo _ , Foo _ -> true
-       | Bar _, Bar _ -> true
+        | Foo _ , Foo _ -> true
+        | Bar _, Bar _ -> true
   end
 ;;
 
-module Exhaustive = 
+module Exhaustive =
   struct
     type t = int
     type u = bool
-    type 'a v = 
-      | Foo : t -> t v 
+    type 'a v =
+      | Foo : t -> t v
       | Bar : u -> u v
 
     let same_type : type s . s v * s v -> bool  =
       function
-       | Foo _ , Foo _ -> true
-       | Bar _, Bar _ -> true    
+        | Foo _ , Foo _ -> true
+        | Bar _, Bar _ -> true
   end
 ;;
 
-module Existential_escape = 
+module Existential_escape =
   struct
     type _ t = C : int -> int t
     type u = D : 'a t -> u
@@ -99,46 +99,46 @@ module Existential_escape =
   end
 ;;
 
-module Rectype = 
+module Rectype =
   struct
-    type (_,_) t = C : ('a,'a) t 
-    let _ = 
+    type (_,_) t = C : ('a,'a) t
+    let _ =
       fun (type s) ->
-       let a : (s, s * s) t = failwith "foo" in 
-       match a with
-         C ->
-           ()
+        let a : (s, s * s) t = failwith "foo" in
+        match a with
+          C ->
+            ()
   end
 ;;
 
-module Or_patterns = 
+module Or_patterns =
 struct
-      type _ t = 
+      type _ t =
       | IntLit : int -> int t
       | BoolLit : bool -> bool t
 
-    let rec eval : type s . s t -> unit = 
+    let rec eval : type s . s t -> unit =
       function
-       | (IntLit _ | BoolLit _) -> ()
+        | (IntLit _ | BoolLit _) -> ()
 
 end
 ;;
 
-module Polymorphic_variants = 
+module Polymorphic_variants =
   struct
-      type _ t = 
+      type _ t =
       | IntLit : int -> int t
       | BoolLit : bool -> bool t
 
-    let rec eval : type s . [`A] * s t -> unit = 
+    let rec eval : type s . [`A] * s t -> unit =
       function
-       | `A, IntLit _ -> ()
-       | `A, BoolLit _ -> ()
-  end    
+        | `A, IntLit _ -> ()
+        | `A, BoolLit _ -> ()
+  end
 ;;
 
 module Propagation = struct
-  type _ t = 
+  type _ t =
       IntLit : int -> int t
     | BoolLit : bool -> bool t
 
@@ -473,7 +473,7 @@ f V1;;
 type _ int_foo =
   | IF_constr : <foo:int; ..> int_foo
 
-type _ int_bar = 
+type _ int_bar =
   | IB_constr : <bar:int; ..> int_bar
 ;;
 
index 3125e1e6a5dd482d2e5c68b00d72832a9a2faeae..b5dcb790dd8611aba0d7773269fab9c2466d2fb2 100644 (file)
     val tail : ('a * 'b) t -> 'b t
     val length : 'a t -> int
   end
-#                                                         Characters 206-227:
+#                                                         Characters 196-224:
   ......function
-       | C2 x -> x
+          | C2 x -> x
 Warning 8: this pattern-matching is not exhaustive.
 Here is an example of a value that is not matched:
 C1 _
-Characters 469-526:
+Characters 458-529:
   ......function
-       | Foo _ , Foo _ -> true
-       | Bar _, Bar _ -> true
+          | Foo _ , Foo _ -> true
+          | Bar _, Bar _ -> true
 Warning 8: this pattern-matching is not exhaustive.
 Here is an example of a value that is not matched:
 (Bar _, Foo _)
@@ -47,27 +47,27 @@ module Nonexhaustive :
     type 'a v = Foo : t -> t v | Bar : u -> u v
     val same_type : 's v * 's v -> bool
   end
-#               Characters 119-120:
+#               Characters 118-119:
       let eval (D x) = x
                        ^
 Error: This expression has type ex#16 t
        but an expression was expected of type ex#16 t
        The type constructor ex#16 would escape its scope
-#                       Characters 157-158:
-         C ->
-     ^
+#                       Characters 174-175:
+            C ->
+            ^
 Error: Recursive local constraint when unifying (s, s) t with (s, s * s) t
-#                         Characters 174-182:
-       | (IntLit _ | BoolLit _) -> ()
-      ^^^^^^^^
+#                         Characters 178-186:
+          | (IntLit _ | BoolLit _) -> ()
+             ^^^^^^^^
 Error: This pattern matches values of type int t
        but a pattern was expected which matches values of type s t
-#                         Characters 213-226:
-       | `A, BoolLit _ -> ()
-     ^^^^^^^^^^^^^
+#                         Characters 224-237:
+          | `A, BoolLit _ -> ()
+            ^^^^^^^^^^^^^
 Error: This pattern matches values of type ([? `A ] as 'a) * bool t
        but a pattern was expected which matches values of type 'a * int t
-#                                 Characters 300-301:
+#                                 Characters 299-300:
       | BoolLit b -> b
                      ^
 Error: This expression has type bool but an expression was expected of type s
index 36401d16f1596e4077e863d0be1474c58703d917..5406ed2a72b3243e0117c4abf70563ab4974dfb8 100644 (file)
     val tail : ('a * 'b) t -> 'b t
     val length : 'a t -> int
   end
-#                                                         Characters 206-227:
+#                                                         Characters 196-224:
   ......function
-       | C2 x -> x
+          | C2 x -> x
 Warning 8: this pattern-matching is not exhaustive.
 Here is an example of a value that is not matched:
 C1 _
-Characters 469-526:
+Characters 458-529:
   ......function
-       | Foo _ , Foo _ -> true
-       | Bar _, Bar _ -> true
+          | Foo _ , Foo _ -> true
+          | Bar _, Bar _ -> true
 Warning 8: this pattern-matching is not exhaustive.
 Here is an example of a value that is not matched:
 (Bar _, Foo _)
@@ -47,24 +47,24 @@ module Nonexhaustive :
     type 'a v = Foo : t -> t v | Bar : u -> u v
     val same_type : 's v * 's v -> bool
   end
-#               Characters 119-120:
+#               Characters 118-119:
       let eval (D x) = x
                        ^
 Error: This expression has type ex#16 t
        but an expression was expected of type ex#16 t
        The type constructor ex#16 would escape its scope
-#                       Characters 157-158:
-         C ->
-     ^
+#                       Characters 174-175:
+            C ->
+            ^
 Error: Recursive local constraint when unifying (s, s) t with (s, s * s) t
-#                         Characters 174-182:
-       | (IntLit _ | BoolLit _) -> ()
-      ^^^^^^^^
+#                         Characters 178-186:
+          | (IntLit _ | BoolLit _) -> ()
+             ^^^^^^^^
 Error: This pattern matches values of type int t
        but a pattern was expected which matches values of type s t
-#                         Characters 213-226:
-       | `A, BoolLit _ -> ()
-     ^^^^^^^^^^^^^
+#                         Characters 224-237:
+          | `A, BoolLit _ -> ()
+            ^^^^^^^^^^^^^
 Error: This pattern matches values of type ([? `A ] as 'a) * bool t
        but a pattern was expected which matches values of type 'a * int t
 #                                 module Propagation :
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index 3910059fe24b28d0f16f1920bd287e311e1793c3..82fca3a5d086bd6c196ad7db96192654bfa95f29 100644 (file)
@@ -152,7 +152,7 @@ let ssmap =
 
 let ssmap =
   (let module S = struct include SSMap end in (module S) :
-  (module 
+  (module
    MapT with type key = string and type data = string and type map = SSMap.map))
 ;;
 
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index 7de770ed6a826990ad5ce0d2ed8cbfe4e7f7b2dd..5a59808ef4199747d526a9794edef7f87ccaead6 100644 (file)
@@ -1,7 +1,7 @@
 module type INCLUDING = sig
   include module type of List
   include module type of ListLabels
-end 
+end
 
 module Including_typed: INCLUDING = struct
   include List
index 9add15574f085c06eee00ba0f8fcc28747d1a387..145025ba058720040150de163a1087b60ff65167 100644 (file)
@@ -1,3 +1,2 @@
 include ../../makefiles/Makefile.toplevel
 include ../../makefiles/Makefile.common
-
index 3d393120a2980c6cfe57165e0ff0226d724d46ff..01c5066654dae6c6d4969190e192aa83eb118963 100644 (file)
@@ -1,18 +1,18 @@
-type expr = 
+type expr =
   [ `Abs of string * expr
   | `App of expr * expr
   ]
 
-class type exp = 
+class type exp =
 object
   method eval : (string, exp) Hashtbl.t -> expr
 end;;
 
-class app e1 e2 : exp = 
+class app e1 e2 : exp =
 object
-  val l = e1 
+  val l = e1
   val r = e2
-  method eval env = 
+  method eval env =
       match l with
     | `Abs(var,body) ->
         Hashtbl.add env var r;
index 90ee787861c0730a1e19efd080da2757d336ea29..5195d46397282a9215945f41169ce030db5e60b4 100644 (file)
@@ -8,7 +8,7 @@ class ['event] subject =
    object (self : 'subject)
      val mutable observers = ([]: (('subject, 'event) observer) list)
      method add_observer obs = observers <- (obs :: observers)
-     method notify_observers (e : 'event) = 
+     method notify_observers (e : 'event) =
          List.iter (fun x -> x#notify self e) observers
    end
 
index c5809c1d931af96bbcd5bdf9d99fa89b4563b68e..726cc866699767dbbb59d319bfda9ff2b0627565 100644 (file)
@@ -1,9 +1,9 @@
-class virtual ['a] c = 
-object (s : 'a) 
-  method virtual m : 'b 
+class virtual ['a] c =
+object (s : 'a)
+  method virtual m : 'b
 end
 
-let o = 
+let o =
     object (s :'a)
       inherit ['a] c
       method m = 42
index 212a1683fa4f711cd865ed244e4167679cfb614b..fda0d123ce9ac300436b0d0e6c95c203f87db2eb 100644 (file)
@@ -31,9 +31,9 @@ class virtual ['a, 'cursor] storage_base =
     method fold : 'b. ('a -> int -> 'b -> 'b) -> 'b -> 'b = fun f a0 ->
       let cur = self#first in
       let rec loop count a =
-       if count >= self#len then a else
-       let a' = f cur#get count a in
-       cur#incr (); loop (count + 1) a'
+        if count >= self#len then a else
+        let a' = f cur#get count a in
+        cur#incr (); loop (count + 1) a'
       in
       loop 0 a0
     method iter proc =
@@ -63,7 +63,7 @@ struct
   let highest_bit = 1 lsl 30
   let lower_bits = highest_bit - 1
 
-  let char_of c = 
+  let char_of c =
     try Char.chr c with Invalid_argument _ ->  raise Out_of_range
 
   let of_char = Char.code
@@ -129,7 +129,7 @@ class text_raw buf =
   object (self : 'self)
     inherit [cursor] ustorage_base
     val contents = buf
-    method first = new cursor (self :> text_raw) 0 
+    method first = new cursor (self :> text_raw) 0
     method len = (String.length contents) / 4
     method get i = get_buf contents (4 * i)
     method nth i = new cursor (self :> text_raw) i
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index c7a5cb3d1687d3a09937ad238281ed4e542e1eb7..15bef7f9e57cb80bb079080625c97dbc2b03df68 100644 (file)
@@ -159,7 +159,7 @@ e#f, e#g, e#h, e#i, e#j;;
 
 class c a = object val x = 1 val y = 1 val z = 1 val a = a end;;
 class d b = object val z = 2 val t = 2 val u = 2 val b = b end;;
-class e () = object 
+class e () = object
   val x = 3
   inherit c 5
   val y = 3
index 34a5071d783d5780796a634a6111054f3273716a..a194f7d0f857867ba5333d78cff8bc9be2ccfbbc 100644 (file)
@@ -162,24 +162,24 @@ Error: This expression has type bool but an expression was expected of type
 # - : int * int * int * int * int = (1, 3, 2, 2, 3)
 #   class c : 'a -> object val a : 'a val x : int val y : int val z : int end
 # class d : 'a -> object val b : 'a val t : int val u : int val z : int end
-#                             Characters 43-46:
+#                             Characters 42-45:
     inherit c 5
             ^^^
 Warning 13: the following instance variables are overridden by the class c :
   x
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 53-54:
+Characters 52-53:
     val y = 3
         ^
 Warning 13: the instance variable y is overridden.
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 81-84:
+Characters 80-83:
     inherit d 7
             ^^^
 Warning 13: the following instance variables are overridden by the class d :
   t z
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 91-92:
+Characters 90-91:
     val u = 3
         ^
 Warning 13: the instance variable u is overridden.
index 45130d58c3b054388cf135e500045fd3e6ecbe15..d5d0bea4374088c6c025672a32ada99c446388c7 100644 (file)
@@ -162,24 +162,24 @@ Error: This expression has type bool but an expression was expected of type
 # - : int * int * int * int * int = (1, 3, 2, 2, 3)
 #   class c : 'a -> object val a : 'a val x : int val y : int val z : int end
 # class d : 'a -> object val b : 'a val t : int val u : int val z : int end
-#                             Characters 43-46:
+#                             Characters 42-45:
     inherit c 5
             ^^^
 Warning 13: the following instance variables are overridden by the class c :
   x
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 53-54:
+Characters 52-53:
     val y = 3
         ^
 Warning 13: the instance variable y is overridden.
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 81-84:
+Characters 80-83:
     inherit d 7
             ^^^
 Warning 13: the following instance variables are overridden by the class d :
   t z
 The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)
-Characters 91-92:
+Characters 90-91:
     val u = 3
         ^
 Warning 13: the instance variable u is overridden.
index fbecc927c0d374d8d094ee69377caea61dfce210..2dd3eaaa5928fbaa36d818c4c51138b71ac1ee5f 100644 (file)
@@ -3,7 +3,7 @@ class type foo_t =
     method foo: string
   end
 
-type 'a name = 
+type 'a name =
     Foo: foo_t name
   | Int: int name
 ;;
index a24a6769a7bb62c5a03d5f3a11e68c2466eae6ce..d6cbca1a7addfd15e9c195724b7931c8a759ce4b 100644 (file)
@@ -4,4 +4,3 @@ module M : sig val x : <m : 'a. 'a> end =
 
 let ident v = v
 class alias = object method alias : 'a . 'a t -> 'a = ident end
-
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index 7efe4eb29960bc6fb03bcc3dca33f6b21375997f..85196f16b29d3259556258e4d8a57d5d301090aa 100644 (file)
@@ -1,4 +1,4 @@
-(* $Id: poly.ml 12534 2012-06-01 05:24:38Z garrigue $ *)
+(* $Id: poly.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 (*
    Polymorphic methods are now available in the main branch.
    Enjoy.
@@ -448,7 +448,7 @@ function `B,1 -> 1 | _,1 -> 2;;
 function 1,`B -> 1 | 1,_ -> 2;;
 
 (* pass typetexp, but fails during Typedecl.check_recursion *)
-type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b] 
+type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
 and  ('a, 'b) b = 'b -> unit constraint 'b = [> `A of ('a, 'b) a as 'a];;
 
 (* PR#1917: expanding may change original in Ctype.unify2 *)
@@ -459,12 +459,12 @@ class type ['a, 'b] a = object
   method as_a: ('a, 'b) a
 end and ['a, 'b] b = object
   method a: ('a, 'b) #a as 'a
-  method as_b: ('a, 'b) b 
+  method as_b: ('a, 'b) b
 end
 
 class type ['b] ca = object ('s) inherit ['s, 'b] a end
 class type ['a] cb = object ('s) inherit ['a, 's] b end
-         
+
 type bt = 'b ca cb as 'b
 ;;
 
index f7dc11e26442291c4a2baca650b330738545fd99..d069595e79e1d5380448ad1cc007df6e5ba6b017 100644 (file)
@@ -347,7 +347,7 @@ Characters 21-24:
 Warning 11: this match case is unused.
 - : int * [< `B ] -> int = <fun>
 #       Characters 69-135:
-  type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b] 
+  type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Error: Constraints are not satisfied in this type.
        Type
index 0f0448e674031f3a0763be326bc77044ff4a2843..81fb34739960734fc25b626cf672f02ede2ee468 100644 (file)
@@ -330,7 +330,7 @@ Characters 21-24:
 Warning 11: this match case is unused.
 - : int * [< `B ] -> int = <fun>
 #       Characters 69-135:
-  type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b] 
+  type ('a, 'b) a = 'a -> unit constraint 'a = [> `B of ('a, 'b) b as 'b]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Error: Constraints are not satisfied in this type.
        Type
index 38df7705850c55da789b6cadab4bfdadbf1231fc..86cb665ad4c9049375d4e45761731142a053ad27 100644 (file)
@@ -5,7 +5,7 @@ module TT = struct
 end
 
 let () =
-  let f flag = 
+  let f flag =
     let module T = TT in
     let _ = match flag with `A -> 0 | `B r -> r in
     let _ = match flag with `A -> T.IntSet.mem | `B r -> r in
index 35cc3386354d96f3e3cd0b3927c90904afd5641a..15bb776b7f442c854337de9ba8e6042cb478a9a3 100644 (file)
@@ -1,6 +1,6 @@
 (* This one should fail *)
 
-let f flag = 
+let f flag =
   let module T = Set.Make(struct type t = int let compare = compare end) in
   let _ = match flag with `A -> 0 | `B r -> r in
   let _ = match flag with `A -> T.mem | `B r -> r in
index 0e6d215d26297a79b34f8b6f5e7a87fdbfd4b0d7..10699952b23cf173c0e356592bae1900a4293ff2 100644 (file)
@@ -3,7 +3,7 @@ type -'a typed = private untyped;;
 type -'typing wrapped = private sexp
 and +'a t = 'a typed wrapped
 and sexp = private untyped wrapped;;
-class type ['a] s3 = object 
+class type ['a] s3 = object
   val underlying : 'a t
 end;;
 class ['a] s3object r : ['a] s3 = object
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index 636f231ba47c6512d46a459e83e5a95fb184c9dc..6f19b89d1c8493d8919d35d96d5aeb2721bc45af 100644 (file)
@@ -57,18 +57,18 @@ module M3 : sig
   val mk : int -> t
 end = M;;
 
-module M4 : sig   
+module M4 : sig
     type t = M.t = T of int
     val mk : int -> t
   end = M;;
 (* Error: The variant or record definition does not match that of type M.t *)
 
-module M5 : sig   
+module M5 : sig
   type t = M.t = private T of int
   val mk : int -> t
 end = M;;
 
-module M6 : sig   
+module M6 : sig
   type t = private T of int
   val mk : int -> t
 end = M;;
index 27cf983976915a89d0f5f63d72edaccbe2675839..8a7b3db469900f6c8d1457af699bab3aafde1369 100644 (file)
@@ -84,7 +84,7 @@ Error: Signature mismatch:
 #               module M1 : sig type t = M.t val mk : int -> t end
 #             module M2 : sig type t = M.t val mk : int -> t end
 #         module M3 : sig type t = M.t val mk : int -> t end
-#         Characters 29-47:
+#         Characters 26-44:
       type t = M.t = T of int
            ^^^^^^^^^^^^^^^^^^
 Error: This variant or record definition does not match that of type M.t
index ac9d6390c28e5cbc2171f4073a0e275f5032226c..b4301a417e4056e46ba637579835c5623a79a786 100644 (file)
@@ -1,4 +1,3 @@
 (* Bad (t = t) *)
 module rec A : sig type t = B.t end = struct type t = B.t end
        and B : sig type t = A.t end = struct type t = A.t end;;
-
index 7df3d4760973148b6b07afa027d32b7955a8ce3f..5ebafd11abf394f8efb59c19f13cf3440a879f77 100644 (file)
@@ -2,4 +2,3 @@
 module rec A : sig type 'a t = <m: 'a list B.t; n: 'a array B.t> end
              = struct type 'a t = <m: 'a list B.t; n: 'a array B.t> end
        and B : sig type 'a t = 'a A.t end = struct type 'a t = 'a A.t end;;
-
index 729afd516a83a202f5919d5d455afadf33a8b3be..4fea6e1fafea3c25b9da811faee9d588124251b9 100644 (file)
@@ -1,5 +1,5 @@
 (* OK *)
 class type [ 'node ] extension = object method node : 'node end
-class type [ 'ext ] node = object constraint 'ext = 'ext node #extension end 
+class type [ 'ext ] node = object constraint 'ext = 'ext node #extension end
 class x = object method node : x node = assert false end
 type t = x node;;
index 5c665368e8e6459045bf83a6177829d298b659e5..1b92a28c5c1b2229f57775110a845098db6b9a3e 100644 (file)
@@ -13,5 +13,5 @@ module PR_4261 = struct
   end
 
   module rec U : T with module D = U' = U
-  and U' : S with type t = U'.t = U 
+  and U' : S with type t = U'.t = U
 end;;
index f42de7b7a65b54909978f0e18ad29429bd8afe96..583b69bb52852bc98f6f29e670a5d05236b18462 100644 (file)
@@ -28,4 +28,3 @@ module PR_4450_2 = struct
     let create l = new c l
   end
 end;;
-
index a2ea895adbfe7169fe193d5d0a3e8c8fb340e4ec..4521b66cfa9cc806c621779610af68a39e674b0d 100644 (file)
@@ -25,18 +25,17 @@ struct
     type t = I of int * int | D of int * Diet.t * int
     val compare : t -> t -> int
     val iter : (int -> unit) -> t -> unit
-  end = 
+  end =
   struct
     type t = I of int * int | D of int * Diet.t * int
     let compare x1 x2 = 0
     let rec iter f = function
       | I (l, r) -> for i = l to r do f i done
       | D (_, d, _) -> Diet.iter (iter f) d
-  end 
+  end
 
   and Diet : SET with type t = Elt.t tree and type elt = Elt.t = MakeDiet(Elt)
 
   type t = Diet.t
   let iter f = Diet.iter (Elt.iter f)
 end
-
index 4f5814deb24e83d17ed68879343fb1b4a365a01c..64fcf6aba823437ad3f0439c0cb46e948473e81e 100644 (file)
@@ -22,5 +22,4 @@ and DirHash
     end
   = struct
       type t = DirCompare.t list
-    end      
-
+    end
index cd2dde8ec216e076dd281682f7765ff830b7c9d3..62e5f454861a634d0a3226970f17d4200ae9d3fb 100644 (file)
@@ -10,4 +10,3 @@ module PR_4758 = struct
     module Other = A
   end
 end
-
index 0aa63afdd605302d5afbacb8892cf61d71d7b2d1..de96eced5589da75d35881fcaae20677d1389854 100644 (file)
@@ -112,7 +112,7 @@ module rec Strengthen
 ;;
 
 module rec Strengthen2
-  : sig type t 
+  : sig type t
         val f : t -> t
         module M : sig type u end
         module R : sig type v end
@@ -150,7 +150,7 @@ module rec PolyRec
       | Node(l,r) -> 1 + max (PolyRec.depth l) (PolyRec.depth r)
     end
 ;;
-  
+
 (* Wrong LHS signatures (PR#4336) *)
 
 (*
@@ -212,7 +212,7 @@ and Binding
   : sig
       type t = (string * Expr.t) list
       val fv: t -> StringSet.t
-      val bv: t -> StringSet.t    
+      val bv: t -> StringSet.t
       val simpl: t -> t
     end
   = struct
@@ -258,7 +258,7 @@ module type HEAP =
     val deleteMin: heap -> heap
   end
 
-module Bootstrap (MakeH: functor (Element:ORDERED) -> 
+module Bootstrap (MakeH: functor (Element:ORDERED) ->
                                     HEAP with module Elem = Element)
                  (Element: ORDERED) : HEAP with module Elem = Element =
   struct
@@ -268,7 +268,7 @@ module Bootstrap (MakeH: functor (Element:ORDERED) ->
           val eq: t -> t -> bool
           val lt: t -> t -> bool
           val leq: t -> t -> bool
-      end                  
+      end
     = struct
         type t = E | H of Elem.t * PrimH.heap
         let leq t1 t2 =
@@ -432,7 +432,7 @@ module rec Coerce1
       module A = (Coerce1: sig val f: int -> int end)
       let g x = x
       let f x = if x <= 0 then 1 else A.f (x-1) * x
-    end 
+    end
 ;;
 
 let _ =
@@ -461,7 +461,7 @@ module Coerce4(A : sig val f : int -> int end) = struct
 end
 
 module rec Coerce5
-  : sig val blabla: int -> int val f: int -> int end 
+  : sig val blabla: int -> int val f: int -> int end
   = struct let blabla x = 0 let f x = 5 end
 and Coerce6
   : sig val at: int -> int end
@@ -473,16 +473,16 @@ let _ =
 
 (* Miscellaneous bug reports *)
 
-module rec F 
+module rec F
   : sig type t = X of int | Y of int
         val f: t -> bool
     end
   = struct
-      type t = X of int | Y of int  
+      type t = X of int | Y of int
       let f = function
         | X _ -> false
         | _ -> true
-    end;; 
+    end;;
 
 let _ =
   test 100 (F.f (F.X 1)) false;
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index f3c9c7936ad61431ee795f81bd4d9c7f7ceb9c53..3713b64e5c18330d20e57cf08b7554ea0c0644d7 100644 (file)
@@ -45,12 +45,12 @@ module type INTERP = sig
   include EVALUATOR
   module Parser : PARSER with type chunk = Ast.chunk
   val dostring : state -> string -> value list
-  val mk       : unit -> state
+  val mk : unit -> state
 end;;
 
 module type USERTYPE = sig
   type t
-  val eq       : t -> t -> bool
+  val eq : t -> t -> bool
   val to_string : t -> string
 end;;
 
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index 5f42b70577daa3d318645ab760281a30482bdb48..9625a3fbc38a582e10a311e67ac2b4bd7114c232 100644 (file)
@@ -1,4 +1,3 @@
 BASEDIR=../..
 include $(BASEDIR)/makefiles/Makefile.toplevel
 include $(BASEDIR)/makefiles/Makefile.common
-
index e26bee573b820a8eb50a84d4a538dec0a3106bb2..3c37c132b6f2bb5f078ee25cfb852f054845763f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: depend.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: depend.ml 12883 2012-08-25 11:35:20Z garrigue $ *)
 
 open Asttypes
 open Format
@@ -108,6 +108,8 @@ let add_class_description bv infos =
 
 let add_class_type_declaration = add_class_description
 
+let pattern_bv = ref StringSet.empty
+
 let rec add_pattern bv pat =
   match pat.ppat_desc with
     Ppat_any -> ()
@@ -124,13 +126,19 @@ let rec add_pattern bv pat =
   | Ppat_variant(_, op) -> add_opt add_pattern bv op
   | Ppat_type li -> add bv li
   | Ppat_lazy p -> add_pattern bv p
-  | Ppat_unpack _ -> ()
+  | Ppat_unpack id -> pattern_bv := StringSet.add id.txt !pattern_bv
+
+let add_pattern bv pat =
+  pattern_bv := bv;
+  add_pattern bv pat;
+  !pattern_bv
 
 let rec add_expr bv exp =
   match exp.pexp_desc with
     Pexp_ident l -> add bv l
   | Pexp_constant _ -> ()
-  | Pexp_let(_, pel, e) -> add_pat_expr_list bv pel; add_expr bv e
+  | Pexp_let(rf, pel, e) ->
+      let bv = add_bindings rf bv pel in add_expr bv e
   | Pexp_function (_, opte, pel) ->
       add_opt add_expr bv opte; add_pat_expr_list bv pel
   | Pexp_apply(e, el) ->
@@ -168,12 +176,19 @@ let rec add_expr bv exp =
   | Pexp_lazy (e) -> add_expr bv e
   | Pexp_poly (e, t) -> add_expr bv e; add_opt add_type bv t
   | Pexp_object { pcstr_pat = pat; pcstr_fields = fieldl } ->
-      add_pattern bv pat; List.iter (add_class_field bv) fieldl
+      let bv = add_pattern bv pat in List.iter (add_class_field bv) fieldl
   | Pexp_newtype (_, e) -> add_expr bv e
   | Pexp_pack m -> add_module bv m
   | Pexp_open (m, e) -> addmodule bv m; add_expr bv e
+
 and add_pat_expr_list bv pel =
-  List.iter (fun (p, e) -> add_pattern bv p; add_expr bv e) pel
+  List.iter (fun (p, e) -> let bv = add_pattern bv p in add_expr bv e) pel
+
+and add_bindings recf bv pel =
+  let bv' = List.fold_left (fun bv (p, _) -> add_pattern bv p) bv pel in
+  let bv = if recf = Recursive then bv' else bv in
+  List.iter (fun (_, e) -> add_expr bv e) pel;
+  bv'
 
 and add_modtype bv mty =
   match mty.pmty_desc with
@@ -245,8 +260,8 @@ and add_struct_item bv item =
   match item.pstr_desc with
     Pstr_eval e ->
       add_expr bv e; bv
-  | Pstr_value(id, pel) ->
-      add_pat_expr_list bv pel; bv
+  | Pstr_value(rf, pel) ->
+      let bv = add_bindings rf bv pel in bv
   | Pstr_primitive(id, vd) ->
       add_type bv vd.pval_type; bv
   | Pstr_type dcls ->
@@ -288,13 +303,14 @@ and add_class_expr bv ce =
     Pcl_constr(l, tyl) ->
       add bv l; List.iter (add_type bv) tyl
   | Pcl_structure { pcstr_pat = pat; pcstr_fields = fieldl } ->
-      add_pattern bv pat; List.iter (add_class_field bv) fieldl
+      let bv = add_pattern bv pat in List.iter (add_class_field bv) fieldl
   | Pcl_fun(_, opte, pat, ce) ->
-      add_opt add_expr bv opte; add_pattern bv pat; add_class_expr bv ce
+      add_opt add_expr bv opte;
+      let bv = add_pattern bv pat in add_class_expr bv ce
   | Pcl_apply(ce, exprl) ->
       add_class_expr bv ce; List.iter (fun (_,e) -> add_expr bv e) exprl
-  | Pcl_let(_, pel, ce) ->
-      add_pat_expr_list bv pel; add_class_expr bv ce
+  | Pcl_let(rf, pel, ce) ->
+      let bv = add_bindings rf bv pel in add_class_expr bv ce
   | Pcl_constraint(ce, ct) ->
       add_class_expr bv ce; add_class_type bv ct
 
index d3e4515502dac1fde2659f369e8b7c9655e4775b..b3152af8f98bdfbbeb4c2da3493612323e822a34 100755 (executable)
@@ -12,7 +12,7 @@
 #                                                                       #
 #########################################################################
 
-# $Id: make-package-macosx 12773 2012-07-25 12:32:19Z doligez $
+# $Id: make-package-macosx 12783 2012-07-26 12:37:40Z doligez $
 
 cd package-macosx
 rm -rf ocaml.pkg ocaml-rw.dmg
@@ -87,7 +87,7 @@ mkdir -p resources
 cat >resources/ReadMe.txt <<EOF
 This package installs OCaml version ${VERSION}.
 You need Mac OS X 10.7.x (Lion), with the
-XCode tools installed (v3.2.6 or later).
+XCode tools installed (v4.3.3 or later).
 
 Files will be installed in the following directories:
 
index 11968744cf1810f37514d46e4221d0fa9a95898d..161f8654f0016d442fafc792864091450d7db3a7 100644 (file)
@@ -111,9 +111,9 @@ let fixity_of_exp e =
       (fixity_of_longident li)
 (*
   | Pexp_cspval (_,li) ->
-         if false (* default valu of !Clflags.prettycsp *)
-         then (fixity_of_longident li)
-         else Prefix
+          if false (* default valu of !Clflags.prettycsp *)
+          then (fixity_of_longident li)
+          else Prefix
 *)
       | _ -> Prefix ;;
 
@@ -328,7 +328,7 @@ let rec core_type ppf x =
             );
         | s ->
             fprintf ppf "%s :@ " s ;
-           core_type ppf ct1; (* todo: what do we do here? *)
+            core_type ppf ct1; (* todo: what do we do here? *)
       );
       fprintf ppf "@ ->@ " ;
       core_type ppf ct2 ;
@@ -563,9 +563,9 @@ and simple_expr ppf x =
       fprintf ppf "%a@ " fmt_longident li
   | Pexp_ident (li) -> (* was (li, b) *)
       if is_infix (fixity_of_longident li)
-       || match li.txt with
-         | Longident.Lident (li) -> List.mem li.[0] prefix_symbols
-         | _ -> false
+        || match li.txt with
+          | Longident.Lident (li) -> List.mem li.[0] prefix_symbols
+          | _ -> false
       then
         fprintf ppf "(%a)" fmt_longident li
       else
@@ -981,10 +981,10 @@ and type_declaration ppf x =
   (match x.ptype_manifest with
      | None -> ()
      | Some(y) ->
-        core_type ppf y;
-        match x.ptype_kind with
-          | Ptype_variant _ | Ptype_record _ -> fprintf ppf " = "
-          | Ptype_abstract -> ());
+         core_type ppf y;
+         match x.ptype_kind with
+           | Ptype_variant _ | Ptype_record _ -> fprintf ppf " = "
+           | Ptype_abstract -> ());
   (match x.ptype_kind with
     | Ptype_variant (first::rest) ->
         pp_open_hovbox ppf indent ;
@@ -1397,11 +1397,11 @@ and signature_item ppf x =
     | Psig_value (s, vd) ->
       let intro = if vd.pval_prim = [] then "val" else "external" in
         pp_open_hovbox ppf indent ;
-       if (is_infix (fixity_of_string s.txt))
-         || List.mem s.txt.[0] prefix_symbols then
+        if (is_infix (fixity_of_string s.txt))
+          || List.mem s.txt.[0] prefix_symbols then
           fprintf ppf "%s ( %s ) :@ "
             intro s.txt                (* OXX done *)
-       else
+        else
         fprintf ppf "%s %s :@ " intro s.txt;
         value_description ppf vd;
         pp_close_box ppf () ;
@@ -2155,5 +2155,3 @@ let toplevel_phrase ppf x =
 
 let print_structure = structure
 let print_signature = signature
-
-
index dc795778ce482e1f3f0bf8ad42944dd254480716..7485ea64880a54f598d0e9f150e87f047bae9505 100644 (file)
@@ -78,4 +78,3 @@ let _ =
       Arg.usage arg_list arg_usage
     end
   ) arg_usage
-
index a4f45ec98d958140192c88bf85c3e093f28350ab..b2191b4d5fd0be1a1cc037f5dee4b4a2deddb004 100644 (file)
@@ -302,11 +302,11 @@ module MakeIterator(Iter : IteratorArgument) : sig
             iter_expression exp2
         | Texp_send (exp, meth, expo) ->
             iter_expression exp;
-         begin
-           match expo with
-               None -> ()
-             | Some exp -> iter_expression exp
-         end
+          begin
+            match expo with
+                None -> ()
+              | Some exp -> iter_expression exp
+          end
         | Texp_new (path, _, _) -> ()
         | Texp_instvar (_, path, _) -> ()
         | Texp_setinstvar (_, _, _, exp) ->
@@ -446,7 +446,7 @@ module MakeIterator(Iter : IteratorArgument) : sig
         | Tcl_structure clstr -> iter_class_structure clstr
         | Tcl_fun (label, pat, priv, cl, partial) ->
           iter_pattern pat;
-         List.iter (fun (id, _, exp) -> iter_expression exp) priv;
+          List.iter (fun (id, _, exp) -> iter_expression exp) priv;
           iter_class_expr cl
 
         | Tcl_apply (cl, args) ->
@@ -459,7 +459,7 @@ module MakeIterator(Iter : IteratorArgument) : sig
 
         | Tcl_let (rec_flat, bindings, ivars, cl) ->
           iter_bindings rec_flat bindings;
-         List.iter (fun (id, _, exp) -> iter_expression exp) ivars;
+          List.iter (fun (id, _, exp) -> iter_expression exp) ivars;
             iter_class_expr cl
 
         | Tcl_constraint (cl, Some clty, vals, meths, concrs) ->
@@ -573,7 +573,7 @@ module MakeIterator(Iter : IteratorArgument) : sig
           iter_expression exp
 (*      | Tcf_let (rec_flag, bindings, exps) ->
           iter_bindings rec_flag bindings;
-       List.iter (fun (id, _, exp) -> iter_expression exp) exps; *)
+        List.iter (fun (id, _, exp) -> iter_expression exp) exps; *)
       | Tcf_init exp ->
           iter_expression exp
       end;
@@ -643,5 +643,3 @@ module DefaultIteratorArgument = struct
     let leave_bindings _ = ()
 
   end
-
-
index 1aedead2aadb0065d3d6801325ee091c8117aa95..be9c6effb179723d0919cec90f65de53b25eea5c 100644 (file)
@@ -92,4 +92,3 @@ module MakeIterator :
            end
 
 module DefaultIteratorArgument : IteratorArgument
-
index eb9ffbaf110a190dfcb9cfc375139e7bf5d0b9bb..50595a66e6a532463cfd8e39ccf205dd2dd4afb8 100644 (file)
@@ -36,7 +36,7 @@ let rec lident_of_path path =
       Path.Pident id -> Longident.Lident (Ident.name id)
     | Path.Pdot (p, s, _) -> Longident.Ldot (lident_of_path p, s)
     | Path.Papply (p1, p2) ->
-       Longident.Lapply (lident_of_path p1, lident_of_path p2)
+        Longident.Lapply (lident_of_path p1, lident_of_path p2)
 
 let rec untype_structure str =
   List.map untype_structure_item str.str_items
@@ -189,7 +189,7 @@ and untype_extra (extra, loc) sexp =
   in
   { pexp_desc = desc;
     pexp_loc = loc }
-      
+
 and untype_expression exp =
   let desc =
     match exp.exp_desc with
@@ -225,9 +225,10 @@ and untype_expression exp =
         Pexp_construct (lid,
           (match args with
               [] -> None
-            | args -> Some
-                  { pexp_desc = Pexp_tuple (List.map untype_expression args);
-                  pexp_loc = exp.exp_loc; }
+          | [ arg ] -> Some (untype_expression arg)
+          | args -> Some
+            { pexp_desc = Pexp_tuple (List.map untype_expression args);
+              pexp_loc = exp.exp_loc; }
           ), explicit_arity)
     | Texp_variant (label, expo) ->
         Pexp_variant (label, match expo with
index 3fd0897be5fbcd21dce59ea3ec0f619ec54b5662..c918960ff3ca9965c8810561f90c1a6ddff2e97a 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: expunge.ml 12061 2012-01-20 15:43:29Z frisch $ *)
+(* $Id: expunge.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* "Expunge" a toplevel by removing compiler modules from the global List.map.
    Usage: expunge <source file> <dest file> <names of modules to keep> *)
@@ -33,7 +33,7 @@ let to_keep = ref StringSet.empty
 
 let negate = Sys.argv.(3) = "-v"
 
-let keep = 
+let keep =
   if negate then fun name -> is_exn name || not (StringSet.mem name !to_keep)
   else fun name -> is_exn name || (StringSet.mem name !to_keep)
 
index 1e89e0aad401243ec438be69cda2f35325d91b9c..62fb0d37ec2c30abc88633dc541df3e186c4d5fd 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: genprintval.ml 12689 2012-07-10 14:54:19Z doligez $ *)
+(* $Id: genprintval.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* To print values *)
 
@@ -249,15 +249,15 @@ module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) = struct
                       else Cstr_constant(O.obj obj) in
                     let (constr_name, constr_args,ret_type) =
                       Datarepr.find_constr_by_tag tag constr_list in
-                   let type_params =
-                     match ret_type with
-                       Some t ->
-                         begin match (Ctype.repr t).desc with
-                           Tconstr (_,params,_) ->
-                             params
-                         | _ -> assert false end
-                     | None -> decl.type_params
-                   in
+                    let type_params =
+                      match ret_type with
+                        Some t ->
+                          begin match (Ctype.repr t).desc with
+                            Tconstr (_,params,_) ->
+                              params
+                          | _ -> assert false end
+                      | None -> decl.type_params
+                    in
                     let ty_args =
                       List.map
                         (function ty ->
index a036222b32b0e5e15eea158f3d01e1f75d0ed6c5..b0abbd8994c638f914574e2ef647e7c0a666f34e 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: btype.ml 12726 2012-07-18 03:34:36Z garrigue $ *)
+(* $Id: btype.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Basic operations on core types *)
 
@@ -340,11 +340,11 @@ let unmark_type_decl decl =
   begin match decl.type_kind with
     Type_abstract -> ()
   | Type_variant cstrs ->
-      List.iter 
-       (fun (c, tl, ret_type_opt) -> 
-         List.iter unmark_type tl;
-         Misc.may unmark_type ret_type_opt)
-       cstrs
+      List.iter
+        (fun (c, tl, ret_type_opt) ->
+          List.iter unmark_type tl;
+          Misc.may unmark_type ret_type_opt)
+        cstrs
   | Type_record(lbls, rep) ->
       List.iter (fun (c, mut, t) -> unmark_type t) lbls
   end;
index 41bc08ea1a9fd681b818105aa4148ee67270cb4e..dee54102f0a4e0e38058bbed9ff39c110f3f1ecc 100644 (file)
@@ -238,7 +238,7 @@ end = struct
     let may_map f v =
       match v with
           None -> v
-       | Some x -> Some (f x)
+        | Some x -> Some (f x)
 
 
     open Misc
@@ -274,32 +274,32 @@ end = struct
           | Tstr_module (id, name, mexpr) ->
             Tstr_module (id, name, map_module_expr mexpr)
           | Tstr_recmodule list ->
-           let list =
+            let list =
               List.map (fun (id, name, mtype, mexpr) ->
                 (id, name, map_module_type mtype, map_module_expr mexpr)
-             ) list
-           in
-           Tstr_recmodule list
+              ) list
+            in
+            Tstr_recmodule list
           | Tstr_modtype (id, name, mtype) ->
             Tstr_modtype (id, name, map_module_type mtype)
           | Tstr_open (path, lid) -> Tstr_open (path, lid)
           | Tstr_class list ->
-           let list =
+            let list =
               List.map (fun (ci, string_list, virtual_flag) ->
-               let ci = Map.enter_class_infos ci in
-               let ci_expr = map_class_expr ci.ci_expr in
-               (Map.leave_class_infos { ci with ci_expr = ci_expr},
+                let ci = Map.enter_class_infos ci in
+                let ci_expr = map_class_expr ci.ci_expr in
+                (Map.leave_class_infos { ci with ci_expr = ci_expr},
                  string_list, virtual_flag)
               ) list
-           in
-           Tstr_class list
+            in
+            Tstr_class list
           | Tstr_class_type list ->
             let list = List.map (fun (id, name, ct) ->
               let ct = Map.enter_class_infos ct in
               let ci_expr = map_class_type ct.ci_expr in
-             (id, name, Map.leave_class_infos { ct with ci_expr = ci_expr})
+              (id, name, Map.leave_class_infos { ct with ci_expr = ci_expr})
             ) list in
-           Tstr_class_type list
+            Tstr_class_type list
           | Tstr_include (mexpr, idents) ->
             Tstr_include (map_module_expr mexpr, idents)
       in
@@ -315,7 +315,7 @@ end = struct
       let typ_cstrs = List.map (fun (ct1, ct2, loc) ->
         (map_core_type ct1,
          map_core_type ct2,
-        loc)
+         loc)
       ) decl.typ_cstrs in
       let typ_kind = match decl.typ_kind with
           Ttype_abstract -> Ttype_abstract
@@ -323,16 +323,16 @@ end = struct
           let list = List.map (fun (s, name, cts, loc) ->
             (s, name, List.map map_core_type cts, loc)
           ) list in
-         Ttype_variant list
+          Ttype_variant list
         | Ttype_record list ->
-         let list =
+          let list =
             List.map (fun (s, name, mut, ct, loc) ->
               (s, name, mut, map_core_type ct, loc)
             ) list in
-         Ttype_record list
+          Ttype_record list
       in
       let typ_manifest =
-       match decl.typ_manifest with
+        match decl.typ_manifest with
             None -> None
           | Some ct -> Some (map_core_type ct)
       in
@@ -353,8 +353,8 @@ end = struct
         match pat.pat_desc with
           | Tpat_alias (pat1, p, text) ->
             let pat1 = map_pattern pat1 in
-           Tpat_alias (pat1, p, text)
-         | Tpat_tuple list -> Tpat_tuple (List.map map_pattern list)
+            Tpat_alias (pat1, p, text)
+          | Tpat_tuple list -> Tpat_tuple (List.map map_pattern list)
           | Tpat_construct (path, lid, cstr_decl, args, arity) ->
             Tpat_construct (path, lid, cstr_decl,
                             List.map map_pattern args, arity)
@@ -363,7 +363,7 @@ end = struct
                 None -> pato
               | Some pat -> Some (map_pattern pat)
             in
-           Tpat_variant (label, pato, rowo)
+            Tpat_variant (label, pato, rowo)
           | Tpat_record (list, closed) ->
             Tpat_record (List.map (fun (path, lid, lab_desc, pat) ->
               (path, lid, lab_desc, map_pattern pat) ) list, closed)
@@ -391,32 +391,32 @@ end = struct
             Texp_ident (_, _, _)
           | Texp_constant _ -> exp.exp_desc
           | Texp_let (rec_flag, list, exp) ->
-           Texp_let (rec_flag,
-                     map_bindings rec_flag list,
-                     map_expression exp)
+            Texp_let (rec_flag,
+                      map_bindings rec_flag list,
+                      map_expression exp)
           | Texp_function (label, cases, partial) ->
             Texp_function (label, map_bindings Nonrecursive cases, partial)
           | Texp_apply (exp, list) ->
             Texp_apply (map_expression exp,
-                       List.map (fun (label, expo, optional) ->
-                         let expo =
-                           match expo with
-                               None -> expo
-                             | Some exp -> Some (map_expression exp)
-                         in
-                         (label, expo, optional)
-                       ) list )
+                        List.map (fun (label, expo, optional) ->
+                          let expo =
+                            match expo with
+                                None -> expo
+                              | Some exp -> Some (map_expression exp)
+                          in
+                          (label, expo, optional)
+                        ) list )
           | Texp_match (exp, list, partial) ->
             Texp_match (
-             map_expression exp,
+              map_expression exp,
               map_bindings Nonrecursive list,
-             partial
-           )
+              partial
+            )
           | Texp_try (exp, list) ->
             Texp_try (
-             map_expression exp,
+              map_expression exp,
               map_bindings Nonrecursive list
-           )
+            )
           | Texp_tuple list ->
             Texp_tuple (List.map map_expression list)
           | Texp_construct (path, lid, cstr_desc, args, arity) ->
@@ -426,85 +426,85 @@ end = struct
             let expo =match expo with
                 None -> expo
               | Some exp -> Some (map_expression exp)
-           in
-           Texp_variant (label, expo)
+            in
+            Texp_variant (label, expo)
           | Texp_record (list, expo) ->
-           let list =
+            let list =
               List.map (fun (path, lid, lab_desc, exp) ->
                 (path, lid, lab_desc, map_expression exp)
               ) list in
             let expo = match expo with
                 None -> expo
               | Some exp -> Some (map_expression exp)
-           in
-           Texp_record (list, expo)
+            in
+            Texp_record (list, expo)
           | Texp_field (exp, path, lid, label) ->
             Texp_field (map_expression exp, path, lid, label)
           | Texp_setfield (exp1, path, lid, label, exp2) ->
             Texp_setfield (
-             map_expression exp1,
-             path, lid,
-             label,
+              map_expression exp1,
+              path, lid,
+              label,
               map_expression exp2)
           | Texp_array list ->
             Texp_array (List.map map_expression list)
           | Texp_ifthenelse (exp1, exp2, expo) ->
             Texp_ifthenelse (
-             map_expression exp1,
+              map_expression exp1,
               map_expression exp2,
               match expo with
                   None -> expo
-               | Some exp -> Some (map_expression exp)
-           )
+                | Some exp -> Some (map_expression exp)
+            )
           | Texp_sequence (exp1, exp2) ->
-           Texp_sequence (
+            Texp_sequence (
               map_expression exp1,
               map_expression exp2
-           )
+            )
           | Texp_while (exp1, exp2) ->
-           Texp_while (
+            Texp_while (
               map_expression exp1,
               map_expression exp2
-           )
+            )
           | Texp_for (id, name, exp1, exp2, dir, exp3) ->
-           Texp_for (
-             id, name,
-             map_expression exp1,
-             map_expression exp2,
-             dir,
-             map_expression exp3
-           )
-         | Texp_when (exp1, exp2) ->
-           Texp_when (
-             map_expression exp1,
-             map_expression exp2
-           )
-         | Texp_send (exp, meth, expo) ->
-           Texp_send (map_expression exp, meth, may_map map_expression expo)
-         | Texp_new (path, lid, cl_decl) -> exp.exp_desc
-         | Texp_instvar (_, path, _) -> exp.exp_desc
-         | Texp_setinstvar (path, lid, path2, exp) ->
-           Texp_setinstvar (path, lid, path2, map_expression exp)
-         | Texp_override (path, list) ->
-           Texp_override (
-             path,
-             List.map (fun (path, lid, exp) ->
-               (path, lid, map_expression exp)
-             ) list
-           )
-         | Texp_letmodule (id, name, mexpr, exp) ->
-           Texp_letmodule (
-             id, name,
-             map_module_expr mexpr,
-             map_expression exp
-           )
-         | Texp_assert exp -> Texp_assert (map_expression exp)
-         | Texp_assertfalse -> exp.exp_desc
-         | Texp_lazy exp -> Texp_lazy (map_expression exp)
-         | Texp_object (cl, string_list) ->
-           Texp_object (map_class_structure cl, string_list)
-         | Texp_pack (mexpr) ->
-           Texp_pack (map_module_expr mexpr)
+            Texp_for (
+              id, name,
+              map_expression exp1,
+              map_expression exp2,
+              dir,
+              map_expression exp3
+            )
+          | Texp_when (exp1, exp2) ->
+            Texp_when (
+              map_expression exp1,
+              map_expression exp2
+            )
+          | Texp_send (exp, meth, expo) ->
+            Texp_send (map_expression exp, meth, may_map map_expression expo)
+          | Texp_new (path, lid, cl_decl) -> exp.exp_desc
+          | Texp_instvar (_, path, _) -> exp.exp_desc
+          | Texp_setinstvar (path, lid, path2, exp) ->
+            Texp_setinstvar (path, lid, path2, map_expression exp)
+          | Texp_override (path, list) ->
+            Texp_override (
+              path,
+              List.map (fun (path, lid, exp) ->
+                (path, lid, map_expression exp)
+              ) list
+            )
+          | Texp_letmodule (id, name, mexpr, exp) ->
+            Texp_letmodule (
+              id, name,
+              map_module_expr mexpr,
+              map_expression exp
+            )
+          | Texp_assert exp -> Texp_assert (map_expression exp)
+          | Texp_assertfalse -> exp.exp_desc
+          | Texp_lazy exp -> Texp_lazy (map_expression exp)
+          | Texp_object (cl, string_list) ->
+            Texp_object (map_class_structure cl, string_list)
+          | Texp_pack (mexpr) ->
+            Texp_pack (map_module_expr mexpr)
       in
       let exp_extra = List.map map_exp_extra exp.exp_extra in
       Map.leave_expression {
@@ -522,12 +522,12 @@ end = struct
         | Texp_constraint (Some ct1, Some ct2) ->
           Texp_constraint (Some (map_core_type ct1),
                            Some (map_core_type ct2)), loc
-       | Texp_poly (Some ct) ->
-         Texp_poly (Some ( map_core_type ct )), loc
-       | Texp_newtype _
+        | Texp_poly (Some ct) ->
+          Texp_poly (Some ( map_core_type ct )), loc
+        | Texp_newtype _
         | Texp_constraint (None, None)
         | Texp_open _
-       | Texp_poly None -> exp_extra
+        | Texp_poly None -> exp_extra
 
 
     and map_package_type pack =
@@ -551,7 +551,7 @@ end = struct
             List.map (fun (id, name, decl) ->
               (id, name, map_type_declaration decl)
             ) list
-         )
+          )
           | Tsig_exception (id, name, decl) ->
             Tsig_exception (id, name, map_exception_declaration decl)
           | Tsig_module (id, name, mtype) ->
@@ -598,13 +598,13 @@ end = struct
             Tmty_ident (path, lid) -> mty.mty_desc
           | Tmty_signature sg -> Tmty_signature (map_signature sg)
           | Tmty_functor (id, name, mtype1, mtype2) ->
-           Tmty_functor (id, name, map_module_type mtype1,
+            Tmty_functor (id, name, map_module_type mtype1,
                           map_module_type mtype2)
           | Tmty_with (mtype, list) ->
             Tmty_with (map_module_type mtype,
-                      List.map (fun (path, lid, withc) ->
-                        (path, lid, map_with_constraint withc)
-                      ) list)
+                       List.map (fun (path, lid, withc) ->
+                         (path, lid, map_with_constraint withc)
+                       ) list)
           | Tmty_typeof mexpr ->
             Tmty_typeof (map_module_expr mexpr)
       in
@@ -655,21 +655,21 @@ end = struct
           | Tcl_structure clstr -> Tcl_structure (map_class_structure clstr)
           | Tcl_fun (label, pat, priv, cl, partial) ->
             Tcl_fun (label, map_pattern pat,
-                    List.map (fun (id, name, exp) ->
+                     List.map (fun (id, name, exp) ->
                        (id, name, map_expression exp)) priv,
-                    map_class_expr cl, partial)
+                     map_class_expr cl, partial)
 
           | Tcl_apply (cl, args) ->
             Tcl_apply (map_class_expr cl,
-                      List.map (fun (label, expo, optional) ->
+                       List.map (fun (label, expo, optional) ->
                                      (label, may_map map_expression expo,
                                       optional)
-                      ) args)
+                       ) args)
           | Tcl_let (rec_flat, bindings, ivars, cl) ->
             Tcl_let (rec_flat, map_bindings rec_flat bindings,
-                    List.map (fun (id, name, exp) ->
+                     List.map (fun (id, name, exp) ->
                                    (id, name, map_expression exp)) ivars,
-                    map_class_expr cl)
+                     map_class_expr cl)
 
           | Tcl_constraint (cl, Some clty, vals, meths, concrs) ->
             Tcl_constraint ( map_class_expr cl,
@@ -757,7 +757,7 @@ end = struct
       match rf with
           Ttag (label, bool, list) ->
             Ttag (label, bool, List.map map_core_type list)
-       | Tinherit ct -> Tinherit (map_core_type ct)
+        | Tinherit ct -> Tinherit (map_core_type ct)
 
     and map_class_field cf =
       let cf = Map.enter_class_field cf in
@@ -765,21 +765,21 @@ end = struct
         match cf.cf_desc with
             Tcf_inher (ovf, cl, super, vals, meths) ->
               Tcf_inher (ovf, map_class_expr cl, super, vals, meths)
-         | Tcf_constr (cty, cty') ->
+          | Tcf_constr (cty, cty') ->
             Tcf_constr (map_core_type cty, map_core_type cty')
-         | Tcf_val (lab, name, mut, ident, Tcfk_virtual cty, override) ->
+          | Tcf_val (lab, name, mut, ident, Tcfk_virtual cty, override) ->
             Tcf_val (lab, name, mut, ident, Tcfk_virtual (map_core_type cty),
                      override)
-         | Tcf_val (lab, name, mut, ident, Tcfk_concrete exp, override) ->
+          | Tcf_val (lab, name, mut, ident, Tcfk_concrete exp, override) ->
             Tcf_val (lab, name, mut, ident, Tcfk_concrete (map_expression exp),
                      override)
-         | Tcf_meth (lab, name, priv, Tcfk_virtual cty, override) ->
+          | Tcf_meth (lab, name, priv, Tcfk_virtual cty, override) ->
             Tcf_meth (lab, name, priv, Tcfk_virtual (map_core_type cty),
                       override)
-         | Tcf_meth (lab, name, priv, Tcfk_concrete exp, override) ->
+          | Tcf_meth (lab, name, priv, Tcfk_concrete exp, override) ->
             Tcf_meth (lab, name, priv, Tcfk_concrete (map_expression exp),
                       override)
-         | Tcf_init exp -> Tcf_init (map_expression exp)
+          | Tcf_init exp -> Tcf_init (map_expression exp)
       in
       Map.leave_class_field { cf with cf_desc = cf_desc }
 
index 65bf372af5ac8c8f96568fdd629d7ee8000c718c..560c7ac2fd9236e98ddd8dd450c187efc09e6640 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: ctype.mli 12534 2012-06-01 05:24:38Z garrigue $ *)
+(* $Id: ctype.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Operations on core types *)
 
@@ -115,7 +115,7 @@ val instance_def: type_expr -> type_expr
 val instance_list: Env.t -> type_expr list -> type_expr list
         (* Take an instance of a list of type schemes *)
 val instance_constructor:
-        ?in_pattern:Env.t ref * int -> 
+        ?in_pattern:Env.t ref * int ->
         constructor_description -> type_expr list * type_expr
         (* Same, for a constructor *)
 val instance_parameterized_type:
index edf0153e6b2f501323fc9dfaa2fdfc0aa72fdf57..71e5a8518df2deb73fc7ad49c0313ed36169fb1f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: datarepr.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: datarepr.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Compute constructor and label descriptions from type declarations,
    determining their representation. *)
@@ -23,7 +23,7 @@ open Btype
 (* Simplified version of Ctype.free_vars *)
 let rec free_vars ty =
   let ret = ref TypeSet.empty in
-  let rec loop ty = 
+  let rec loop ty =
     let ty = repr ty in
     if ty.level >= lowest_level then begin
       ty.level <- pivot_level - ty.level;
@@ -35,7 +35,7 @@ let rec free_vars ty =
           iter_row loop row;
           if not (static_row row) then loop row.row_more
       | _ ->
-         iter_type_expr loop ty
+          iter_type_expr loop ty
     end
   in
   loop ty;
@@ -52,39 +52,39 @@ let constructor_descrs ty_res cstrs priv =
   let rec describe_constructors idx_const idx_nonconst = function
       [] -> []
     | (name, ty_args, ty_res_opt) :: rem ->
-       let ty_res = 
-         match ty_res_opt with
-         | Some ty_res' -> ty_res'
-         | None -> ty_res
-       in
+        let ty_res =
+          match ty_res_opt with
+          | Some ty_res' -> ty_res'
+          | None -> ty_res
+        in
         let (tag, descr_rem) =
           match ty_args with
             [] -> (Cstr_constant idx_const,
                    describe_constructors (idx_const+1) idx_nonconst rem)
           | _  -> (Cstr_block idx_nonconst,
                    describe_constructors idx_const (idx_nonconst+1) rem) in
-       let existentials = 
-         match ty_res_opt with
-         | None -> []
-         | Some type_ret ->
-             let res_vars = free_vars type_ret in
-             let arg_vars = free_vars (newgenty (Ttuple ty_args)) in
-             TypeSet.elements (TypeSet.diff arg_vars res_vars)
-       in
-       let cstr =
-          { cstr_res = ty_res;    
-           cstr_existentials = existentials; 
+        let existentials =
+          match ty_res_opt with
+          | None -> []
+          | Some type_ret ->
+              let res_vars = free_vars type_ret in
+              let arg_vars = free_vars (newgenty (Ttuple ty_args)) in
+              TypeSet.elements (TypeSet.diff arg_vars res_vars)
+        in
+        let cstr =
+          { cstr_res = ty_res;
+            cstr_existentials = existentials;
             cstr_args = ty_args;
             cstr_arity = List.length ty_args;
             cstr_tag = tag;
             cstr_consts = !num_consts;
             cstr_nonconsts = !num_nonconsts;
-           cstr_normal = !num_normal;
+            cstr_normal = !num_normal;
             cstr_private = priv;
-           cstr_generalized = ty_res_opt <> None
-         } in
+            cstr_generalized = ty_res_opt <> None
+          } in
         (name, cstr) :: descr_rem in
-  describe_constructors 0 0 cstrs 
+  describe_constructors 0 0 cstrs
 
 let exception_descr path_exc decl =
   { cstr_res = Predef.type_exn;
index 334a73780eb715415f527f354aab253f313a9a9c..061e86bcf4d4c1616eef1b965d12e01bc88d74a2 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: env.ml 12706 2012-07-13 08:49:06Z lefessan $ *)
+(* $Id: env.ml 12820 2012-08-03 20:23:26Z frisch $ *)
 
 (* Environment handling *)
 
@@ -825,16 +825,16 @@ and components_of_module_maker (env, sub, path, mty) =
             let decl' = Subst.type_declaration sub decl in
             c.comp_types <-
               Tbl.add (Ident.name id) (decl', nopos) c.comp_types;
-           let constructors = constructors_of_type path decl' in
-           c.comp_constrs_by_path <-
-             Tbl.add (Ident.name id)
-               (List.map snd constructors, nopos) c.comp_constrs_by_path;
+            let constructors = constructors_of_type path decl' in
+            c.comp_constrs_by_path <-
+              Tbl.add (Ident.name id)
+                (List.map snd constructors, nopos) c.comp_constrs_by_path;
             List.iter
               (fun (name, descr) ->
                 c.comp_constrs <-
                   Tbl.add (Ident.name name) (descr, nopos) c.comp_constrs)
               constructors;
-           let labels = labels_of_type path decl' in
+            let labels = labels_of_type path decl' in
             List.iter
               (fun (name, descr) ->
                 c.comp_labels <-
@@ -927,7 +927,7 @@ and store_type id path info env =
   let constructors = constructors_of_type path info in
   let labels = labels_of_type path info in
 
-  if not env.in_signature && not loc.Location.loc_ghost &&
+  if not loc.Location.loc_ghost &&
     Warnings.is_active (Warnings.Unused_constructor ("", false, false))
   then begin
     let ty = Ident.name id in
@@ -941,7 +941,7 @@ and store_type id path info env =
           if not (ty = "" || ty.[0] = '_')
           then !add_delayed_check_forward
               (fun () ->
-                if not used.cu_positive then
+                if not env.in_signature && not used.cu_positive then
                   Location.prerr_warning loc
                     (Warnings.Unused_constructor
                        (c, used.cu_pattern, used.cu_privatize)))
@@ -980,7 +980,7 @@ and store_type_infos id path info env =
 
 and store_exception id path decl env =
   let loc = decl.exn_loc in
-  if not env.in_signature && not loc.Location.loc_ghost &&
+  if not loc.Location.loc_ghost &&
     Warnings.is_active (Warnings.Unused_exception ("", false))
   then begin
     let ty = "exn" in
@@ -991,7 +991,7 @@ and store_exception id path decl env =
       Hashtbl.add used_constructors k (add_constructor_usage used);
       !add_delayed_check_forward
         (fun () ->
-          if not used.cu_positive then
+          if not env.in_signature && not used.cu_positive then
             Location.prerr_warning loc
               (Warnings.Unused_exception
                  (c, used.cu_pattern)
index fad7d773aaccd6fa7f81a6a54c5430fd867a9ff9..9846dc46314d5b0caea7031924dd67835b098d04 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: env.mli 12706 2012-07-13 08:49:06Z lefessan $ *)
+(* $Id: env.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Environment handling *)
 
@@ -216,6 +216,3 @@ val fold_classs:
 val fold_cltypes:
   (string -> Path.t -> Types.class_type_declaration -> 'a -> 'a) ->
   Longident.t option -> t -> 'a -> 'a
-
-
-
index 711a809d0b6a16d296942da6f3ba3cb1eb871891..c5dc89f01c359cb276263f5c9cc2d6d00459385f 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: includecore.ml 12520 2012-05-31 07:41:37Z garrigue $ *)
+(* $Id: includecore.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Inclusion checks for the core language *)
 
@@ -175,18 +175,18 @@ let rec compare_variants env decl1 decl2 n cstrs1 cstrs2 =
         [Field_arity cstr1]
       else match ret1, ret2 with
       | Some r1, Some r2 when not (Ctype.equal env true [r1] [r2]) ->
-         [Field_type cstr1]
+          [Field_type cstr1]
       | Some _, None | None, Some _ ->
-         [Field_type cstr1]
+          [Field_type cstr1]
       | _ ->
-         if Misc.for_all2
-             (fun ty1 ty2 ->
-               Ctype.equal env true (ty1::decl1.type_params)
-                 (ty2::decl2.type_params))
-             (arg1) (arg2)
-         then
-           compare_variants env decl1 decl2 (n+1) rem1 rem2
-         else [Field_type cstr1]
+          if Misc.for_all2
+              (fun ty1 ty2 ->
+                Ctype.equal env true (ty1::decl1.type_params)
+                  (ty2::decl2.type_params))
+              (arg1) (arg2)
+          then
+            compare_variants env decl1 decl2 (n+1) rem1 rem2
+          else [Field_type cstr1]
 
 
 let rec compare_records env decl1 decl2 n labels1 labels2 =
index a0d42baf26c0e502f38feb43a195cba1d19bfce2..9be704336a430ff446820c2ab9a0a628dc94ffbd 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parmatch.ml 12726 2012-07-18 03:34:36Z garrigue $ *)
+(* $Id: parmatch.ml 12961 2012-09-27 13:30:07Z garrigue $ *)
 
 (* Detection of partial matches and unused match cases. *)
 
@@ -53,6 +53,12 @@ let is_absent_pat p = match p.pat_desc with
 | Tpat_variant (tag, _, row) -> is_absent tag row
 | _ -> false
 
+let const_compare x y =
+  match x,y with
+  | Const_float f1, Const_float f2 ->
+      Pervasives.compare (float_of_string f1) (float_of_string f2)
+  | _, _ -> Pervasives.compare x y
+
 let records_args l1 l2 =
   (* Invariant: fields are already sorted by Typecore.type_label_a_list *)
   let rec combine r1 r2 l1 l2 = match l1,l2 with
@@ -77,7 +83,7 @@ let rec compat p q =
   | _,(Tpat_any|Tpat_var _) -> true
   | Tpat_or (p1,p2,_),_     -> compat p1 q || compat p2 q
   | _,Tpat_or (q1,q2,_)     -> compat p q1 || compat p q2
-  | Tpat_constant c1, Tpat_constant c2 -> c1=c2
+  | Tpat_constant c1, Tpat_constant c2 -> const_compare c1 c2 = 0
   | Tpat_tuple ps, Tpat_tuple qs -> compats ps qs
   | Tpat_lazy p, Tpat_lazy q -> compat p q
   | Tpat_construct (_, _, c1,ps1, _), Tpat_construct (_, _, c2,ps2, _) ->
@@ -282,9 +288,7 @@ let simple_match p1 p2 =
       c1.cstr_tag = c2.cstr_tag
   | Tpat_variant(l1, _, _), Tpat_variant(l2, _, _) ->
       l1 = l2
-  | Tpat_constant(Const_float s1), Tpat_constant(Const_float s2) ->
-      float_of_string s1 = float_of_string s2
-  | Tpat_constant(c1), Tpat_constant(c2) -> c1 = c2
+  | Tpat_constant(c1), Tpat_constant(c2) -> const_compare c1 c2 = 0
   | Tpat_tuple _, Tpat_tuple _ -> true
   | Tpat_lazy _, Tpat_lazy _ -> true
   | Tpat_record _ , Tpat_record _ -> true
@@ -629,7 +633,7 @@ let clean_env env =
     function
       | [] -> []
       | x :: xs ->
-         if generalized_constructor x then loop xs else x :: loop xs
+          if generalized_constructor x then loop xs else x :: loop xs
   in
   loop env
 
@@ -697,7 +701,7 @@ let extendable_match env = match env with
 let should_extend ext env = match ext with
 | None -> false
 | Some ext -> match env with
-  | ({pat_desc = 
+  | ({pat_desc =
       Tpat_construct(_, _, {cstr_tag=(Cstr_constant _|Cstr_block _)},_,_)}
      as p, _) :: _ ->
       let path = get_type_path p.pat_type p.pat_env in
@@ -749,7 +753,7 @@ let rec adt_path env ty =
   | {type_kind=Type_variant constr_list} ->
       begin match (Ctype.repr ty).desc with
       | Tconstr (path,_,_) ->
-         path
+          path
       | _ -> assert false end
   | {type_manifest = Some _} ->
       adt_path env (Ctype.expand_head_once env (clean_copy ty))
@@ -760,25 +764,25 @@ let rec map_filter f  =
   function
       [] -> []
     | x :: xs ->
-       match f x with
-       | None -> map_filter f xs
-       | Some y -> y :: map_filter f xs
+        match f x with
+        | None -> map_filter f xs
+        | Some y -> y :: map_filter f xs
 
 (* Sends back a pattern that complements constructor tags all_tag *)
 let complete_constrs p all_tags =
   match p.pat_desc with
   | Tpat_construct (_,_,c,_,_) ->
       begin try
-       let not_tags = complete_tags c.cstr_consts c.cstr_nonconsts all_tags in
-       let constrs =
+        let not_tags = complete_tags c.cstr_consts c.cstr_nonconsts all_tags in
+        let constrs =
           Env.find_constructors (adt_path p.pat_env p.pat_type) p.pat_env in
-       map_filter
+        map_filter
           (fun cnstr ->
-           if List.mem cnstr.cstr_tag not_tags then Some cnstr else None)
-         constrs
+            if List.mem cnstr.cstr_tag not_tags then Some cnstr else None)
+          constrs
       with
       | Datarepr.Constr_not_found ->
-         fatal_error "Parmatch.complete_constr: constr_not_found"
+          fatal_error "Parmatch.complete_constr: constr_not_found"
       end
   | _ -> fatal_error "Parmatch.complete_constr"
 
@@ -935,8 +939,8 @@ let build_other_gadt ext env =
           | {pat_desc = Tpat_construct (_,_,c,_,_)} -> c.cstr_tag
           | _ -> fatal_error "Parmatch.get_tag" in
         let all_tags =  List.map (fun (p,_) -> get_tag p) env in
-       let cnstrs  = complete_constrs p all_tags in
-       let pats = List.map (pat_of_constr p) cnstrs in
+        let cnstrs  = complete_constrs p all_tags in
+        let pats = List.map (pat_of_constr p) cnstrs in
         (* List.iter (Format.eprintf "%a@." top_pretty) pats;
            Format.eprintf "@.@."; *)
         pats
@@ -1030,11 +1034,11 @@ let rec try_many_gadt  f = function
       match f (p,pss) with
       | Rnone -> try_many f rest
       | Rsome sofar ->
-         let others = try_many f rest in
-         match others with
-           Rnone -> Rsome sofar
-         | Rsome sofar' ->
-             Rsome (sofar @ sofar')
+          let others = try_many f rest in
+          match others with
+            Rnone -> Rsome sofar
+          | Rsome sofar' ->
+              Rsome (sofar @ sofar')
 
 
 
@@ -1088,13 +1092,13 @@ let rec exhaust ext pss n = match pss with
 let combinations f lst lst' =
   let rec iter2 x =
     function
-       [] -> []
+        [] -> []
       | y :: ys ->
-         f x y :: iter2 x ys
+          f x y :: iter2 x ys
   in
   let rec iter =
     function
-       [] -> []
+        [] -> []
       | x :: xs -> iter2 x lst' @ iter xs
   in
   iter lst
@@ -1147,11 +1151,11 @@ let rec exhaust_gadt (ext:Path.t option) pss n = match pss with
             with
             | Rsome r -> Rsome (List.map (fun row ->  (set_args p row)) r)
             | r       -> r in
-       let before = try_many_gadt try_non_omega constrs in
+        let before = try_many_gadt try_non_omega constrs in
         if
-         full_match_gadt constrs && not (should_extend ext constrs)
+          full_match_gadt constrs && not (should_extend ext constrs)
         then
-         before
+          before
         else
           (*
             D = filter_extra pss is the default matrix
@@ -1166,18 +1170,18 @@ let rec exhaust_gadt (ext:Path.t option) pss n = match pss with
           | Rnone -> before
           | Rsome r ->
               try
-               let missing_trailing = build_other_gadt ext constrs in
-               let before =
-                 match before with
-                   Rnone -> []
-                 | Rsome lst -> lst
-               in
-               let dug =
-                 combinations
-                   (fun head tail -> head :: tail)
-                   missing_trailing
-                   r
-               in
+                let missing_trailing = build_other_gadt ext constrs in
+                let before =
+                  match before with
+                    Rnone -> []
+                  | Rsome lst -> lst
+                in
+                let dug =
+                  combinations
+                    (fun head tail -> head :: tail)
+                    missing_trailing
+                    r
+                in
                 Rsome (dug @ before)
               with
       (* cannot occur, since constructors don't make a full signature *)
@@ -1192,11 +1196,11 @@ let exhaust_gadt ext pss n =
       (* The following line is needed to compile stdlib/printf.ml *)
       if lst = [] then Rsome (omegas n) else
       let singletons =
-       List.map
-         (function
-             [x] -> x
-           | _ -> assert false)
-         lst
+        List.map
+          (function
+              [x] -> x
+            | _ -> assert false)
+          lst
       in
       Rsome [orify_many singletons]
 
@@ -1523,7 +1527,7 @@ let rec le_pat p q =
   | (Tpat_var _|Tpat_any),_ -> true
   | Tpat_alias(p,_,_), _ -> le_pat p q
   | _, Tpat_alias(q,_,_) -> le_pat p q
-  | Tpat_constant(c1), Tpat_constant(c2) -> c1 = c2
+  | Tpat_constant(c1), Tpat_constant(c2) -> const_compare c1 c2 = 0
   | Tpat_construct(_,_,c1,ps,_), Tpat_construct(_,_,c2,qs,_) ->
       c1.cstr_tag = c2.cstr_tag && le_pats ps qs
   | Tpat_variant(l1,Some p1,_), Tpat_variant(l2,Some p2,_) ->
@@ -1567,7 +1571,7 @@ let rec lub p q = match p.pat_desc,q.pat_desc with
 | _,(Tpat_any|Tpat_var _) -> p
 | Tpat_or (p1,p2,_),_     -> orlub p1 p2 q
 | _,Tpat_or (q1,q2,_)     -> orlub q1 q2 p (* Thanks god, lub is commutative *)
-| Tpat_constant c1, Tpat_constant c2 when c1=c2 -> p
+| Tpat_constant c1, Tpat_constant c2 when const_compare c1 c2 = 0 -> p
 | Tpat_tuple ps, Tpat_tuple qs ->
     let rs = lubs ps qs in
     make_pat (Tpat_tuple rs) p.pat_type p.pat_env
@@ -1732,9 +1736,9 @@ let check_partial_all v casel =
     function
       | [] -> None
       | x :: xs ->
-         match f x with
-         | None -> get_first f xs
-         | x -> x
+          match f x with
+          | None -> get_first f xs
+          | x -> x
 
 
 (* conversion from Typedtree.pattern to Parsetree.pattern list *)
@@ -1748,11 +1752,11 @@ module Conv = struct
     function
       | xs :: [] -> List.map (fun y -> [y]) xs
       | (x::xs)::ys ->
-         List.map
-           (fun lst -> x :: lst)
-           (select ys)
-         @
-           select (xs::ys)
+          List.map
+            (fun lst -> x :: lst)
+            (select ys)
+          @
+            select (xs::ys)
       | _ -> []
 
   let name_counter = ref 0
@@ -1771,72 +1775,72 @@ module Conv = struct
     let rec loop pat =
       match pat.pat_desc with
         Tpat_or (a,b,_) ->
-         loop a @ loop b
+          loop a @ loop b
       | Tpat_any | Tpat_constant _ | Tpat_var _ ->
-         [mkpat Ppat_any]
+          [mkpat Ppat_any]
       | Tpat_alias (p,_,_) -> loop p
       | Tpat_tuple lst ->
-         let results = select (List.map loop lst) in
-         List.map
-           (fun lst -> mkpat (Ppat_tuple lst))
-           results
+          let results = select (List.map loop lst) in
+          List.map
+            (fun lst -> mkpat (Ppat_tuple lst))
+            results
       | Tpat_construct (cstr_path, cstr_lid, cstr,lst,_) ->
-         let id = fresh () in
+          let id = fresh () in
           let lid = { cstr_lid with txt = Longident.Lident id } in
-         Hashtbl.add constrs id (cstr_path,cstr);
-         let results = select (List.map loop lst) in
-         begin match lst with
-           [] ->
-             [mkpat (Ppat_construct(lid, None, false))]
+          Hashtbl.add constrs id (cstr_path,cstr);
+          let results = select (List.map loop lst) in
+          begin match lst with
+            [] ->
+              [mkpat (Ppat_construct(lid, None, false))]
           | _ ->
-             List.map
-               (fun lst ->
-                 let arg =
-                   match lst with
-                     [] -> assert false
-                   | [x] -> Some x
-                   | _ -> Some (mkpat (Ppat_tuple lst))
-                 in
-                 mkpat (Ppat_construct(lid, arg, false)))
-               results
+              List.map
+                (fun lst ->
+                  let arg =
+                    match lst with
+                      [] -> assert false
+                    | [x] -> Some x
+                    | _ -> Some (mkpat (Ppat_tuple lst))
+                  in
+                  mkpat (Ppat_construct(lid, arg, false)))
+                results
           end
       | Tpat_variant(label,p_opt,row_desc) ->
-         begin match p_opt with
-         | None ->
-             [mkpat (Ppat_variant(label, None))]
-         | Some p ->
-             let results = loop p in
-             List.map
-               (fun p ->
-                 mkpat (Ppat_variant(label, Some p)))
-               results
+          begin match p_opt with
+          | None ->
+              [mkpat (Ppat_variant(label, None))]
+          | Some p ->
+              let results = loop p in
+              List.map
+                (fun p ->
+                  mkpat (Ppat_variant(label, Some p)))
+                results
           end
       | Tpat_record (subpatterns, _closed_flag) ->
-         let pats =
-           select
-             (List.map (fun (_,_,_,x) -> (loop x)) subpatterns)
-         in
-         let label_idents =
-           List.map
-             (fun (lbl_path,_,lbl,_) ->
-               let id = fresh () in
-               Hashtbl.add labels id (lbl_path, lbl);
-               Longident.Lident id)
-             subpatterns
-         in
-         List.map
-           (fun lst ->
-             let lst = List.map2 (fun lid pat ->
+          let pats =
+            select
+              (List.map (fun (_,_,_,x) -> (loop x)) subpatterns)
+          in
+          let label_idents =
+            List.map
+              (fun (lbl_path,_,lbl,_) ->
+                let id = fresh () in
+                Hashtbl.add labels id (lbl_path, lbl);
+                Longident.Lident id)
+              subpatterns
+          in
+          List.map
+            (fun lst ->
+              let lst = List.map2 (fun lid pat ->
                 (mknoloc lid, pat)
               )  label_idents lst in
               mkpat (Ppat_record (lst, Open)))
-           pats
+            pats
       | Tpat_array lst ->
-         let results = select (List.map loop lst) in
-         List.map (fun lst -> mkpat (Ppat_array lst)) results
+          let results = select (List.map loop lst) in
+          List.map (fun lst -> mkpat (Ppat_array lst)) results
       | Tpat_lazy p ->
-         let results = loop p in
-         List.map (fun p -> mkpat (Ppat_lazy p)) results
+          let results = loop p in
+          List.map (fun p -> mkpat (Ppat_lazy p)) results
     in
     let ps = loop typed in
     (ps, constrs, labels)
@@ -1862,38 +1866,38 @@ let do_check_partial ?pred exhaust loc casel pss = match pss with
     begin match exhaust None pss (List.length ps) with
     | Rnone -> Total
     | Rsome [u] ->
-       let v =
-         match pred with
-         | Some pred ->
-             let (patterns,constrs,labels) = Conv.conv u in
+        let v =
+          match pred with
+          | Some pred ->
+              let (patterns,constrs,labels) = Conv.conv u in
 (*              Hashtbl.iter (fun s (path, _) ->
                 Printf.fprintf stderr "CONV: %s -> %s \n%!" s (Path.name path))
                 constrs
               ; *)
-             get_first (pred constrs labels) patterns
-         | None -> Some u
-       in
-       begin match v with
-         None -> Total
-       | Some v ->
+              get_first (pred constrs labels) patterns
+          | None -> Some u
+        in
+        begin match v with
+          None -> Total
+        | Some v ->
             let errmsg =
               try
-               let buf = Buffer.create 16 in
-               let fmt = formatter_of_buffer buf in
-               top_pretty fmt v;
-               begin match check_partial_all v casel with
-               | None -> ()
-               | Some _ ->
+                let buf = Buffer.create 16 in
+                let fmt = formatter_of_buffer buf in
+                top_pretty fmt v;
+                begin match check_partial_all v casel with
+                | None -> ()
+                | Some _ ->
                     (* This is 'Some loc', where loc is the location of
                        a possibly matching clause.
                        Forget about loc, because printing two locations
                        is a pain in the top-level *)
                     Buffer.add_string buf
                       "\n(However, some guarded clause may match this value.)"
-               end ;
-               Buffer.contents buf
+                end ;
+                Buffer.contents buf
               with _ ->
-               "" in
+                "" in
             Location.prerr_warning loc (Warnings.Partial_match errmsg) ;
             Partial end
     | _ ->
@@ -2065,9 +2069,9 @@ let check_partial_param do_check_partial do_check_fragile loc casel =
       let pss = get_mins le_pats pss in
       let total = do_check_partial loc casel pss in
       if
-       total = Total && Warnings.is_active (Warnings.Fragile_match "")
+        total = Total && Warnings.is_active (Warnings.Fragile_match "")
       then begin
-       do_check_fragile loc casel pss
+        do_check_fragile loc casel pss
       end ;
       total
     end else
index ccbf36a819aba16174ead883bafd78a6edd2d949..dfe0e7da8d9914a1ccde184519a3a68e271584b7 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: parmatch.mli 12521 2012-05-31 07:57:32Z garrigue $ *)
+(* $Id: parmatch.mli 12961 2012-09-27 13:30:07Z garrigue $ *)
 
 (* Detection of partial matches and unused match cases. *)
 open Asttypes
@@ -29,6 +29,7 @@ val normalize_pat : pattern -> pattern
 val all_record_args :
     (Path.t * Longident.t loc * label_description * pattern) list ->
     (Path.t * Longident.t loc * label_description * pattern) list
+val const_compare : constant -> constant -> int
 
 val le_pat : pattern -> pattern -> bool
 val le_pats : pattern list -> pattern list -> bool
index 1932a7282d81c7ca13408748afdcce12228cf48d..e22c4a74223c2afd0391b96ce60a97a601c4ab15 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: printtyp.ml 12520 2012-05-31 07:41:37Z garrigue $ *)
+(* $Id: printtyp.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Printing functions *)
 
@@ -589,10 +589,10 @@ let rec tree_of_type_decl id decl =
   | Type_abstract -> ()
   | Type_variant cstrs ->
       List.iter
-       (fun (_, args,ret_type_opt) ->
-         List.iter mark_loops args;
-         may mark_loops ret_type_opt)
-       cstrs
+        (fun (_, args,ret_type_opt) ->
+          List.iter mark_loops args;
+          may mark_loops ret_type_opt)
+        cstrs
   | Type_record(l, rep) ->
       List.iter (fun (_, _, ty) -> mark_loops ty) l
   end;
index 55a0e2eca170830aa927e60c5a8fda6867617a53..d89d25b53ef7735ba482177e6d1b0e4f95a306e7 100644 (file)
@@ -364,9 +364,9 @@ and value_description i ppf x =
 and string_option_underscore i ppf =
   function
     | Some x ->
-       string i ppf x.txt
+        string i ppf x.txt
     | None ->
-       string i ppf "_"
+        string i ppf "_"
 
 and type_declaration i ppf x =
   line i ppf "type_declaration %a\n" fmt_location x.typ_loc;
index 86516c17e38cbe36a8c45885207bd8708fca1ac9..f0a2ecfca18370cd4e8303d0606fbb19606ad61a 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: subst.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: subst.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Substitutions *)
 
@@ -176,7 +176,7 @@ let type_declaration s decl =
             Type_variant
               (List.map
                  (fun (n, args, ret_type) ->
-                  (n, List.map (typexp s) args, may_map (typexp s) ret_type))
+                   (n, List.map (typexp s) args, may_map (typexp s) ret_type))
                  cstrs)
         | Type_record(lbls, rep) ->
             Type_record
@@ -185,7 +185,7 @@ let type_declaration s decl =
         end;
       type_manifest =
         begin
-         match decl.type_manifest with
+          match decl.type_manifest with
             None -> None
           | Some ty -> Some(typexp s ty)
         end;
index cae89d4d50eab11293196b71f66b3d7bb2ab76f1..c7f81b18ccd25ab3bbbd777a79ea6146c051a381 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typeclass.ml 12616 2012-06-19 10:51:33Z garrigue $ *)
+(* $Id: typeclass.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Misc
 open Parsetree
@@ -1722,4 +1722,3 @@ let report_error ppf = function
         "instance variable"
   | No_overriding (kind, name) ->
       fprintf ppf "@[The %s `%s'@ has no previous definition@]" kind name
-
index 12262788955960f6bc9b67ac24ae18cbece7a214..94e4d9c957c737a24d3bc32d10bf41cbc68bc01e 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typecore.ml 12726 2012-07-18 03:34:36Z garrigue $ *)
+(* $Id: typecore.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Typechecking for the core language *)
 
@@ -1386,7 +1386,7 @@ let self_coercion = ref ([] : (Path.t * Location.t list ref) list)
 let create_package_type loc env (p, l) =
   let s = !Typetexp.transl_modtype_longident loc env p in
   let fields = List.map (fun (name, ct) ->
-                          name, Typetexp.transl_simple_type env false ct) l in
+                           name, Typetexp.transl_simple_type env false ct) l in
   let ty = newty (Tpackage (s,
                     List.map fst l,
                    List.map (fun (_, cty) -> cty.ctyp_type) fields))
@@ -2035,8 +2035,8 @@ and type_expect ?in_function env sexp ty_expected =
                   let (obj_ty, res_ty) = filter_arrow env method_type "" in
                   unify env obj_ty desc.val_type;
                   unify env res_ty (instance env typ);
-                 let exp =
-                   Texp_apply({exp_desc =
+                  let exp =
+                    Texp_apply({exp_desc =
                                 Texp_ident(Path.Pident method_id, lid,
                                            {val_type = method_type;
                                             val_kind = Val_reg;
@@ -2050,11 +2050,11 @@ and type_expect ?in_function env sexp ty_expected =
                                   exp_type = desc.val_type;
                                   exp_env = env},
                                Required])
-                 in
+                  in
                   (Tmeth_name met, Some (re {exp_desc = exp;
-                                            exp_loc = loc; exp_extra = [];
-                                            exp_type = typ;
-                                            exp_env = env}), typ)
+                                             exp_loc = loc; exp_extra = [];
+                                             exp_type = typ;
+                                             exp_env = env}), typ)
               |  _ ->
                   assert false
               end
@@ -3211,4 +3211,3 @@ let report_error ppf = function
 
 let () =
   Env.add_delayed_check_forward := add_delayed_check
-
index 37ff396a5f00c7672428fb266ae448ba17744cb5..79225278555c02c532fc0fae4eed56427209d3ad 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typedecl.ml 12609 2012-06-14 10:47:30Z garrigue $ *)
+(* $Id: typedecl.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (**** Typing of type definitions ****)
 
@@ -129,8 +129,8 @@ let make_params sdecl =
   try
     List.map
       (function
-         None -> Ctype.new_global_var ~name:"_" ()
-       | Some x -> enter_type_variable true sdecl.ptype_loc x.txt)
+          None -> Ctype.new_global_var ~name:"_" ()
+        | Some x -> enter_type_variable true sdecl.ptype_loc x.txt)
       sdecl.ptype_params
   with Already_bound ->
     raise(Error(sdecl.ptype_loc, Repeated_parameter))
@@ -158,21 +158,21 @@ let transl_declaration env (name, sdecl) id =
             all_constrs := StringSet.add name !all_constrs)
           cstrs;
         if List.length
-         (List.filter (fun (_, args, _, _) -> args <> []) cstrs)
-         > (Config.max_tag + 1) then
+          (List.filter (fun (_, args, _, _) -> args <> []) cstrs)
+          > (Config.max_tag + 1) then
           raise(Error(sdecl.ptype_loc, Too_many_constructors));
-       let make_cstr (lid, args, ret_type, loc) =
-         let name = Ident.create lid.txt in
-         match ret_type with
-           | None ->
-             (name, lid, List.map (transl_simple_type env true) args, None, loc)
-           | Some sty ->
+        let make_cstr (lid, args, ret_type, loc) =
+          let name = Ident.create lid.txt in
+          match ret_type with
+            | None ->
+              (name, lid, List.map (transl_simple_type env true) args, None, loc)
+            | Some sty ->
               (* if it's a generalized constructor we must first narrow and
                  then widen so as to not introduce any new constraints *)
-             let z = narrow () in
-             reset_type_variables ();
-             let args = List.map (transl_simple_type env false) args in
-             let ret_type =
+              let z = narrow () in
+              reset_type_variables ();
+              let args = List.map (transl_simple_type env false) args in
+              let ret_type =
                 let cty = transl_simple_type env false sty in
                 let ty = cty.ctyp_type in
                 let p = Path.Pident id in
@@ -181,12 +181,12 @@ let transl_declaration env (name, sdecl) id =
                 | _ ->
                     raise (Error (sty.ptyp_loc, Constraint_failed
                                     (ty, Ctype.newconstr p params)))
-             in
-             widen z;
-             (name, lid, args, Some ret_type, loc)
-       in
+              in
+              widen z;
+              (name, lid, args, Some ret_type, loc)
+        in
         let cstrs = List.map make_cstr cstrs in
-       Ttype_variant (List.map (fun (name, lid, ctys, _, loc) ->
+        Ttype_variant (List.map (fun (name, lid, ctys, _, loc) ->
           name, lid, ctys, loc
         ) cstrs),
         Type_variant (List.map (fun (name, name_loc, ctys, option, loc) ->
@@ -277,10 +277,10 @@ let generalize_decl decl =
       ()
   | Type_variant v ->
       List.iter
-       (fun (_, tyl, ret_type) ->
-         List.iter Ctype.generalize tyl;
-         may Ctype.generalize ret_type)
-       v
+        (fun (_, tyl, ret_type) ->
+          List.iter Ctype.generalize tyl;
+          may Ctype.generalize ret_type)
+        v
   | Type_record(r, rep) ->
       List.iter (fun (_, _, ty) -> Ctype.generalize ty) r
   end;
@@ -329,20 +329,20 @@ let check_constraints env (_, sdecl) (_, decl) =
         (fun (name, tyl, ret_type) ->
           let (styl, sret_type) =
             try
-             let (_, sty, sret_type, _) =
-               List.find (fun (n,_,_,_) -> n.txt = Ident.name name)  pl
-             in (sty, sret_type)
+              let (_, sty, sret_type, _) =
+                List.find (fun (n,_,_,_) -> n.txt = Ident.name name)  pl
+              in (sty, sret_type)
             with Not_found -> assert false in
           List.iter2
             (fun sty ty ->
               check_constraints_rec env sty.ptyp_loc visited ty)
             styl tyl;
-         match sret_type, ret_type with
-         | Some sr, Some r ->
-             check_constraints_rec env sr.ptyp_loc visited r
-         | _ ->
-             () )
-       l
+          match sret_type, ret_type with
+          | Some sr, Some r ->
+              check_constraints_rec env sr.ptyp_loc visited r
+          | _ ->
+              () )
+        l
   | Type_record (l, _) ->
       let rec find_pl = function
           Ptype_record pl -> pl
@@ -941,8 +941,8 @@ let transl_with_constraint env id row_path orig_decl sdecl =
   let constraints = List.map
     (function (ty, ty', loc) ->
        try
-        let cty = transl_simple_type env false ty in
-        let cty' = transl_simple_type env false ty' in
+         let cty = transl_simple_type env false ty in
+         let cty' = transl_simple_type env false ty' in
          let ty = cty.ctyp_type in
          let ty' = cty'.ctyp_type in
          Ctype.unify env ty ty';
@@ -1122,7 +1122,7 @@ let report_error ppf = function
       begin match decl.type_kind, decl.type_manifest with
       | Type_variant tl, _ ->
           explain_unbound ppf ty tl (fun (_,tl,_) ->
-           Btype.newgenty (Ttuple tl))
+            Btype.newgenty (Ttuple tl))
             "case" (fun (lab,_,_) -> Ident.name lab ^ " of ")
       | Type_record (tl, _), _ ->
           explain_unbound ppf ty tl (fun (_,_,t) -> t)
index fc347e162b88dadee884dcfd074e16a2d0fad31b..5643968d8650e82654435f39855b06b1b5c2cbbb 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: typemod.ml 12755 2012-07-21 01:19:45Z garrigue $ *)
+(* $Id: typemod.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 open Misc
 open Longident
@@ -136,7 +136,7 @@ let merge_constraint initial_env loc  sg lid constr =
               List.map (fun (c,n) -> (not n, not c, not c))
               sdecl.ptype_variance;
             type_loc = Location.none;
-           type_newtype_level = None }
+            type_newtype_level = None }
         and id_row = Ident.create (s^"#row") in
         let initial_env = Env.add_type id_row decl_row initial_env in
         let tdecl = Typedecl.transl_with_constraint
@@ -446,7 +446,7 @@ and transl_signature env sg =
     match sg with
       [] -> [], [], env
     | item :: srem ->
-       let loc = item.psig_loc in
+        let loc = item.psig_loc in
         match item.psig_desc with
         | Psig_value(name, sdesc) ->
             let tdesc = Typedecl.transl_value_decl env item.psig_loc sdesc in
@@ -533,9 +533,9 @@ and transl_signature env sg =
             mksig (Tsig_class
                      (List.map2
                         (fun pcl tcl ->
-                         let (_, _, _, _, _, _, _, _, _, _, _, tcl) = tcl in
+                          let (_, _, _, _, _, _, _, _, _, _, _, tcl) = tcl in
                           tcl)
-                       cl classes)) env loc
+                        cl classes)) env loc
             :: trem,
             List.flatten
               (map_rec
@@ -554,9 +554,9 @@ and transl_signature env sg =
             let (classes, newenv) = Typeclass.class_type_declarations env cl in
             let (trem,rem, final_env) = transl_sig newenv srem in
             mksig (Tsig_class_type (List.map2 (fun pcl tcl ->
-             let (_, _, _, _, _, _, _, tcl) = tcl in
-             tcl
-           ) cl classes)) env loc :: trem,
+              let (_, _, _, _, _, _, _, tcl) = tcl in
+              tcl
+            ) cl classes)) env loc :: trem,
             List.flatten
               (map_rec
                  (fun rs (i, _, d, i', d', i'', d'', _) ->
@@ -925,13 +925,13 @@ and type_structure ?(toplevel = false) funct_body anchor env sstr scope =
       [] ->
         ([], [], env)
       | pstr :: srem ->
-         let loc = pstr.pstr_loc in
-           match pstr.pstr_desc with
-             | Pstr_eval sexpr ->
-                 let expr = Typecore.type_expression env sexpr in
-                 let (str_rem, sig_rem, final_env) = type_struct env srem in
-                   (mkstr (Tstr_eval expr) loc :: str_rem, sig_rem, final_env)
-             | Pstr_value(rec_flag, sdefs) ->
+          let loc = pstr.pstr_loc in
+            match pstr.pstr_desc with
+              | Pstr_eval sexpr ->
+                  let expr = Typecore.type_expression env sexpr in
+                  let (str_rem, sig_rem, final_env) = type_struct env srem in
+                    (mkstr (Tstr_eval expr) loc :: str_rem, sig_rem, final_env)
+              | Pstr_value(rec_flag, sdefs) ->
         let scope =
           match rec_flag with
           | Recursive -> Some (Annot.Idef {scope with
@@ -1034,9 +1034,9 @@ and type_structure ?(toplevel = false) funct_body anchor env sstr scope =
          Sig_modtype(id, Modtype_manifest mty.mty_type) :: sig_rem,
          final_env)
     | Pstr_open (lid) ->
-       let (path, newenv) = type_open ~toplevel env loc lid in
-       let (str_rem, sig_rem, final_env) = type_struct newenv srem in
-         (mkstr (Tstr_open (path, lid)) loc :: str_rem, sig_rem, final_env)
+        let (path, newenv) = type_open ~toplevel env loc lid in
+        let (str_rem, sig_rem, final_env) = type_struct newenv srem in
+          (mkstr (Tstr_open (path, lid)) loc :: str_rem, sig_rem, final_env)
     | Pstr_class cl ->
          List.iter
            (fun {pci_name = name} -> check "type" loc type_names name.txt)
index aff39eb33502057d6bd0d5d63e704de6504abd69..1bd46ada0ba275f1ffdbec4c2f34e625407f44af 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: types.mli 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: types.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Representation of types and declarations *)
 
@@ -109,7 +109,7 @@ type constructor_description =
     cstr_args: type_expr list;          (* Type of the arguments *)
     cstr_arity: int;                    (* Number of arguments *)
     cstr_tag: constructor_tag;          (* Tag for heap blocks *)
-    cstr_consts: int;                   (* Number of constant constructors *) 
+    cstr_consts: int;                   (* Number of constant constructors *)
     cstr_nonconsts: int;                (* Number of non-const constructors *)
     cstr_normal: int;                   (* Number of non generalized constrs *)
     cstr_generalized: bool;             (* Constrained return type? *)
index 5f9c6caf52729da889a87eb9d3969d44764004dd..aa8b7c6a48b4d36ed6466528321ad3e5aaa0c07e 100644 (file)
@@ -263,21 +263,21 @@ let rec transl_type env policy styp =
       with Unify trace ->
         raise (Error(styp.ptyp_loc, Type_mismatch trace))
       end;
-       ctyp (Ttyp_constr (path, lid, args)) constr env loc
+        ctyp (Ttyp_constr (path, lid, args)) constr env loc
   | Ptyp_object fields ->
       let fields = List.map
           (fun pf ->
-           let desc =
-             match pf.pfield_desc with
-             | Pfield_var -> Tcfield_var
-             | Pfield (s,e) ->
-                 let ty1 = transl_type env policy e in
-                 Tcfield (s, ty1)
-           in
-           { field_desc = desc; field_loc = pf.pfield_loc })
-         fields in
+            let desc =
+              match pf.pfield_desc with
+              | Pfield_var -> Tcfield_var
+              | Pfield (s,e) ->
+                  let ty1 = transl_type env policy e in
+                  Tcfield (s, ty1)
+            in
+            { field_desc = desc; field_loc = pf.pfield_loc })
+          fields in
       let ty = newobj (transl_fields env policy [] fields) in
-       ctyp (Ttyp_object fields) ty env loc
+        ctyp (Ttyp_object fields) ty env loc
   | Ptyp_class(lid, stl, present) ->
       let (path, decl, is_variant) =
         try
@@ -317,7 +317,7 @@ let rec transl_type env policy styp =
            try unify_var env ty' cty.ctyp_type with Unify trace ->
              raise (Error(sty.ptyp_loc, Type_mismatch (swap_list trace))))
         (List.combine stl args) params;
-       let ty_args = List.map (fun ctyp -> ctyp.ctyp_type) args in
+        let ty_args = List.map (fun ctyp -> ctyp.ctyp_type) args in
       let ty =
         try Ctype.expand_head env (newconstr path ty_args)
         with Unify trace ->
@@ -359,7 +359,7 @@ let rec transl_type env policy styp =
       | _ ->
           assert false
       in
-       ctyp (Ttyp_class (path, lid, args, present)) ty env loc
+        ctyp (Ttyp_class (path, lid, args, present)) ty env loc
   | Ptyp_alias(st, alias) ->
       let cty =
         try
@@ -423,20 +423,20 @@ let rec transl_type env policy styp =
             let tl = List.map (transl_type env policy) stl in
             let f = match present with
               Some present when not (List.mem l present) ->
-               let ty_tl = List.map (fun cty -> cty.ctyp_type) tl in
+                let ty_tl = List.map (fun cty -> cty.ctyp_type) tl in
                 Reither(c, ty_tl, false, ref None)
             | _ ->
                 if List.length stl > 1 || c && stl <> [] then
                   raise(Error(styp.ptyp_loc, Present_has_conjunction l));
                 match tl with [] -> Rpresent None
                 | st :: _ ->
-                     Rpresent (Some st.ctyp_type)
+                      Rpresent (Some st.ctyp_type)
             in
             add_typed_field styp.ptyp_loc l f;
-             Ttag (l,c,tl)
+              Ttag (l,c,tl)
         | Rinherit sty ->
             let cty = transl_type env policy sty in
-           let ty = cty.ctyp_type in
+            let ty = cty.ctyp_type in
             let nm =
               match repr cty.ctyp_type with
                 {desc=Tconstr(p, tl, _)} -> Some(p, tl)
@@ -475,7 +475,7 @@ let rec transl_type env policy styp =
                 in
                 add_typed_field sty.ptyp_loc l f)
               fl;
-             Tinherit cty
+              Tinherit cty
       in
       let tfields = List.map add_field fields in
       let fields = Hashtbl.fold (fun _ p l -> p :: l) hfields [] in
@@ -531,19 +531,19 @@ let rec transl_type env policy styp =
       let mty = !transl_modtype env mty in
       widen z;
       let ptys = List.map (fun (s, pty) ->
-                            s, transl_type env policy pty
-                         ) l in
+                             s, transl_type env policy pty
+                          ) l in
       let path = !transl_modtype_longident styp.ptyp_loc env p.txt in
       let ty = newty (Tpackage (path,
                        List.map (fun (s, pty) -> s.txt) l,
                        List.map (fun (_,cty) -> cty.ctyp_type) ptys))
       in
-       ctyp (Ttyp_package {
-               pack_name = path;
-               pack_type = mty.mty_type;
-               pack_fields = ptys;
+        ctyp (Ttyp_package {
+                pack_name = path;
+                pack_type = mty.mty_type;
+                pack_fields = ptys;
                 pack_txt = p;
-             }) ty env loc
+              }) ty env loc
 
 and transl_fields env policy seen =
   function
@@ -641,7 +641,7 @@ let transl_simple_type_univars env styp =
   in
   make_fixed_univars typ.ctyp_type;
     { typ with ctyp_type =
-       instance env (Btype.newgenty (Tpoly (typ.ctyp_type, univs))) }
+        instance env (Btype.newgenty (Tpoly (typ.ctyp_type, univs))) }
 
 let transl_simple_type_delayed env styp =
   univars := []; used_variables := Tbl.empty;
index fb0cddf137cf843bb71aafb48bd2845a1c82cba8..e717bc1ae301a022253a8d17e7e02e848aaf2966 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: clflags.mli 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: clflags.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 val objfiles : string list ref
 val ccobjs : string list ref
@@ -81,4 +81,3 @@ val std_include_dir : unit -> string list
 val shared : bool ref
 val dlcode : bool ref
 val runtime_variant : string ref
-
index dda9909feb21868ab389d81a9bf01168a4824b18..f2adc957bbbd946b1622d543a93aa0e26b11291d 100644 (file)
@@ -10,7 +10,7 @@
 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: misc.ml 12511 2012-05-30 13:29:48Z lefessan $ *)
+(* $Id: misc.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Errors *)
 
@@ -224,4 +224,3 @@ let thd3 (_,_,x) = x
 let fst4 (x, _, _, _) = x
 let snd4 (_,x,_, _) = x
 let thd4 (_,_,x,_) = x
-
index d36205fb532b2059f1ad3931edffe6a1494992c1..035b3b3aaff4df8f2fb69228105a158ba99f0934 100644 (file)
@@ -12,7 +12,7 @@
 
 /* Based on public-domain code from Berkeley Yacc */
 
-/* $Id: main.c 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: main.c 12800 2012-07-30 18:59:07Z doligez $ */
 
 #include <signal.h>
 #include <string.h>
@@ -331,7 +331,7 @@ void create_file_names(void)
     if (action_fd == -1)
         open_error(action_file_name);
     entry_fd = mkstemp(entry_file_name);
-    if (entry_fd == -1)                 
+    if (entry_fd == -1)
         open_error(entry_file_name);
     text_fd = mkstemp(text_file_name);
     if (text_fd == -1)
index 5d4b08346dae2ae9945b6a3ecfa7161c36adb5bc..6a957bb0ea7bfca0258b8704da902fe032c95d10 100644 (file)
 
 /* Based on public-domain code from Berkeley Yacc */
 
-/* $Id: skeleton.c 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: skeleton.c 12834 2012-08-06 14:16:24Z doligez $ */
 
 #include "defs.h"
 
 char *header[] =
 {
   "open Parsing;;",
+  "let _ = parse_error;;", /* avoid warning 33 (PR#5719) */
   0
 };