package ppxlib

  1. Overview
  2. Docs
Standard infrastructure for ppx rewriters

Install

Dune Dependency

Authors

Maintainers

Sources

ppxlib-0.35.0.tbz
sha256=d9d959fc9f84260487e45684dc741898a92fc5506b61a7f5cac65d21832db925
sha512=e428b1e3b89261c7efdaa18016264d1afbf067cb9b0d41124b04796c2487ac7ca8ee9a24a60d56f20d1774cb44aaa9ecf1512f17455812ba8d62d4ef93616ee7

doc/ppxlib/Ppxlib/Driver/Cookies/index.html

Module Driver.CookiesSource

Sourcetype t
Sourceval get : t -> string -> (Astlib.Ast_500.Parsetree.expression, 'a -> 'a, 'b) Ast_pattern.t -> 'b option

get cookies name pattern look for a cookie named name and parse it using pattern. Raises if the parsing fails.

get cookies name pattern look for a cookie named name and parse it using pattern, returning a result instead of raising when the parsing fails.

Sourceval set : t -> string -> Astlib.Ast_500.Parsetree.expression -> unit

set cookies name expr set cookie name to expr.

Sourceval add_handler : (t -> unit) -> 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.

Sourceval add_simple_handler : string -> (Astlib.Ast_500.Parsetree.expression, 'a -> 'a, 'b) Ast_pattern.t -> f:('b option -> unit) -> unit

Shorthand for: add_handler (fun t -> f (get t name pattern))

Sourceval add_post_handler : (t -> unit) -> unit

Register a callback that is called after a rewriting. The handler is expected to set some cookies from some global variables.

OCaml

Innovation. Community. Security.