module Bone:sig..end
typeid =Fpath.t
val find : Carcass.Env.t -> id -> Fpath.t optionfind env id finds the full path to the bone identified by id
in environment env. If id is OS.File.dash or an absolute path or
starts with ./ and the path exists, Some id is returned.val list : ?hidden:bool -> Carcass.Env.t -> Fpath.t Fpath.maplist ~hidden env maps bone identifiers found in the environment env
to their path. If hidden is true hidden bones (those whose
last segment start with a '_') are also in the map (defaults to
false).type content =
| |
Binary of |
(* |
Binary bone.
| *) |
| |
Pat of |
(* |
Textual bone.
| *) |
type t
val id : t -> idid b is the bone's id.val content : t -> contentcontent b is the bone's content.val is_exec : t -> boolis_exec b is true if the bone is executable.val of_input : ?trim:bool ->
src:Carcass.Loc.src ->
[ `String of string ] ->
is_exec:bool ->
id -> (t, [> Carcass.Error.parse ]) Result.resultof_input ~src input is_exec id reads a bone with id id from
input. is_exec is the value for Carcass.Bone.is_exec. If trim is
true (defaults to false), a textual bone's leading and
trailing white space is trimmed with String.trim.val of_path : ?trim:bool ->
Fpath.t ->
id ->
(t,
[> `Carcass_parse of Carcass.Error.parse_err * Carcass.Loc.t
| `Msg of string ])
Rresult.resultof_path ~trim p reads a bone with id id from path p using
Carcass.Bone.of_input. The resulting bone's Carcass.Bone.is_exec is true iff the path
is executable for the user.val eval : Carcass.Pat.env ->
t -> (string, [> Carcass.Error.eval ]) Rresult.resulteval env b evaluates b to a string in the pattern evaluation
environment env.