ocaml-ppx / ppx_tools

Tools for authors of ppx rewriters
MIT License
134 stars 39 forks source link

ppx_metaquot should include location info #7

Open whitequark opened 10 years ago

whitequark commented 10 years ago

Right now the type errors are confusing:

File "_none_", line 1:
Error: This pattern matches values of type Parsetree.expression
       but a pattern was expected which matches values of type
         Parsetree.expression_desc
whitequark commented 9 years ago

A good test case for this problem:

[%expr fun x -> [%e Exp.variant (int_encoding typ) [%expr (Int64.to_string x)]]]
charlesetc commented 7 years ago

+1 Absolutely

This would be awesome, if it just allowed you to pass in a single location that all the generated ast's would share.

whitequark commented 7 years ago

@Charlesetc That's already there; see https://github.com/alainfrisch/ppx_tools/blob/master/ppx_metaquot.ml#L28-L38

charlesetc commented 7 years ago

Just saw that! True - thanks