[erlang-questions] about syntax tools

Tim Watson watson.timothy@REDACTED
Fri Aug 5 22:26:12 CEST 2011

On 5 August 2011 14:30, Richard Carlsson <carlsson.richard@REDACTED> wrote:
> On 08/05/2011 02:30 PM, Andrew Kondratovich wrote:
>> I can set -compile(parse_transform, Module).
>> But parse_transform allow to modify forms. Are there any way to modify
>> tokens while compiling ?
> No.

Shame, that would be kind of cool, but I suppose a bit unruly. You can
replace the tokenize bit during compilation as seen in
https://github.com/alavrik/erlson - it'll need custom build though.
That project uses a rebar plugin to hook into pre_compile and replace
the `erl_parse` module. Pretty simple actually, though obviously being
non-standard it could serious mess with compilation of
other/unintended code if you mess up what erl_parse is supposed to
really do.

More information about the erlang-questions mailing list