package ppxlib
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Standard infrastructure for ppx rewriters
Install
dune-project
Dependency
Authors
Maintainers
Sources
ppxlib-0.38.0.tbz
sha256=89e049b3102f6670a213d34d802ea3ab0fc530a8959d2f1a1e8db830063429a3
sha512=2fbbf124fc61e1f22242d13505e9af39d4a3c7cf03def1c33ee8bd915195be9b817636667302e9c6ceddc74a9a4a54926340e21c96fd770a2bc6752400315cfd
doc/ppxlib/Ppxlib/Ast_traverse/index.html
Module Ppxlib.Ast_traverseSource
This module provides AST traversal classes, such as maps, iterations, folds, etc. on the Parsetree types.
Link to the tutorial
For a detailed explanation on this module, refer to the relevant part of the manual.
API
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#structureSource
val enter_value :
(Astlib.Ast_502.Parsetree.expression, string Astlib.Location.loc) Attribute.tSource
val enter_module :
(Astlib.Ast_502.Parsetree.module_expr, string Astlib.Location.loc)
Attribute.tSource
val do_not_enter_value_description :
(Astlib.Ast_502.Parsetree.value_description, unit) Attribute.tSource
val do_not_enter_module_declaration :
(Astlib.Ast_502.Parsetree.module_declaration, unit) Attribute.tSource
val do_not_enter_module_type_declaration :
(Astlib.Ast_502.Parsetree.module_type_declaration, unit) Attribute.t sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page