package ppxlib

  1. Overview
  2. Docs
Standard infrastructure for ppx rewriters

Install

dune-project
 Dependency

Authors

Maintainers

Sources

a6fadbd212f3cd7d5d8dcfefc46c884f710fedc0.tar.gz
sha256=25e81f2085ad19688f7056c6df49ca48b3df4cea8304ba3be2550e172d59bfec
sha512=cfdaa06fd32d206f72de05a5289d33ec85fa6bdf7c5be7c85874a16d9e154cdc080465453b60fe7f6c01589eb92e4296b18067413ac2d8dec47b9539f55e301e

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

Module Driver.CookiesSource

Sourcetype t
Sourceval get : t -> string -> (Astlib.Ast_502.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_502.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_502.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.