Original bug ID: 5634
I believe many Camlp4 syntax-extension could be implemented with a much more basic technology. I've described a proposal for extending the OCaml syntax with a fixed number of extension points (attributes and quotations) and letting the compilers pipe the parsed AST through one or several external rewriters:
Now that "compilerlibs" are officially installed, and as a first step towards this proposal, I'd like to propose for inclusion the tiny attached patch (also in the ast_rewriter branch of the SVN). It only extends the compilers with a new "-ppx" flag, similar to (and compatible with) the existing "-pp". Invoking the compiler with "-ppx cmd" pipes the parsed AST (interface/implementation) through the specified command (actually, it passes two filenames -- input and ouput -- as extra arguments to the command).
An example of how to write an AST rewriter is available in the SVN:
The text was updated successfully, but these errors were encountered: