Module CCParse.U
Utils
This is useful to parse OCaml-like values in a simple way. All the parsers are whitespace-insensitive (they skip whitespace).
val list : ?start:string -> ?stop:string -> ?sep:string -> 'a t -> 'a list tlist pparses a list ofp, with the OCaml conventions for start token "[", stop token "]" and separator ";". Whitespace between items are skipped.
val int : int tParse an int in decimal representation.
val in_parens_opt : 'a t -> 'a tin_parens_opt pparsespin an arbitrary number of nested parenthesis (possibly 0).- since
- NEXT_RELEASE
val option : 'a t -> 'a option toption pparses "Some <x>" intoSome xifpparses "<x>" intox, and parses "None" intoNone.- since
- NEXT_RELEASE
val hexa_int : int tParse an int int hexadecimal format. Accepts an optional
0xprefix, and ignores capitalization.- since
- NEXT_RELEASE
val word : string tNon empty string of alpha num, start with alpha.
val bool : bool tAccepts "true" or "false"
- since
- NEXT_RELEASE