# PPX rewriter help

**URL:** <https://discuss.ocaml.org/t/ppx-rewriter-help/4563>\
**Category:** Learning\
**Created:** [October 20, 2019, 10:01am UTC](https://discuss.ocaml.org/t/ppx-rewriter-help/4563 "2019-10-20T10:01:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![progman](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@progman](https://discuss.ocaml.org/u/progman)\
**Post date:** [October 20, 2019, 10:01am UTC](https://discuss.ocaml.org/t/ppx-rewriter-help/4563/1 "2019-10-20T10:01:35Z")

</div>

in constructing an extension with

```auto
let blah =
  Extension.declare
    "blah"
    Extension.Context.structure_item
    Ast_pattern.(pstr (pstr_value __((value_binding ~pat:(__) ~expr:__ ) ^:: nil) ^::nil)) 
...

```

how should the next line look in equivalent metaquot?  
I have tried all sorts, like (nonrec flag capture omitted):

```auto
  [%stri let [%p __] = [%e__] ]
and
  [%stri let [%p __] = [%e__] ]
and
  [%stri let [%p? __] = [%e?__] ]
and
  [%stri? let [%p __] = [%e__] ]
and
  [%stri? let [%p? __] = [%e?__] ]
and
  [%stri let __=__]
and
  [%stri let _ = _]
and
...

```

but the right way is elusive.  
I’d like to capture the nonrec flag also as per the combinator line.  
do the comments of ast\_pattern.mli and ppx-for-plugin-authors.rst constitute the whole documentation?
