ppx_tools icon indicating copy to clipboard operation
ppx_tools copied to clipboard

ppx_metaquot cannot generate expressions with 4.08.0

Open mrmr1993 opened this issue 5 years ago • 5 comments

This is the dual issue of #75: pexp_loc_stack, ptyp_loc_stack, ppat_loc_stack need to be present code generated by the ppx, but aren't. For example:

let x = [%expr "test"]

fails at compile-time with the error Some record fields are undefined: pexp_loc_stack.

mrmr1993 avatar Jul 22 '19 17:07 mrmr1993

cc @hhugo

kit-ty-kate avatar Jul 23 '19 13:07 kit-ty-kate

Which version of ppx_tools are you using?

kit-ty-kate avatar Jul 23 '19 13:07 kit-ty-kate

Which version of ppx_tools are you using?

5.3+4.08.0

mrmr1993 avatar Jul 23 '19 17:07 mrmr1993

I cannot reproduce this issue

$ echo 'let x = [%expr "test"]' > a.ml
$ ocamlc -c -ppx ~/opam/4.08.0/lib/ppx_tools/ppx_metaquot a.ml -I +compiler-libs -dsource 
let x =
  {
    Parsetree.pexp_desc =
      (Parsetree.Pexp_constant (Parsetree.Pconst_string ("test", None)));
    Parsetree.pexp_loc = (Stdlib.(!) Ast_helper.default_loc);
    Parsetree.pexp_loc_stack = [];
    Parsetree.pexp_attributes = []
  }

hhugo avatar Jul 24 '19 02:07 hhugo

To add to this, I was experiencing the same problem as noted in https://github.com/tizoc/ppx_pgsql/issues/8

Changing the versioned Ast from Ast_406 to Ast_408 fixed the issue.

tizoc avatar Dec 09 '19 15:12 tizoc