[wg-camlp4] Reconciling Merlin and ppx

Alain Frisch alain.frisch at lexifi.com
Mon Nov 4 09:07:36 GMT 2013


On 11/02/2013 06:21 PM, Yaron Minsky wrote:
> A better idea, perhaps, would be to have some libraries or standards
> about how to present an AST transformer so that it's suitable for
> running against a partial AST.  I don't really know the details of how
> Merlin works, but I understand it does a first pass to parse
> expressions into top-level units, the parsing of which is done
> independently.  AST transformers that operate on those units would
> naturally gain some level of incrementality.

I don't know anything about Merlin.  I assume that it uses a special 
representation of the AST which is more robust w.r.t. ill-formed 
fragments (syntax errors).  Is that right?   Could this representation 
of partial ASTs be encoded in the official Parsetree using extension 
nodes to denote invalid fragments?  Independently of the question of 
supporting ppx transformers, anything which brings Merlin closer to the 
official system is likely to make it more future-proof.


Alain


More information about the wg-camlp4 mailing list