parse transform options

Mikael Karlsson karlsson.rm@REDACTED
Wed Jul 21 04:35:23 CEST 2021

> How do you pass options (2nd argument) to a parse transform?

The options are the compile options.
If you need to pass custom options to the parse transform you can use -D :
-- test_parse.erl

parse_transform(Forms, Options) ->
  io:format("Options: ~p~n", [Options]),

-- testt.erl
-compile({parse_transform, test_parse}).

test() -> hoho.
~/work/erlang$ erlc -Dhejhopp -pa . testt.erl
Options: [report_warnings,

More information about the erlang-questions mailing list