diff options
Diffstat (limited to 'lib/diameter/src')
-rw-r--r-- | lib/diameter/src/compiler/diameter_codegen.erl | 26 | ||||
-rw-r--r-- | lib/diameter/src/compiler/diameter_make.erl | 5 |
2 files changed, 7 insertions, 24 deletions
diff --git a/lib/diameter/src/compiler/diameter_codegen.erl b/lib/diameter/src/compiler/diameter_codegen.erl index 47da193457..22422f2ef2 100644 --- a/lib/diameter/src/compiler/diameter_codegen.erl +++ b/lib/diameter/src/compiler/diameter_codegen.erl @@ -49,7 +49,7 @@ when File :: string(), ParseD :: orddict:orddict(), Opts :: list(), - Mode :: parse | forms | erl | hrl | beam. + Mode :: parse | forms | erl | hrl. from_dict(File, ParseD, Opts, Mode) -> Outdir = proplists:get_value(outdir, Opts, "."), @@ -85,8 +85,6 @@ do_write(M, Path, T) when M == parse; M == forms -> write_term(Path, T); -do_write(beam, Path, {_Mod, Beam}) -> - write(Path, Beam); do_write(_, Path, T) -> write(Path, T). @@ -130,10 +128,7 @@ gen(parse, ParseD, _Mod) -> [?VERSION | ParseD]; gen(forms, ParseD, Mod) -> - erl_forms(Mod, ParseD); - -gen(beam, ParseD, Mod) -> - compile(pp(erl_forms(Mod, ParseD))); + pp(erl_forms(Mod, ParseD)); gen(hrl, ParseD, Mod) -> gen_hrl(Mod, ParseD); @@ -141,17 +136,6 @@ gen(hrl, ParseD, Mod) -> gen(erl, ParseD, Mod) -> [header(), prettypr(erl_forms(Mod, ParseD)), $\n]. -compile({ok, Forms}) -> - case compile:forms(Forms, [debug_info, return]) of - {ok, Mod, Beam, _Warnings} -> - {Mod, Beam}; - {error, Errors, _Warnings} -> - erlang:error({compile, Errors}) - end; - -compile({error, Reason}) -> - erlang:error(Reason). - erl_forms(Mod, ParseD) -> Forms = [[{?attribute, module, Mod}, {?attribute, compile, {parse_transform, diameter_exprecs}}, @@ -866,10 +850,10 @@ pp(Forms) -> pp(Forms, {ok, Code}) -> Files = files(Code, []), - {ok, lists:flatmap(fun(T) -> include(T, Files) end, Forms)}; + lists:flatmap(fun(T) -> include(T, Files) end, Forms); -pp(_, {error, _} = No) -> - No. +pp(Forms, {error, Reason}) -> + erlang:error({forms, Reason, Forms}). include({attribute, _, include_lib, Path}, Files) -> Inc = filename:basename(Path), diff --git a/lib/diameter/src/compiler/diameter_make.erl b/lib/diameter/src/compiler/diameter_make.erl index 99034734c5..2f314b7e57 100644 --- a/lib/diameter/src/compiler/diameter_make.erl +++ b/lib/diameter/src/compiler/diameter_make.erl @@ -44,8 +44,7 @@ | return | verbose | parse %% internal parsed form - | forms %% abstract format from which erl is generated - | beam %% compiled directly from preprocessed forms + | forms %% abstract format for compile:forms/1,2 | erl | hrl. @@ -218,7 +217,7 @@ modes(Opts) -> lists:filter(fun is_mode/1, Opts). is_mode(T) -> - lists:member(T, [erl, hrl, parse, forms, beam]). + lists:member(T, [erl, hrl, parse, forms]). identify([Vsn | [T|_] = ParseD]) when is_tuple(T) -> |