aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-11-17 09:16:24 +0100
committerBjörn Gustavsson <[email protected]>2015-11-17 09:16:24 +0100
commitda6d480a65cce9392d4da80d142600f941d52881 (patch)
tree041ca45d393a4a765e8ca7e749401df16b6ae227 /lib/stdlib/src
parent57c53b4918bafc72097315d980fea2d0f296b1bb (diff)
downloadotp-da6d480a65cce9392d4da80d142600f941d52881.tar.gz
otp-da6d480a65cce9392d4da80d142600f941d52881.tar.bz2
otp-da6d480a65cce9392d4da80d142600f941d52881.zip
epp: Refactor user_predef/2 to share more code
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/epp.erl11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl
index d9a579ebc6..87cffc9e16 100644
--- a/lib/stdlib/src/epp.erl
+++ b/lib/stdlib/src/epp.erl
@@ -593,16 +593,7 @@ user_predef([{M,Val}|Pdm], Ms) when is_atom(M) ->
user_predef(Pdm, dict:store({atom,M}, [{none, {none,Exp}}], Ms))
end;
user_predef([M|Pdm], Ms) when is_atom(M) ->
- case dict:find({atom,M}, Ms) of
- {ok,_Defs} when is_list(_Defs) -> %% User defined macros
- {error,{redefine,M}};
- {ok,_Def} -> %% Predefined macros
- {error,{redefine_predef,M}};
- error ->
- A = line1(),
- user_predef(Pdm,
- dict:store({atom,M}, [{none, {none,[{atom,A,true}]}}], Ms))
- end;
+ user_predef([{M,true}|Pdm], Ms);
user_predef([Md|_Pdm], _Ms) -> {error,{bad,Md}};
user_predef([], Ms) -> {ok,Ms}.