summaryrefslogtreecommitdiff
path: root/ocamlbuild
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2010-01-22 12:48:24 +0000
committerDamien Doligez <damien.doligez-inria.fr>2010-01-22 12:48:24 +0000
commit04b1656222698bd7e92f213e9a718b7a4185643a (patch)
tree6186d1ba1e00adb1232908f95cb92c299902a943 /ocamlbuild
parentbdc0fadee2dc9669818955486b4c3497016edda5 (diff)
downloadocaml-04b1656222698bd7e92f213e9a718b7a4185643a.tar.gz
clean up spaces and tabs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamlbuild')
-rw-r--r--ocamlbuild/command.mli1
-rw-r--r--ocamlbuild/display.ml4
-rw-r--r--ocamlbuild/glob.ml2
-rw-r--r--ocamlbuild/glob_lexer.mll6
-rw-r--r--ocamlbuild/hygiene.ml2
-rw-r--r--ocamlbuild/man/ocamlbuild.12
-rw-r--r--ocamlbuild/manual/manual.tex54
-rw-r--r--ocamlbuild/misc/opentracer.ml2
-rw-r--r--ocamlbuild/my_std.ml6
-rw-r--r--ocamlbuild/my_unix.ml5
-rw-r--r--ocamlbuild/ocaml_dependencies.ml2
-rw-r--r--ocamlbuild/ocaml_tools.ml4
-rw-r--r--ocamlbuild/ocaml_utils.ml2
-rw-r--r--ocamlbuild/ocaml_utils.mli1
-rw-r--r--ocamlbuild/ocamlbuild.mli1
-rw-r--r--ocamlbuild/ocamlbuild_executor.ml8
-rw-r--r--ocamlbuild/options.ml4
-rw-r--r--ocamlbuild/pathname.ml1
-rw-r--r--ocamlbuild/resource.ml68
-rw-r--r--ocamlbuild/rule.ml1
-rw-r--r--ocamlbuild/signatures.mli8
-rw-r--r--ocamlbuild/slurp.ml2
-rw-r--r--ocamlbuild/tools.ml3
23 files changed, 91 insertions, 98 deletions
diff --git a/ocamlbuild/command.mli b/ocamlbuild/command.mli
index 48e7fdc277..337762ba80 100644
--- a/ocamlbuild/command.mli
+++ b/ocamlbuild/command.mli
@@ -42,4 +42,3 @@ val deps_of_tags : Tags.t -> pathname list
(** [dep tags deps] Will build [deps] when [tags] will be activated. *)
val dep : Tags.elt list -> pathname list -> unit
-
diff --git a/ocamlbuild/display.ml b/ocamlbuild/display.ml
index 8178afece1..2385a58f70 100644
--- a/ocamlbuild/display.ml
+++ b/ocamlbuild/display.ml
@@ -140,7 +140,7 @@ let create
ds_last_cached = false;
ds_changed = false;
ds_update_interval = default_update_interval;
- ds_columns = n;
+ ds_columns = n;
ds_jobs = 0;
ds_jobs_cached = 0;
ds_tagline = create_tagline description;
@@ -196,7 +196,7 @@ HH MM SS XXXX PATHNAME
| | \ number of jobs cached
| \ number of jobs
\ elapsed time
-cmo mllib
+cmo mllib
***)
(*** redraw_sophisticated *)
let redraw_sophisticated ds =
diff --git a/ocamlbuild/glob.ml b/ocamlbuild/glob.ml
index 6ecffedc4f..7cb6127feb 100644
--- a/ocamlbuild/glob.ml
+++ b/ocamlbuild/glob.ml
@@ -149,7 +149,7 @@ module NFA =
else
q' :: future'
end
- graph.(q)
+ graph.(q)
future
in
transitive past' future'
diff --git a/ocamlbuild/glob_lexer.mll b/ocamlbuild/glob_lexer.mll
index 99c30168d4..05d199d6f1 100644
--- a/ocamlbuild/glob_lexer.mll
+++ b/ocamlbuild/glob_lexer.mll
@@ -60,7 +60,7 @@ rule token = parse
and parse_pattern eof_chars p = parse
| (pattern_chars+ as u) { parse_pattern eof_chars (concat_patterns p (Word u)) lexbuf }
-| '{'
+| '{'
{
let rec loop pl =
let (p',c) = parse_pattern ['}';','] Epsilon lexbuf in
@@ -77,7 +77,7 @@ and parse_pattern eof_chars p = parse
let cl = Not(Or(parse_class [] lexbuf)) in
parse_pattern eof_chars (concat_patterns p (Class cl)) lexbuf
}
-| '['
+| '['
{
let cl = Or(parse_class [] lexbuf) in
parse_pattern eof_chars (concat_patterns p (Class cl)) lexbuf
@@ -97,7 +97,7 @@ and parse_pattern eof_chars p = parse
| '/' { parse_pattern eof_chars (concat_patterns p slash) lexbuf }
| '?' { parse_pattern eof_chars (concat_patterns p not_slash) lexbuf }
| _ as c
- { if List.mem c eof_chars then
+ { if List.mem c eof_chars then
(p,c)
else
raise (Parse_error(sf "Unexpected character %C in glob pattern" c))
diff --git a/ocamlbuild/hygiene.ml b/ocamlbuild/hygiene.ml
index f6101e915c..e904afb44d 100644
--- a/ocamlbuild/hygiene.ml
+++ b/ocamlbuild/hygiene.ml
@@ -148,7 +148,7 @@ let check ?sanitize laws entry =
@ A@ script@ shell@ file@ %S@ is@ being@ created.\
@ Check@ this@ script@ and@ run@ it@ to@ remove@ unwanted@ files\
@ or@ use@ other@ options@ (such@ as@ defining@ hygiene@ exceptions\
- @ or@ using@ the@ -no-hygiene@ option).@]"
+ @ or@ using@ the@ -no-hygiene@ option).@]"
m (if m = 1 then "" else "s") fn;
let oc = open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_text] 0o755 fn in
let fp = Printf.fprintf in
diff --git a/ocamlbuild/man/ocamlbuild.1 b/ocamlbuild/man/ocamlbuild.1
index 9077fdf00b..58a33740b7 100644
--- a/ocamlbuild/man/ocamlbuild.1
+++ b/ocamlbuild/man/ocamlbuild.1
@@ -91,7 +91,7 @@ HTML documentation generated with
.SH OPTIONS
-The following command-line options are recognized by
+The following command-line options are recognized by
.BR ocamlbuild (1).
.TP
diff --git a/ocamlbuild/manual/manual.tex b/ocamlbuild/manual/manual.tex
index 1827e336ae..62d900450f 100644
--- a/ocamlbuild/manual/manual.tex
+++ b/ocamlbuild/manual/manual.tex
@@ -40,7 +40,7 @@ libraries, package (-pack) debugging and profiling flags, C stubs.
OCaml itself.
\item Automatic inference of dependencies.
\item Correct handling of dynamically discovered dependencies.
-\item Object files and other temporary files are created in a specific directory, leaving your main directory uncluttered.
+\item Object files and other temporary files are created in a specific directory, leaving your main directory uncluttered.
\item Sanity checks ensure that object files are where they are supposed to be: in the build directory.
\item Regular projects are built using a single command with no extra files.
\item Parallel compilation to speed up things on multi-core systems.
@@ -109,7 +109,7 @@ complex projects with arbitrary dependencies and actions.
Your code is in the \texttt{\_build} directory, but \ocb automatically creates
a symbolic link to the executables it produces in the current directory.
\ocb copies the source files and compiles them in a separate directory
-which is \texttt{\_build} by default.
+which is \texttt{\_build} by default.
For \ocb, any file that is not in the build directory is a source file.
It is not unreasonable to think that some users may have bought binary object files
@@ -143,7 +143,7 @@ by \ocb to denote native code executables.
\begin{verbatim}
% ls
hello.ml
-% ocamlbuild hello.native
+% ocamlbuild hello.native
Finished, 4 targets (0 cached) in 00:00:00.
% ls -l
total 12
@@ -156,7 +156,7 @@ of compiling. You usually won't have to look very often into this directory. S
into \texttt{\_build} and this is where the compilers will be run. Various cache files are also stored
there. Its contents may look like this:
\begin{verbatim}
-% ls -l _build
+% ls -l _build
total 208
-rw-rw---- 1 linus gallium 337 2007-01-17 16:24 _digests
-rw-rw---- 1 linus gallium 191 2007-01-17 16:24 hello.cmi
@@ -179,7 +179,7 @@ ocamlbuild hello.native -- Caesar
and it will compile and then run \texttt{hello.native} with the arguments following \texttt{-{}-},
which should display:
\begin{verbatim}
-% ocamlbuild hello.native -- Caesar
+% ocamlbuild hello.native -- Caesar
Finished, 4 targets (0 cached) in 00:00:00.
Hello, Caesar ! My name is _build/hello.native
\end{verbatim}
@@ -514,7 +514,7 @@ $\texttt{-}$ and $\texttt{.}$. This is called the pathname alphabet $P$.
%***)
%(*** Subdirectories
\subsection{Subdirectories}
-If the files of your project are held in one or more subdirectories,
+If the files of your project are held in one or more subdirectories,
\ocb must be made aware of that fact using the \texttt{-I} or \texttt{-Is} options
or by adding an \texttt{include} tag. For instance, assume your project is made
of three subdirectories, \texttt{foo}, \texttt{bar} and \texttt{baz} containing
@@ -610,7 +610,7 @@ library. Just write a file with the \texttt{mltop} extension (like
You can specify preprocessor options with \texttt{-pp} followed by the
preprocessor string, for instance \texttt{ocamlbuild -pp "camlp4o.opt -unsafe"}
would run your sources thru CamlP4 with the \texttt{-unsafe} option.
-Another way is to use the tags file.
+Another way is to use the tags file.
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
@@ -631,47 +631,47 @@ Another way is to use the tags file.
\end{tabular}
\end{center}
-%%%%% \subsubsection{An example, dealing with some configuration variables}
-%%%%%
+%%%%% \subsubsection{An example, dealing with some configuration variables}
+%%%%%
%%%%% It's quite common to have in your sources some files that you want to access
%%%%% when your program is running. One often uses some variables that are setup by
%%%%% the end user. Now suppose that there is only two files that use these variables
%%%%% (mylib.ml and parseopt.ml).
-%%%%%
+%%%%%
%%%%% In the \tags file:
%%%%% \begin{verbatim}
%%%%% "mylib.ml" or "parseopt.ml": pp(sed -e "s,LIBDIR,/usr/local/lib/FOO,g")
%%%%% \end{verbatim}
-%%%%%
+%%%%%
%%%%% In fact that solution is not really acceptable, since the variable is hardcoded
%%%%% in the \tags file. Trying to workaround this issue by using some shell variable
%%%%% does not work either since the -pp argument will be escaped in simple quotes.
%%%%% Note also that using some script shell that will do that sed and use \verb'$LIBDIR'
%%%%% as a shell variable is not a good idea since \ocb don't know this dependency on that
%%%%% shell script.
-%%%%%
+%%%%%
%%%%% There is in fact at least two good solutions. The first is to tell that dependency
%%%%% using the \texttt{dep} function in your plugin. The second is simpler it just consist
%%%%% on generating some OCaml file at configure time. By naming this configuration file
%%%%% \texttt{myocamlbuild_config.ml} \ocb will make it also available to your plugin.
-%%%%%
+%%%%%
%%%%% In your \texttt{myocamlbuild_config.mli} interface:
%%%%% \begin{verbotim}
%%%%% val prefix : string
%%%%% val libdir : string
%%%%% \end{verbotim}
-%%%%%
-%%%%% And in your \texttt{configure} script
+%%%%%
+%%%%% And in your \texttt{configure} script
%%%%% \begin{verbatim}
%%%%% #!/bin/sh
-%%%%%
+%%%%%
%%%%% # Setting defaults values
%%%%% PREFIX=/usr/local
%%%%% LIBDIR=$PREFIX/lib/FOO
%%%%% CONF=myocamlbuild_config.ml
-%%%%%
+%%%%%
%%%%% # ... some shell to parse option and check configuration ...
-%%%%%
+%%%%%
%%%%% # Dumping the configuration as an OCaml file.
%%%%% rm -f $CONF
%%%%% echo "let prefix = \"$PREFIX\";;" >> $CONF
@@ -751,21 +751,21 @@ the tags \texttt{ocaml}, \texttt{native}, \texttt{byte}, \texttt{program},
\textbf{Tag} & \textbf{Display character} \\
\hline
\hline
- ocaml & O \\
+ ocaml & O \\
\hline
- native & N \\
+ native & N \\
\hline
- byte & B \\
+ byte & B \\
\hline
- program & P \\
+ program & P \\
\hline
- pp & R \\
+ pp & R \\
\hline
- debug & D \\
+ debug & D \\
\hline
- interf & I \\
+ interf & I \\
\hline
- link & L \\
+ link & L \\
\hline
\end{tabular}
\end{center}
@@ -837,7 +837,7 @@ The second one is as a dispatcher for various actions defined using
phony targets with shell script actions. These actions include cleaning,
cleaning really well, archiving, uploading and so on. Their characteristic
is that they rely little or not on the building process -- they either need
-the building to have been completed, or they don't need anything.
+the building to have been completed, or they don't need anything.
As \texttt{/bin/sh} scripts have been here for three to four decades and are
not going anywhere, why not replace that functionality of makefiles with a
shell script ? We have thought of three bad reasons:
diff --git a/ocamlbuild/misc/opentracer.ml b/ocamlbuild/misc/opentracer.ml
index b011f1540b..38a13502bd 100644
--- a/ocamlbuild/misc/opentracer.ml
+++ b/ocamlbuild/misc/opentracer.ml
@@ -60,7 +60,7 @@ module Driver (T : TRACER) = struct
let main () =
let log = "opentracer.log" in
let oc =
- if sys_file_exists log then
+ if sys_file_exists log then
open_out_gen [Open_wronly;Open_append;Open_text] 0 log
else
let oc = open_out log in
diff --git a/ocamlbuild/my_std.ml b/ocamlbuild/my_std.ml
index b5abd1186c..78286b53c8 100644
--- a/ocamlbuild/my_std.ml
+++ b/ocamlbuild/my_std.ml
@@ -35,7 +35,7 @@ module Outcome = struct
| Bad exn -> raise exn
let wrap f x =
- try Good (f x) with e -> Bad e
+ try Good (f x) with e -> Bad e
end
@@ -137,7 +137,7 @@ module String = struct
let before s pos = sub s 0 pos
let after s pos = sub s pos (length s - pos)
- let first_chars s n = sub s 0 n
+ let first_chars s n = sub s 0 n
let last_chars s n = sub s (length s - n) n
let rec eq_sub_strings s1 p1 s2 p2 len =
@@ -260,7 +260,7 @@ let filename_concat x y =
if x.[String.length x - 1] = '/' then
if y = "" then x
else x ^ y
- else x ^ "/" ^ y
+ else x ^ "/" ^ y
(* let reslash =
match Sys.os_type with
diff --git a/ocamlbuild/my_unix.ml b/ocamlbuild/my_unix.ml
index 306031a270..a54f05bf23 100644
--- a/ocamlbuild/my_unix.ml
+++ b/ocamlbuild/my_unix.ml
@@ -93,7 +93,7 @@ and is_link x =
and lstat x =
if is_link x then { stat_key = x; stat_file_kind = FK_link } else stat x
-
+
let implem =
{
is_degraded = true;
@@ -134,7 +134,6 @@ let run_and_read cmd =
if len > 0 then begin
Buffer.add_substring totalbuf buf 0 len;
loop (pos + len)
- end
+ end
in loop 0; Buffer.contents totalbuf
end
-
diff --git a/ocamlbuild/ocaml_dependencies.ml b/ocamlbuild/ocaml_dependencies.ml
index 666b1842b9..c6c8efeb93 100644
--- a/ocamlbuild/ocaml_dependencies.ml
+++ b/ocamlbuild/ocaml_dependencies.ml
@@ -211,7 +211,7 @@ module Make (I : INPUT) = struct
end (dependencies_of fn);
needed := fn :: !needed
end
- in
+ in
List.iter aux fns;
mydprintf "caml_transitive_closure:@ %a ->@ %a" pp_l fns pp_l !needed;
List.rev !needed
diff --git a/ocamlbuild/ocaml_tools.ml b/ocamlbuild/ocaml_tools.ml
index 74a27a87b5..1791992182 100644
--- a/ocamlbuild/ocaml_tools.ml
+++ b/ocamlbuild/ocaml_tools.ml
@@ -28,8 +28,8 @@ let ocamldep_command' tags spec =
let menhir_ocamldep_command' tags ~menhir_spec ~ocamldep_spec out =
let menhir = if !Options.ocamlyacc = N then V"MENHIR" else !Options.ocamlyacc in
Cmd(S[menhir; T tags; A"--raw-depend";
- A"--ocamldep"; Quote (ocamldep_command' tags ocamldep_spec);
- menhir_spec ; Sh ">"; Px out])
+ A"--ocamldep"; Quote (ocamldep_command' tags ocamldep_spec);
+ menhir_spec ; Sh ">"; Px out])
let menhir_ocamldep_command arg out env _build =
let arg = env arg and out = env out in
diff --git a/ocamlbuild/ocaml_utils.ml b/ocamlbuild/ocaml_utils.ml
index bbfe60e315..449328ce66 100644
--- a/ocamlbuild/ocaml_utils.ml
+++ b/ocamlbuild/ocaml_utils.ml
@@ -144,7 +144,7 @@ let read_path_dependencies =
let deps =
List.fold_right begin fun (path, deps) acc ->
let module_name' = module_name_of_pathname path in
- if module_name' = module_name
+ if module_name' = module_name
then List.union deps acc
else raise (Ocamldep_error(Printf.sprintf "Ocamldep.ocamldep: multiple files in ocamldep output (%s not expected)" path))
end ocamldep_output [] in
diff --git a/ocamlbuild/ocaml_utils.mli b/ocamlbuild/ocaml_utils.mli
index 09329bdd3c..660e27b9b3 100644
--- a/ocamlbuild/ocaml_utils.mli
+++ b/ocamlbuild/ocaml_utils.mli
@@ -41,4 +41,3 @@ val ocaml_lib :
?dir:Pathname.t ->
?tag_name:string ->
Pathname.t -> unit
-
diff --git a/ocamlbuild/ocamlbuild.mli b/ocamlbuild/ocamlbuild.mli
index 3f466934e1..7e5aa0bf45 100644
--- a/ocamlbuild/ocamlbuild.mli
+++ b/ocamlbuild/ocamlbuild.mli
@@ -12,4 +12,3 @@
(* Original author: Nicolas Pouillard *)
(** Nothing to export for now *)
-
diff --git a/ocamlbuild/ocamlbuild_executor.ml b/ocamlbuild/ocamlbuild_executor.ml
index 587f4210e5..9798e052dd 100644
--- a/ocamlbuild/ocamlbuild_executor.ml
+++ b/ocamlbuild/ocamlbuild_executor.ml
@@ -95,7 +95,7 @@ let execute
let jobs_to_terminate = Queue.create () in
let commands_to_execute = Queue.create () in
let all_ok = ref true in
- let results =
+ let results =
List.map (fun tasks ->
let result = ref false in
Queue.add (tasks, result) commands_to_execute;
@@ -174,7 +174,7 @@ let execute
if not job.job_dying then
begin
job.job_dying <- true;
- Queue.add (job, continue) jobs_to_terminate
+ Queue.add (job, continue) jobs_to_terminate
end
else
()
@@ -203,7 +203,7 @@ let execute
| Unix.Unix_error(_,_,_) -> 0
in
if m = 0 then
- if job.job_dying then
+ if job.job_dying then
()
else
terminate job
@@ -321,7 +321,7 @@ let execute
begin fun _ _job ->
(*display (fun oc -> fp oc "Exceptional condition on command %S\n%!" job.job_command);
exit Exceptional_condition*)
- () (* FIXME *)
+ () (* FIXME *)
end];
loop ()
end
diff --git a/ocamlbuild/options.ml b/ocamlbuild/options.ml
index 11839c61fd..2d095b1608 100644
--- a/ocamlbuild/options.ml
+++ b/ocamlbuild/options.ml
@@ -132,8 +132,8 @@ let spec =
"-documentation", Set show_documentation, " Show rules and flags";
"-log", Set_string log_file_internal, "<file> Set log file";
"-no-log", Unit (fun () -> log_file_internal := ""), " No log file";
- "-clean", Set must_clean, " Remove build directory and other files, then exit";
- "-r", Set recursive, " Traverse directories by default (true: traverse)";
+ "-clean", Set must_clean, " Remove build directory and other files, then exit";
+ "-r", Set recursive, " Traverse directories by default (true: traverse)";
"-I", String (add_to' my_include_dirs), "<path> Add to include directories";
"-Is", String (add_to my_include_dirs), "<path,...> (same as above, but accepts a (comma or blank)-separated list)";
diff --git a/ocamlbuild/pathname.ml b/ocamlbuild/pathname.ml
index 7ec8f24cf3..d535488d61 100644
--- a/ocamlbuild/pathname.ml
+++ b/ocamlbuild/pathname.ml
@@ -156,4 +156,3 @@ let define_context dir context =
Hashtbl.replace context_table dir& List.union context& include_dirs_of dir
let same_contents x y = Digest.file x = Digest.file y
-
diff --git a/ocamlbuild/resource.ml b/ocamlbuild/resource.ml
index e0bb74ba80..ed90d1cff6 100644
--- a/ocamlbuild/resource.ml
+++ b/ocamlbuild/resource.ml
@@ -292,41 +292,41 @@ let import x = Pathname.normalize x
module MetaPath : sig
type t
- type env
+ type env
val mk : (bool * string) -> t
- val matchit : t -> string -> env option
- val subst : env -> t -> string
- val print_env : Format.formatter -> env -> unit
+ val matchit : t -> string -> env option
+ val subst : env -> t -> string
+ val print_env : Format.formatter -> env -> unit
end = struct
open Glob_ast
- type atoms = A of string | V of string * Glob.globber
- type t = atoms list
- type env = (string * string) list
+ type atoms = A of string | V of string * Glob.globber
+ type t = atoms list
+ type env = (string * string) list
- exception No_solution
+ exception No_solution
- let mk (pattern_allowed, s) = List.map begin function
+ let mk (pattern_allowed, s) = List.map begin function
| `Var(var_name, globber) -> V(var_name, globber)
| `Word s -> A s
end (Lexers.path_scheme pattern_allowed (Lexing.from_string s))
let mk = memo mk
- let match_prefix s pos prefix =
- match String.contains_string s pos prefix with
- | Some(pos') -> if pos = pos' then pos' + String.length prefix else raise No_solution
- | None -> raise No_solution
-
- let matchit p s =
- let sl = String.length s in
- let rec loop xs pos acc delta =
- match xs with
- | [] -> if pos = sl then acc else raise No_solution
- | A prefix :: xs -> loop xs (match_prefix s pos prefix) acc 0
- | V(var, patt) :: A s2 :: xs' ->
+ let match_prefix s pos prefix =
+ match String.contains_string s pos prefix with
+ | Some(pos') -> if pos = pos' then pos' + String.length prefix else raise No_solution
+ | None -> raise No_solution
+
+ let matchit p s =
+ let sl = String.length s in
+ let rec loop xs pos acc delta =
+ match xs with
+ | [] -> if pos = sl then acc else raise No_solution
+ | A prefix :: xs -> loop xs (match_prefix s pos prefix) acc 0
+ | V(var, patt) :: A s2 :: xs' ->
begin match String.contains_string s (pos + delta) s2 with
| Some(pos') ->
let matched = String.sub s pos (pos' - pos) in
@@ -337,13 +337,13 @@ end = struct
else loop xs pos acc (pos' - pos + 1)
| None -> raise No_solution
end
- | [V(var, patt)] ->
+ | [V(var, patt)] ->
let matched = String.sub s pos (sl - pos) in
if Glob.eval patt matched then (var, matched) :: acc else raise No_solution
- | V _ :: _ -> assert false
- in
- try Some (loop p 0 [] 0)
- with No_solution -> None
+ | V _ :: _ -> assert false
+ in
+ try Some (loop p 0 [] 0)
+ with No_solution -> None
let pp_opt pp_elt f =
function
@@ -371,14 +371,14 @@ end = struct
exit 42
end;; *)
- let subst env s =
- String.concat "" begin
- List.map begin fun x ->
- match x with
- | A atom -> atom
- | V(var, _) -> List.assoc var env
- end s
- end
+ let subst env s =
+ String.concat "" begin
+ List.map begin fun x ->
+ match x with
+ | A atom -> atom
+ | V(var, _) -> List.assoc var env
+ end s
+ end
end
type env = MetaPath.env
diff --git a/ocamlbuild/rule.ml b/ocamlbuild/rule.ml
index ac0f0c8bda..8352f6ae53 100644
--- a/ocamlbuild/rule.ml
+++ b/ocamlbuild/rule.ml
@@ -306,4 +306,3 @@ let copy_rule name ?insert src dest =
Shell.mkdir_p (Pathname.dirname dest);
cp_p src dest
end
-
diff --git a/ocamlbuild/signatures.mli b/ocamlbuild/signatures.mli
index 40923b699c..cddc0f5887 100644
--- a/ocamlbuild/signatures.mli
+++ b/ocamlbuild/signatures.mli
@@ -251,7 +251,7 @@ module type GLOB = sig
A basic expression can be a constant string enclosed in double quotes, in which
double quotes must be preceded by backslashes, or a glob pattern enclosed between a [<] and a [>],
- ["]{i string}["] matches the literal string {i string},
- - [<]{i glob}[>] matches the glob pattern {i glob}.
+ - [<]{i glob}[>] matches the glob pattern {i glob}.
A glob pattern is an anchored regular expression in a shell-like syntax. Most characters stand for themselves.
Character ranges are given in usual shell syntax between brackets. The star [*] stands for any sequence of
@@ -540,7 +540,7 @@ module type PLUGIN = sig
val flag_and_dep : Tags.elt list -> Command.spec -> unit
(** [non_dependency module_path module_name]
- Example:
+ Example:
[non_dependency "foo/bar/baz" "Goo"]
Says that the module [Baz] in the file [foo/bar/baz.*] does not depend on [Goo]. *)
val non_dependency : Pathname.t -> string -> unit
@@ -556,7 +556,7 @@ module type PLUGIN = sig
At link time it will include:
foo/bar.cma or foo/bar.cmxa
If you supply the ~dir:"boo" option -I boo
- will be added at link and compile time.
+ will be added at link and compile time.
Use ~extern:true for non-ocamlbuild handled libraries.
Use ~byte:false or ~native:false to disable byte or native mode.
Use ~tag_name:"usebar" to override the default tag name. *)
@@ -627,7 +627,7 @@ module type PLUGIN = sig
(** Here is the list of hooks that the dispatch function have to handle.
Generally one respond to one or two hooks (like After_rules) and do
nothing in the default case. *)
- type hook =
+ type hook =
| Before_hygiene
| After_hygiene
| Before_options
diff --git a/ocamlbuild/slurp.ml b/ocamlbuild/slurp.ml
index 896628db17..ac653c85a7 100644
--- a/ocamlbuild/slurp.ml
+++ b/ocamlbuild/slurp.ml
@@ -42,7 +42,7 @@ let real_slurp path =
let abs x = if Filename.is_implicit x || Filename.is_relative x then cwd/x else x in
let visited = Hashtbl.create 1024 in
let rec scandir path names =
- let (file_acc, dir_acc) =
+ let (file_acc, dir_acc) =
Array.fold_left begin fun ((file_acc, dir_acc) as acc) name ->
match do_entry true path name with
| None -> acc
diff --git a/ocamlbuild/tools.ml b/ocamlbuild/tools.ml
index 587c2c7595..69a011b542 100644
--- a/ocamlbuild/tools.ml
+++ b/ocamlbuild/tools.ml
@@ -25,7 +25,7 @@ let pp_l = List.print String.print
let tags_of_pathname p =
Configuration.tags_of_filename (Pathname.to_string p)
++("file:"^p)
- ++("extension:"^Pathname.get_extension p)
+ ++("extension:"^Pathname.get_extension p)
let flags_of_pathname p = Configuration.flags_of_filename (Pathname.to_string p)
let opt_print elt ppf =
@@ -44,4 +44,3 @@ let path_and_context_of_string s =
let include_dirs = Pathname.include_dirs_of d in
List.map (fun include_dir -> include_dir/b) include_dirs
else [s]
-