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/src/ppxlib.astlib/clean.ml.html

Source file clean.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
let remove_ppxlib_migration_from_ast_mapper =
  let should_keep_attribute (a : Parsetree.attribute) =
    not (Stdlib0.String.is_prefix ~prefix:"ppxlib.migration" a.attr_name.txt)
  in
  let mapper =
    {
      Ast_mapper.default_mapper with
      attributes = (fun _ -> List.filter should_keep_attribute);
    }
  in
  mapper

let remove_migration_attributes_from_str =
  remove_ppxlib_migration_from_ast_mapper.structure
    remove_ppxlib_migration_from_ast_mapper

let remove_migration_attributes_from_sig =
  remove_ppxlib_migration_from_ast_mapper.signature
    remove_ppxlib_migration_from_ast_mapper