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

Source file merlin_helpers.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
open! Import

let mk_attr_noloc txt = Ast_helper.Attr.mk Location.{ txt; loc = none }
let hide_attribute : attribute = mk_attr_noloc "merlin.hide" (PStr [])
let focus_attribute : attribute = mk_attr_noloc "merlin.focus" (PStr [])

let hide_pattern ({ ppat_attributes; _ } as p) =
  { p with ppat_attributes = hide_attribute :: ppat_attributes }

let focus_pattern ({ ppat_attributes; _ } as p) =
  { p with ppat_attributes = focus_attribute :: ppat_attributes }

let hide_expression ({ pexp_attributes; _ } as e) =
  { e with pexp_attributes = hide_attribute :: pexp_attributes }

let focus_expression ({ pexp_attributes; _ } as e) =
  { e with pexp_attributes = focus_attribute :: pexp_attributes }
OCaml

Innovation. Community. Security.