Implem of Build.progn
This commit is contained in:
parent
9013a836f0
commit
ba80202747
29
src/build.ml
29
src/build.ml
|
@ -190,3 +190,32 @@ let and_create_file fn =
|
||||||
{ action with
|
{ action with
|
||||||
action = Progn [action.action; Create_file fn]
|
action = Progn [action.action; Create_file fn]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(*
|
||||||
|
{[
|
||||||
|
let progn ts =
|
||||||
|
all ts >>^ fun (actions : Action.t list) ->
|
||||||
|
match actions with
|
||||||
|
| [] ->
|
||||||
|
{ Action.
|
||||||
|
context = None
|
||||||
|
; dir = Path.root
|
||||||
|
; action = Progn []
|
||||||
|
}
|
||||||
|
| first :: rest ->
|
||||||
|
let rest =
|
||||||
|
List.map rest ~f:(fun a ->
|
||||||
|
(match first.context, a.context with
|
||||||
|
| None, None -> ()
|
||||||
|
| Some c1, Some c2 when c1.name = c2.name -> ()
|
||||||
|
| _ ->
|
||||||
|
Sexp.code_error "Build.progn"
|
||||||
|
[ "actions", Sexp.To_sexp.list Action.sexp_of_t actions ]);
|
||||||
|
if first.dir = a.dir then
|
||||||
|
a.action
|
||||||
|
else
|
||||||
|
Chdir (a.dir, a.action))
|
||||||
|
in
|
||||||
|
{ first with action = Progn (first :: rest) }
|
||||||
|
]}
|
||||||
|
*)
|
||||||
|
|
Loading…
Reference in New Issue