[wg-camlp4] My uses of syntax extension

Fabrice Le Fessant Fabrice.Le_fessant at inria.fr
Mon Jan 28 15:58:57 GMT 2013


On Mon, Jan 28, 2013 at 4:43 PM, Leo White <lpw25 at cam.ac.uk> wrote:
>
>>  Btw: do you have a clear idea how to implement ast lifting in ppx(
>> the meta filter in p4) which is an essential part in
>> quasi-quotation?(the stream parsers have non-trivial optimizations
>> which depends on it )
>
>
> I don't think that it is necessery for how I think we should implement
> anti-quotations.
>
> If you consider some quotation with an anti-quotation like:
>
> let body x = <:html < <body attr=$x$> Hello, World <\body> >>

In my ocaml-templates approach, the "html" parser would just receive a
string "<body attr=$x$> Hello, World <\body>", and call its parser,
that would have to understand anti-quotations, by returning a node
Pquotation("ocaml", "x") telling the typer that it should call the
ocaml parser on the string "x"...

--Fabrice


More information about the wg-camlp4 mailing list