ocaml-ppx / ppxlib

Base library and tools for ppx rewriters
MIT License
244 stars 94 forks source link

fix: set input_lexbuf when reading binary AST too #483

Closed anmonteiro closed 3 months ago

anmonteiro commented 3 months ago

see https://github.com/ocaml/ocaml/pull/12991

NathanReb commented 3 months ago

@anmonteiro I'm not super familiar with melange but I'm guessing this is necessary for reason's syntax support right?

With reason you're using the driver on the marshalled AST resulting from parsing the reason syntax, whereas with regular OCaml syntax, you're using the driver directly on the source files. Are my assumptions correct?

anmonteiro commented 3 months ago

I don’t think so. There’s no dialect present in my repro https://github.com/anmonteiro/no-source-quotation-repro

I think this will rather happen on all staged_pps (the instructions in my repro pass the -ppx flag)

NathanReb commented 3 months ago

Ok thanks for the details!

I'll add a test for this and merge!

anmonteiro commented 3 months ago

Thank you!