Merge commit '36423c01d2ab8881c9f8ac6d43fb7c945b0add59' from sequence

This commit is contained in:
Simon Cruanes 2014-11-04 22:19:27 +01:00
commit 81a640cf56
15 changed files with 406 additions and 139 deletions

View file

@ -6,3 +6,4 @@ B _build/tests/
B _build/bench/ B _build/bench/
PKG oUnit PKG oUnit
PKG benchmark PKG benchmark
FLAG -safe-string

View file

@ -1,5 +1,9 @@
#directory "_build";; #directory "_build";;
#load "sequence.cma";; #load "sequence.cma";;
open Sequence.Infix;; open Sequence.Infix;;
(* vim:syntax=ocaml
*) #directory "_build/bigarray/";;
#load "bigarray.cma";;
(* vim:syntax=ocaml *)

View file

@ -1,5 +1,11 @@
# Changelog # Changelog
## 0.5.4
- depend on `bytes`
- compliance with `-safe-string`
- `sequence.bigarray`
## 0.5.3 ## 0.5.3
- bugfix: interaction between `take` and `is_empty` - bugfix: interaction between `take` and `is_empty`
@ -76,4 +82,4 @@
- `zip`, `unzip` and `zip_i` to convert between `t` and `t2` - `zip`, `unzip` and `zip_i` to convert between `t` and `t2`
- added `scan` combinator - added `scan` combinator
note: git log --no-merges previous_version..HEAD --pretty=%s note: git log --no-merges --pretty=%s previous_version..HEAD

View file

@ -1,14 +1,15 @@
# OASIS_START # OASIS_START
# DO NOT EDIT (digest: 99194977427ba82f5912e81125f6cac0) # DO NOT EDIT (digest: 0c501104bbf1dfc40db58200fdbfdd57)
version = "0.5.3" version = "0.5.4"
description = "Simple sequence (iterator) datatype and combinators" description = "Simple sequence (iterator) datatype and combinators"
requires = "bytes"
archive(byte) = "sequence.cma" archive(byte) = "sequence.cma"
archive(byte, plugin) = "sequence.cma" archive(byte, plugin) = "sequence.cma"
archive(native) = "sequence.cmxa" archive(native) = "sequence.cmxa"
archive(native, plugin) = "sequence.cmxs" archive(native, plugin) = "sequence.cmxs"
exists_if = "sequence.cma" exists_if = "sequence.cma"
package "invert" ( package "invert" (
version = "0.5.3" version = "0.5.4"
description = "Simple sequence (iterator) datatype and combinators" description = "Simple sequence (iterator) datatype and combinators"
requires = "sequence delimcc" requires = "sequence delimcc"
archive(byte) = "invert.cma" archive(byte) = "invert.cma"
@ -17,5 +18,16 @@ package "invert" (
archive(native, plugin) = "invert.cmxs" archive(native, plugin) = "invert.cmxs"
exists_if = "invert.cma" exists_if = "invert.cma"
) )
package "bigarray" (
version = "0.5.4"
description = "Simple sequence (iterator) datatype and combinators"
requires = "sequence bigarray"
archive(byte) = "bigarray.cma"
archive(byte, plugin) = "bigarray.cma"
archive(native) = "bigarray.cmxa"
archive(native, plugin) = "bigarray.cmxs"
exists_if = "bigarray.cma"
)
# OASIS_STOP # OASIS_STOP

View file

@ -59,9 +59,11 @@ push_stable: all
VERSION=$(shell awk '/^Version:/ {print $$2}' _oasis) VERSION=$(shell awk '/^Version:/ {print $$2}' _oasis)
SOURCE=*.ml *.mli invert/*.ml invert/*.mli bigarray/*.ml bigarray/*.mli
update_next_tag: update_next_tag:
@echo "update version to $(VERSION)..." @echo "update version to $(VERSION)..."
sed -i "s/NEXT_VERSION/$(VERSION)/g" *.ml *.mli sed -i "s/NEXT_VERSION/$(VERSION)/g" $(SOURCE)
sed -i "s/NEXT_RELEASE/$(VERSION)/g" *.ml *.mli sed -i "s/NEXT_RELEASE/$(VERSION)/g" $(SOURCE)
.PHONY: benchs tests examples update_next_tag push_doc push_stable .PHONY: benchs tests examples update_next_tag push_doc push_stable

View file

@ -1,6 +1,6 @@
OASISFormat: 0.4 OASISFormat: 0.4
Name: sequence Name: sequence
Version: 0.5.3 Version: 0.5.4
Homepage: https://github.com/c-cube/sequence Homepage: https://github.com/c-cube/sequence
Authors: Simon Cruanes Authors: Simon Cruanes
License: BSD-2-clause License: BSD-2-clause
@ -23,9 +23,14 @@ Flag invert
Description: build sequence.invert (requires Delimcc) Description: build sequence.invert (requires Delimcc)
Default: false Default: false
Flag bigarray
Description: build sequence.bigarray (requires bigarray)
Default: true
Library "sequence" Library "sequence"
Path: . Path: .
Modules: Sequence Modules: Sequence
BuildDepends: bytes
Library "invert" Library "invert"
Path: invert Path: invert
@ -36,6 +41,15 @@ Library "invert"
FindlibParent: sequence FindlibParent: sequence
BuildDepends: sequence,delimcc BuildDepends: sequence,delimcc
Library "bigarray"
Path: bigarray
Build$: flag(bigarray)
Install$: flag(bigarray)
Modules: SequenceBigarray
FindlibName: bigarray
FindlibParent: sequence
BuildDepends: sequence,bigarray
Document sequence Document sequence
Title: Sequence docs Title: Sequence docs
Type: ocamlbuild (0.3) Type: ocamlbuild (0.3)

View file

@ -1,8 +1,9 @@
# OASIS_START # OASIS_START
# DO NOT EDIT (digest: e8d5fe31ff471d3c0ec54943fe50d011) # DO NOT EDIT (digest: 29e0c9fc65daf16caa16466d6ff32bac)
# Ignore VCS directories, you can use the same kind of rule outside # Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains # OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process # useless stuff for the build process
true: annot, bin_annot
<**/.svn>: -traverse <**/.svn>: -traverse
<**/.svn>: not_hygienic <**/.svn>: not_hygienic
".bzr": -traverse ".bzr": -traverse
@ -15,25 +16,38 @@
"_darcs": not_hygienic "_darcs": not_hygienic
# Library sequence # Library sequence
"sequence.cmxs": use_sequence "sequence.cmxs": use_sequence
<*.ml{,i,y}>: pkg_bytes
# Library invert # Library invert
"invert/invert.cmxs": use_invert "invert/invert.cmxs": use_invert
<invert/*.ml{,i}>: pkg_delimcc <invert/*.ml{,i,y}>: pkg_bytes
<invert/*.ml{,i}>: use_sequence <invert/*.ml{,i,y}>: pkg_delimcc
<invert/*.ml{,i,y}>: use_sequence
# Library bigarray
"bigarray/bigarray.cmxs": use_bigarray
<bigarray/*.ml{,i,y}>: pkg_bigarray
<bigarray/*.ml{,i,y}>: pkg_bytes
<bigarray/*.ml{,i,y}>: use_sequence
# Executable run_tests # Executable run_tests
"tests/run_tests.native": pkg_bytes
"tests/run_tests.native": pkg_oUnit "tests/run_tests.native": pkg_oUnit
"tests/run_tests.native": use_sequence "tests/run_tests.native": use_sequence
<tests/*.ml{,i}>: pkg_oUnit <tests/*.ml{,i,y}>: pkg_bytes
<tests/*.ml{,i}>: use_sequence <tests/*.ml{,i,y}>: pkg_oUnit
<tests/*.ml{,i,y}>: use_sequence
# Executable benchs # Executable benchs
"bench/benchs.native": pkg_benchmark "bench/benchs.native": pkg_benchmark
"bench/benchs.native": pkg_bytes
"bench/benchs.native": use_sequence "bench/benchs.native": use_sequence
# Executable bench_persistent # Executable bench_persistent
"bench/bench_persistent.native": pkg_benchmark "bench/bench_persistent.native": pkg_benchmark
"bench/bench_persistent.native": pkg_bytes
"bench/bench_persistent.native": use_sequence "bench/bench_persistent.native": use_sequence
# Executable bench_persistent_read # Executable bench_persistent_read
"bench/bench_persistent_read.native": pkg_benchmark "bench/bench_persistent_read.native": pkg_benchmark
"bench/bench_persistent_read.native": pkg_bytes
"bench/bench_persistent_read.native": use_sequence "bench/bench_persistent_read.native": use_sequence
<bench/*.ml{,i}>: pkg_benchmark <bench/*.ml{,i,y}>: pkg_benchmark
<bench/*.ml{,i}>: use_sequence <bench/*.ml{,i,y}>: pkg_bytes
<bench/*.ml{,i,y}>: use_sequence
# OASIS_STOP # OASIS_STOP
true: bin_annot true: bin_annot

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: dca476c3b57e859aa3b1c75ec0959ed9)
SequenceBigarray
# OASIS_STOP

View file

@ -0,0 +1,4 @@
# OASIS_START
# DO NOT EDIT (digest: dca476c3b57e859aa3b1c75ec0959ed9)
SequenceBigarray
# OASIS_STOP

View file

@ -0,0 +1,45 @@
(*
Copyright (c) 2014, Simon Cruanes
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary
form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with
the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*)
(** {1 Interface and Helpers for bigarrays} *)
let of_bigarray b yield =
let len = Bigarray.Array1.dim b in
for i=0 to len-1 do
yield b.{i}
done
let mmap filename =
fun yield ->
let fd = Unix.openfile filename [Unix.O_RDONLY] 0 in
let len = Unix.lseek fd 0 Unix.SEEK_END in
let _ = Unix.lseek fd 0 Unix.SEEK_SET in
let b = Bigarray.Array1.map_file fd Bigarray.Char Bigarray.C_layout false len in
try
of_bigarray b yield;
Unix.close fd
with e ->
Unix.close fd;
raise e

View file

@ -0,0 +1,34 @@
(*
Copyright (c) 2014, Simon Cruanes
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary
form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with
the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*)
(** {1 Interface and Helpers for bigarrays}
@since 0.5.4 *)
val of_bigarray : ('a, _, _) Bigarray.Array1.t -> 'a Sequence.t
(** Iterate on the elements of a 1-D array *)
val mmap : string -> char Sequence.t
(** Map the file into memory, and read the characters. *)

View file

@ -1,5 +1,5 @@
(* OASIS_START *) (* OASIS_START *)
(* DO NOT EDIT (digest: c4bb6d2ca42efb069d5612eb2bbcf244) *) (* DO NOT EDIT (digest: 2ea21bad023bcdcb9626e204d039d0d2) *)
module OASISGettext = struct module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *) (* # 22 "src/oasis/OASISGettext.ml" *)
@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
*) *)
open Ocamlbuild_plugin open Ocamlbuild_plugin
type conf =
{ no_automatic_syntax: bool;
}
(* these functions are not really officially exported *) (* these functions are not really officially exported *)
let run_and_read = let run_and_read =
@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct
(* This lists all supported packages. *) (* This lists all supported packages. *)
let find_packages () = let find_packages () =
List.map before_space (split_nl & run_and_read "ocamlfind list") List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list"))
(* Mock to list available syntaxes. *) (* Mock to list available syntaxes. *)
@ -338,7 +341,7 @@ module MyOCamlbuildFindlib = struct
] ]
let dispatch = let dispatch conf =
function function
| After_options -> | After_options ->
(* By using Before_options one let command line options have an higher (* By using Before_options one let command line options have an higher
@ -357,6 +360,7 @@ module MyOCamlbuildFindlib = struct
* -linkpkg *) * -linkpkg *)
flag ["ocaml"; "link"; "program"] & A"-linkpkg"; flag ["ocaml"; "link"; "program"] & A"-linkpkg";
if not (conf.no_automatic_syntax) then begin
(* For each ocamlfind package one inject the -package option when (* For each ocamlfind package one inject the -package option when
* compiling, computing dependencies, generating documentation and * compiling, computing dependencies, generating documentation and
* linking. *) * linking. *)
@ -365,23 +369,30 @@ module MyOCamlbuildFindlib = struct
let base_args = [A"-package"; A pkg] in let base_args = [A"-package"; A pkg] in
(* TODO: consider how to really choose camlp4o or camlp4r. *) (* TODO: consider how to really choose camlp4o or camlp4r. *)
let syn_args = [A"-syntax"; A "camlp4o"] in let syn_args = [A"-syntax"; A "camlp4o"] in
let args = let (args, pargs) =
(* Heuristic to identify syntax extensions: whether they end in (* Heuristic to identify syntax extensions: whether they end in
".syntax"; some might not. ".syntax"; some might not.
*) *)
if Filename.check_suffix pkg "syntax" || if Filename.check_suffix pkg "syntax" ||
List.mem pkg well_known_syntax then List.mem pkg well_known_syntax then
syn_args @ base_args (syn_args @ base_args, syn_args)
else else
base_args (base_args, [])
in in
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args; flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args; flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args; flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args; flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args; flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
(* TODO: Check if this is allowed for OCaml < 3.12.1 *)
flag ["ocaml"; "compile"; "package("^pkg^")"] & S pargs;
flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
flag ["ocaml"; "doc"; "package("^pkg^")"] & S pargs;
flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
end end
(find_packages ()); (find_packages ());
end;
(* Like -package but for extensions syntax. Morover -syntax is useless (* Like -package but for extensions syntax. Morover -syntax is useless
* when linking. *) * when linking. *)
@ -546,11 +557,12 @@ module MyOCamlbuildBase = struct
(* When ocaml link something that use the C library, then one (* When ocaml link something that use the C library, then one
need that file to be up to date. need that file to be up to date.
This holds both for programs and for libraries.
*) *)
dep ["link"; "ocaml"; "program"; tag_libstubs lib] dep ["link"; "ocaml"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)]; [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
dep ["compile"; "ocaml"; "program"; tag_libstubs lib] dep ["compile"; "ocaml"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)]; [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
(* TODO: be more specific about what depends on headers *) (* TODO: be more specific about what depends on headers *)
@ -580,31 +592,37 @@ module MyOCamlbuildBase = struct
() ()
let dispatch_default t = let dispatch_default conf t =
dispatch_combine dispatch_combine
[ [
dispatch t; dispatch t;
MyOCamlbuildFindlib.dispatch; MyOCamlbuildFindlib.dispatch conf;
] ]
end end
# 594 "myocamlbuild.ml" # 606 "myocamlbuild.ml"
open Ocamlbuild_plugin;; open Ocamlbuild_plugin;;
let package_default = let package_default =
{ {
MyOCamlbuildBase.lib_ocaml = MyOCamlbuildBase.lib_ocaml =
[("sequence", [], []); ("invert", ["invert"], [])]; [
("sequence", [], []);
("invert", ["invert"], []);
("bigarray", ["bigarray"], [])
];
lib_c = []; lib_c = [];
flags = []; flags = [];
includes = [] includes = []
} }
;; ;;
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
# 609 "myocamlbuild.ml" let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
# 627 "myocamlbuild.ml"
(* OASIS_STOP *) (* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;; Ocamlbuild_plugin.dispatch dispatch_default;;

View file

@ -751,7 +751,7 @@ module IO = struct
fun k -> fun k ->
let ic = open_in_gen flags mode filename in let ic = open_in_gen flags mode filename in
try try
let buf = String.create size in let buf = Bytes.create size in
let n = ref 0 in let n = ref 0 in
let stop = ref false in let stop = ref false in
while not !stop do while not !stop do
@ -763,22 +763,29 @@ module IO = struct
if n' = 0 then stop := true else n := !n + n'; if n' = 0 then stop := true else n := !n + n';
done; done;
if !n > 0 if !n > 0
then k (String.sub buf 0 !n) then k (Bytes.sub_string buf 0 !n)
done; done;
close_in ic close_in ic
with e -> with e ->
close_in_noerr ic; close_in_noerr ic;
raise e raise e
let write_to ?(mode=0o644) ?(flags=[Open_creat;Open_wronly]) filename seq = let write_bytes_to ?(mode=0o644) ?(flags=[Open_creat;Open_wronly]) filename seq =
let oc = open_out_gen flags mode filename in let oc = open_out_gen flags mode filename in
try try
seq (fun s -> output oc s 0 (String.length s)); seq (fun s -> output oc s 0 (Bytes.length s));
close_out oc close_out oc
with e -> with e ->
close_out oc; close_out oc;
raise e raise e
let write_to ?mode ?flags filename seq =
write_bytes_to ?mode ?flags filename (map Bytes.unsafe_of_string seq)
let write_bytes_lines ?mode ?flags filename seq =
let ret = Bytes.unsafe_of_string "\n" in
write_bytes_to ?mode ?flags filename (snoc (intersperse ret seq) ret)
let write_lines ?mode ?flags filename seq = let write_lines ?mode ?flags filename seq =
write_to ?mode ?flags filename (snoc (intersperse "\n" seq) "\n") write_bytes_lines ?mode ?flags filename (map Bytes.unsafe_of_string seq)
end end

View file

@ -558,6 +558,12 @@ By chunks of [4096] bytes:
Sequence.IO.(chunks_of ~size:4096 "a" |> write_to "b");; Sequence.IO.(chunks_of ~size:4096 "a" |> write_to "b");;
]} ]}
Read the lines of a file into a list:
{[
Sequence.IO.lines "a" |> Sequence.to_list
]}
@since 0.5.1 *) @since 0.5.1 *)
module IO : sig module IO : sig
@ -586,7 +592,15 @@ module IO : sig
@param mode default [0o644] @param mode default [0o644]
@param flags used by [open_out_gen]. Default: [[Open_creat;Open_wronly]]. *) @param flags used by [open_out_gen]. Default: [[Open_creat;Open_wronly]]. *)
val write_bytes_to : ?mode:int -> ?flags:open_flag list ->
string -> Bytes.t t -> unit
(** @since 0.5.4 *)
val write_lines : ?mode:int -> ?flags:open_flag list -> val write_lines : ?mode:int -> ?flags:open_flag list ->
string -> string t -> unit string -> string t -> unit
(** Same as {!write_to}, but intercales ['\n'] between each string *) (** Same as {!write_to}, but intercales ['\n'] between each string *)
val write_bytes_lines : ?mode:int -> ?flags:open_flag list ->
string -> Bytes.t t -> unit
(** @since 0.5.4 *)
end end

View file

@ -1,9 +1,9 @@
(* setup.ml generated for the first time by OASIS v0.4.4 *) (* setup.ml generated for the first time by OASIS v0.4.4 *)
(* OASIS_START *) (* OASIS_START *)
(* DO NOT EDIT (digest: 1c260750474eb19b8e9212954217b6fd) *) (* DO NOT EDIT (digest: 99b277a969b94ce64e720af9e5ba6929) *)
(* (*
Regenerated by OASIS v0.4.4 Regenerated by OASIS v0.4.5
Visit http://oasis.forge.ocamlcore.org for more information and Visit http://oasis.forge.ocamlcore.org for more information and
documentation about functions used in this file. documentation about functions used in this file.
*) *)
@ -242,11 +242,9 @@ module OASISString = struct
let replace_chars f s = let replace_chars f s =
let buf = String.make (String.length s) 'X' in let buf = Buffer.create (String.length s) in
for i = 0 to String.length s - 1 do String.iter (fun c -> Buffer.add_char buf (f c)) s;
buf.[i] <- f s.[i] Buffer.contents buf
done;
buf
end end
@ -1729,6 +1727,13 @@ module OASISFeatures = struct
(fun () -> (fun () ->
s_ "Allows the OASIS section comments and digest to be omitted in \ s_ "Allows the OASIS section comments and digest to be omitted in \
generated files.") generated files.")
let no_automatic_syntax =
create "no_automatic_syntax" alpha
(fun () ->
s_ "Disable the automatic inclusion of -syntax camlp4o for packages \
that matches the internal heuristic (if a dependency ends with \
a .syntax or is a well known syntax).")
end end
module OASISUnixPath = struct module OASISUnixPath = struct
@ -2099,16 +2104,6 @@ module OASISLibrary = struct
lst lst
in in
(* The headers that should be compiled along *)
let headers =
if lib.lib_pack then
[]
else
find_modules
lib.lib_modules
"cmi"
in
(* The .cmx that be compiled along *) (* The .cmx that be compiled along *)
let cmxs = let cmxs =
let should_be_built = let should_be_built =
@ -2134,12 +2129,32 @@ module OASISLibrary = struct
[] []
in in
(* The headers and annot/cmt files that should be compiled along *)
let headers =
let sufx =
if lib.lib_pack
then [".cmti"; ".cmt"; ".annot"]
else [".cmi"; ".cmti"; ".cmt"; ".annot"]
in
List.map
begin
List.fold_left
begin fun accu s ->
let dot = String.rindex s '.' in
let base = String.sub s 0 dot in
List.map ((^) base) sufx @ accu
end
[]
end
(find_modules lib.lib_modules "cmi")
in
(* Compute what libraries should be built *) (* Compute what libraries should be built *)
let acc_nopath = let acc_nopath =
(* Add the packed header file if required *) (* Add the packed header file if required *)
let add_pack_header acc = let add_pack_header acc =
if lib.lib_pack then if lib.lib_pack then
[cs.cs_name^".cmi"] :: acc [cs.cs_name^".cmi"; cs.cs_name^".cmti"; cs.cs_name^".cmt"] :: acc
else else
acc acc
in in
@ -2499,13 +2514,13 @@ module OASISFindlib = struct
in in
let library_name_of_findlib_name = let library_name_of_findlib_name =
Lazy.lazy_from_fun lazy begin
(fun () ->
(* Revert findlib_name_of_library_name. *) (* Revert findlib_name_of_library_name. *)
MapString.fold MapString.fold
(fun k v mp -> MapString.add v k mp) (fun k v mp -> MapString.add v k mp)
fndlb_name_of_lib_name fndlb_name_of_lib_name
MapString.empty) MapString.empty
end
in in
let library_name_of_findlib_name fndlb_nm = let library_name_of_findlib_name fndlb_nm =
try try
@ -2875,7 +2890,7 @@ module OASISFileUtil = struct
end end
# 2878 "setup.ml" # 2893 "setup.ml"
module BaseEnvLight = struct module BaseEnvLight = struct
(* # 22 "src/base/BaseEnvLight.ml" *) (* # 22 "src/base/BaseEnvLight.ml" *)
@ -2980,7 +2995,7 @@ module BaseEnvLight = struct
end end
# 2983 "setup.ml" # 2998 "setup.ml"
module BaseContext = struct module BaseContext = struct
(* # 22 "src/base/BaseContext.ml" *) (* # 22 "src/base/BaseContext.ml" *)
@ -5391,7 +5406,7 @@ module BaseSetup = struct
end end
# 5394 "setup.ml" # 5409 "setup.ml"
module InternalConfigurePlugin = struct module InternalConfigurePlugin = struct
(* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *) (* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *)
@ -5827,6 +5842,17 @@ module InternalInstallPlugin = struct
lst lst
in in
let make_fnames modul sufx =
List.fold_right
begin fun sufx accu ->
(String.capitalize modul ^ sufx) ::
(String.uncapitalize modul ^ sufx) ::
accu
end
sufx
[]
in
(** Install all libraries *) (** Install all libraries *)
let install_libs pkg = let install_libs pkg =
@ -5847,27 +5873,29 @@ module InternalInstallPlugin = struct
OASISHostPath.of_unix bs.bs_path OASISHostPath.of_unix bs.bs_path
in in
List.fold_left List.fold_left
(fun acc modul -> begin fun acc modul ->
begin
try try
List.find [List.find
OASISFileUtil.file_exists_case OASISFileUtil.file_exists_case
(List.map (List.map
(Filename.concat path) (Filename.concat path)
[modul^".mli"; (make_fnames modul [".mli"; ".ml"]))]
modul^".ml";
String.uncapitalize modul^".mli";
String.capitalize modul^".mli";
String.uncapitalize modul^".ml";
String.capitalize modul^".ml"])
:: acc
with Not_found -> with Not_found ->
begin
warning warning
(f_ "Cannot find source header for module %s \ (f_ "Cannot find source header for module %s \
in library %s") in library %s")
modul cs.cs_name; modul cs.cs_name;
acc []
end) end
@
List.filter
OASISFileUtil.file_exists_case
(List.map
(Filename.concat path)
(make_fnames modul [".annot";".cmti";".cmt"]))
@ acc
end
acc acc
lib.lib_modules lib.lib_modules
in in
@ -5915,27 +5943,29 @@ module InternalInstallPlugin = struct
OASISHostPath.of_unix bs.bs_path OASISHostPath.of_unix bs.bs_path
in in
List.fold_left List.fold_left
(fun acc modul -> begin fun acc modul ->
begin
try try
List.find [List.find
OASISFileUtil.file_exists_case OASISFileUtil.file_exists_case
(List.map (List.map
(Filename.concat path) (Filename.concat path)
[modul^".mli"; (make_fnames modul [".mli"; ".ml"]))]
modul^".ml";
String.uncapitalize modul^".mli";
String.capitalize modul^".mli";
String.uncapitalize modul^".ml";
String.capitalize modul^".ml"])
:: acc
with Not_found -> with Not_found ->
begin
warning warning
(f_ "Cannot find source header for module %s \ (f_ "Cannot find source header for module %s \
in object %s") in object %s")
modul cs.cs_name; modul cs.cs_name;
acc []
end) end
@
List.filter
OASISFileUtil.file_exists_case
(List.map
(Filename.concat path)
(make_fnames modul [".annot";".cmti";".cmt"]))
@ acc
end
acc acc
obj.obj_modules obj.obj_modules
in in
@ -6240,7 +6270,7 @@ module InternalInstallPlugin = struct
end end
# 6243 "setup.ml" # 6273 "setup.ml"
module OCamlbuildCommon = struct module OCamlbuildCommon = struct
(* # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *) (* # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *)
@ -6298,6 +6328,11 @@ module OCamlbuildCommon = struct
else else
[]; [];
if bool_of_string (tests ()) then
["-tag"; "tests"]
else
[];
if bool_of_string (profile ()) then if bool_of_string (profile ()) then
["-tag"; "profile"] ["-tag"; "profile"]
else else
@ -6613,7 +6648,7 @@ module OCamlbuildDocPlugin = struct
end end
# 6616 "setup.ml" # 6651 "setup.ml"
module CustomPlugin = struct module CustomPlugin = struct
(* # 22 "src/plugins/custom/CustomPlugin.ml" *) (* # 22 "src/plugins/custom/CustomPlugin.ml" *)
@ -6761,7 +6796,7 @@ module CustomPlugin = struct
end end
# 6764 "setup.ml" # 6799 "setup.ml"
open OASISTypes;; open OASISTypes;;
let setup_t = let setup_t =
@ -6826,7 +6861,7 @@ let setup_t =
alpha_features = []; alpha_features = [];
beta_features = []; beta_features = [];
name = "sequence"; name = "sequence";
version = "0.5.3"; version = "0.5.4";
license = license =
OASISLicense.DEP5License OASISLicense.DEP5License
(OASISLicense.DEP5Unit (OASISLicense.DEP5Unit
@ -6906,6 +6941,17 @@ let setup_t =
Some "build sequence.invert (requires Delimcc)"; Some "build sequence.invert (requires Delimcc)";
flag_default = [(OASISExpr.EBool true, false)] flag_default = [(OASISExpr.EBool true, false)]
}); });
Flag
({
cs_name = "bigarray";
cs_data = PropList.Data.create ();
cs_plugin_data = []
},
{
flag_description =
Some "build sequence.bigarray (requires bigarray)";
flag_default = [(OASISExpr.EBool true, true)]
});
Library Library
({ ({
cs_name = "sequence"; cs_name = "sequence";
@ -6917,7 +6963,7 @@ let setup_t =
bs_install = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)];
bs_path = "."; bs_path = ".";
bs_compiled_object = Best; bs_compiled_object = Best;
bs_build_depends = []; bs_build_depends = [FindlibPackage ("bytes", None)];
bs_build_tools = [ExternalTool "ocamlbuild"]; bs_build_tools = [ExternalTool "ocamlbuild"];
bs_c_sources = []; bs_c_sources = [];
bs_data_files = []; bs_data_files = [];
@ -6978,6 +7024,48 @@ let setup_t =
lib_findlib_name = Some "invert"; lib_findlib_name = Some "invert";
lib_findlib_containers = [] lib_findlib_containers = []
}); });
Library
({
cs_name = "bigarray";
cs_data = PropList.Data.create ();
cs_plugin_data = []
},
{
bs_build =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "bigarray", true)
];
bs_install =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "bigarray", true)
];
bs_path = "bigarray";
bs_compiled_object = Best;
bs_build_depends =
[
InternalLibrary "sequence";
FindlibPackage ("bigarray", None)
];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_c_sources = [];
bs_data_files = [];
bs_ccopt = [(OASISExpr.EBool true, [])];
bs_cclib = [(OASISExpr.EBool true, [])];
bs_dlllib = [(OASISExpr.EBool true, [])];
bs_dllpath = [(OASISExpr.EBool true, [])];
bs_byteopt = [(OASISExpr.EBool true, [])];
bs_nativeopt = [(OASISExpr.EBool true, [])]
},
{
lib_modules = ["SequenceBigarray"];
lib_pack = false;
lib_internal_modules = [];
lib_findlib_parent = Some "sequence";
lib_findlib_name = Some "bigarray";
lib_findlib_containers = []
});
Doc Doc
({ ({
cs_name = "sequence"; cs_name = "sequence";
@ -7191,8 +7279,8 @@ let setup_t =
plugin_data = [] plugin_data = []
}; };
oasis_fn = Some "_oasis"; oasis_fn = Some "_oasis";
oasis_version = "0.4.4"; oasis_version = "0.4.5";
oasis_digest = Some "\214\tqh\b\169>\243\237\213\012\180\162\155`L"; oasis_digest = Some "\143pX\233\t\217\232\\d\023B\027\020*\019W";
oasis_exec = None; oasis_exec = None;
oasis_setup_args = []; oasis_setup_args = [];
setup_update = false setup_update = false
@ -7200,6 +7288,6 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;; let setup () = BaseSetup.setup setup_t;;
# 7204 "setup.ml" # 7292 "setup.ml"
(* OASIS_STOP *) (* OASIS_STOP *)
let () = setup ();; let () = setup ();;