I've got a weird macro that I'm debugging and I can't seem to figure out how to get the output of the preprocessor. I'm looking for the equivalent of GCC's -save-temps
. I've tried passing dpp
to compile:file/2
, but it seems to generate a parse tree, not preprocessed Erlang.
compile:file("t.erl", 'E').
as mentioned by Anton is great, but doesn't help with macros that cause syntax errors. Lacking a way to debug complicated macros, I'm leaning toward doing my metaprogramming by writing programs that generate code.
Try one of these:
compile:file("t.erl", 'P').
compile:file("t.erl", 'E').
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With