Module Ppxlib__Driver.Cookies
val get : t -> Ppxlib__.Import.string -> (Ppxlib__.Import.expression, 'a -> 'a, 'b) Ppxlib.Ast_pattern.t -> 'b Ppxlib__.Import.option
get cookies name pattern
look for a cookie namedname
and parse it usingpattern
.
val set : t -> Ppxlib__.Import.string -> Ppxlib__.Import.expression -> Ppxlib__.Import.unit
set cookies name expr
set cookiename
toexpr
.
val add_handler : (t -> Ppxlib__.Import.unit) -> Ppxlib__.Import.unit
Register a callback that is called before a rewriting. The handler is expected to lookup some cookies and set some global variables.
This API is a temporary hack to allow to migrate from
add_arg
to the use of cookie, until ppxlib has been upgraded to pass cookies through.
val add_simple_handler : Ppxlib__.Import.string -> (Ppxlib__.Import.expression, 'a -> 'a, 'b) Ppxlib.Ast_pattern.t -> f:('b Ppxlib__.Import.option -> Ppxlib__.Import.unit) -> Ppxlib__.Import.unit
Shorthand for:
add_handler (fun t -> f (get t name pattern))
val add_post_handler : (t -> Ppxlib__.Import.unit) -> Ppxlib__.Import.unit
Register a callback that is called after a rewriting. The handler is expected to set some cookies from some global variables.