module OASISValues:Parse, print and check valuessig
..end
This module allows to parse values that should match a particular content (URL, list).
The whole module is not exported.
Author(s): Sylvain Le Gall
type 'a
t = {
|
parse : |
(* | Parse a string into value | *) |
|
update : |
(* | Merge two values into one | *) |
|
print : |
(* | Convert a value to string | *) |
exception Not_printable
exception Not_combinable
val update_fail : 'a -> 'b -> 'c
OASISValues.Not_combinable
.val blackbox : 'a t
val string : string t
val string_not_empty : string t
val boolean : bool t
bool_of_string
to parse.val expandable : string t -> string t
Buffer.add_substitute
rules.val dot_separated : 'a t -> 'a list t
dot_separated v
When parsing split the input string using '.' separator
and apply v.parse
. Merge by concatenate two values, and print by joining
v.print
generated strings using a '.' separator. Don't strip whitespaces.val comma_separated : 'a t -> 'a list t
OASISValues.dot_separated
using ',' as separator. Strip whitespaces before
and after the input string.val space_separated : string list t
OASISValues.dot_separated
using blanks as separator.val with_optional_parentheses : 'a t -> 'b t -> ('a * 'b option) t
with_optional_parentheses v_main v_opt
Combine two values. The input
string "abcd (defg)"
is split between the part not between parentheses
and the one between. v_main
is applied to the first one and v_opt
to
the latter. If no parentheses is found, only apply v_main
.val opt : 'a t -> 'a option t
val choices : (unit -> string) -> (string * 'a) list -> 'a t
choices nm lst
Value that must be in a list of predefined choices.
Find the right association in lst
, comparison is case insensitive.
If something failed output a message using nm
as the name of the
value represented.val regexp : Pcre.regexp -> (unit -> string) -> string t
regexp r nm
Check that input string match r
. If not use nm
as the
name of the value represented.val url : string t
val copyright : string t
val file : string t
val files : string list t
val file_glob : string t
val directory : string t
val modules : string list t
val categories : string list t
val findlib_name : string t
val findlib_full : string t
val internal_library : string t
val command_line : (string * string list) t