diff options
author | Anders Svensson <[email protected]> | 2013-09-23 09:45:00 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-11-28 17:27:27 +0100 |
commit | da973668bcfee7cba0aa6e0c498fee4aa1b24cce (patch) | |
tree | abe22ac0166ce795a5cf1815670ceb13c6c4c064 /lib/diameter/src/compiler/diameter_codegen.erl | |
parent | a3fa81eafff105086cf3f0c942c5247686edac28 (diff) | |
download | otp-da973668bcfee7cba0aa6e0c498fee4aa1b24cce.tar.gz otp-da973668bcfee7cba0aa6e0c498fee4aa1b24cce.tar.bz2 otp-da973668bcfee7cba0aa6e0c498fee4aa1b24cce.zip |
Make forms a separate output from diameter_codegen
Instead of being output as a consequence of a debug option.
Diffstat (limited to 'lib/diameter/src/compiler/diameter_codegen.erl')
-rw-r--r-- | lib/diameter/src/compiler/diameter_codegen.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/diameter/src/compiler/diameter_codegen.erl b/lib/diameter/src/compiler/diameter_codegen.erl index e606e61052..325a37e20d 100644 --- a/lib/diameter/src/compiler/diameter_codegen.erl +++ b/lib/diameter/src/compiler/diameter_codegen.erl @@ -53,12 +53,11 @@ when File :: string(), ParseD :: orddict:orddict(), Opts :: list(), - Mode :: dict | erl | hrl. + Mode :: dict | forms | erl | hrl. from_dict(File, ParseD, Opts, Mode) -> Outdir = proplists:get_value(outdir, Opts, "."), putr(verbose, lists:member(verbose, Opts)), - putr(debug, lists:member(debug, Opts)), codegen(File, ParseD, Outdir, Mode). %% Optional reports when running verbosely. @@ -115,10 +114,11 @@ gen(dict, ParseD, _Mod, Path) -> gen(hrl, ParseD, Mod, Path) -> write(Path ++ ".hrl", gen_hrl(Mod, ParseD)); +gen(forms, ParseD, Mod, Path) -> + write_term(Path ++ ".F", [erl_forms(Mod, ParseD)]); + gen(erl, ParseD, Mod, Path) -> - Forms = erl_forms(Mod, ParseD), - getr(debug) andalso write_term(Path ++ ".F", [Forms]), - write(Path ++ ".erl", [header(), prettypr(Forms), $\n]). + write(Path ++ ".erl", [header(), prettypr(erl_forms(Mod, ParseD)), $\n]). write(Path, T) -> write(Path, "~s", T). |