package ppxlib
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Standard library for ppx rewriters
Install
dune-project
Dependency
Authors
Maintainers
Sources
ppxlib-0.15.0.tbz
sha256=0b630d7f8d74a899a55cc27188b5ce03e735a93f07ea0c2de56532d8fd93b330
sha512=ecf0fff77ff6f1b356f018b6861b9e40bb8513092a7a486a3aa6024d12f5c15135899b77a188a44abc1c2ca84ebccb8bf9a78241e0383e023663fd7f86fbca72
doc/ppxlib/Ppxlib/Ast_traverse/index.html
Module Ppxlib.Ast_traverse
AST traversal classes
To use these classes, inherit from them and override the methods corresponding to the types from Parsetree you want to process. For instance to collect all the string constants in a structure:
let string_constants_of = object
inherit [string list] Ast_traverse.fold as super
method! expression e acc =
let acc = super#expression e acc in
match e.pexp_desc with
| Pexp_constant (Const_string (s, _)) -> s :: acc
| _ -> acc
method! pattern p acc =
let acc = super#pattern p acc in
match p.ppat_desc with
| Ppat_constant (Const_string (s, _)) -> s :: acc
| _ -> acc
end
let string_constants_of_structure = string_constants_of#structureclass map : object ... endclass iter : object ... endclass 'acc fold : object ... endclass 'acc fold_map : object ... endclass 'ctx map_with_context : object ... endclass map_with_path : string map_with_contextclass virtual 'res lift : object ... endclass sexp_of : object ... endval sexp_of : sexp_of sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>