aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-12-20 14:51:49 +0100
committerAnders Svensson <[email protected]>2011-12-20 14:51:49 +0100
commite986108d71a71d835c241d22cdb08f97584958c5 (patch)
tree9943de6a1fec302a48fdfffc6023ebddee530576
parent0610ab240d5b4bdfe8b5a23f34dcbae81ba9adce (diff)
parent8cfe29ec1757ff7c06585aa9a88b07387ae624d0 (diff)
downloadotp-e986108d71a71d835c241d22cdb08f97584958c5.tar.gz
otp-e986108d71a71d835c241d22cdb08f97584958c5.tar.bz2
otp-e986108d71a71d835c241d22cdb08f97584958c5.zip
Merge branch 'anders/diameter/compilation_options/OTP-9826' into maint
* anders/diameter/compilation_options/OTP-9826: Allow module name mapping at dictionary compilation Fix blunder that broke name/prefix compilation options
-rw-r--r--lib/diameter/src/compiler/diameter_dict_util.erl19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/diameter/src/compiler/diameter_dict_util.erl b/lib/diameter/src/compiler/diameter_dict_util.erl
index e4cd29ab7f..36a6efa294 100644
--- a/lib/diameter/src/compiler/diameter_dict_util.erl
+++ b/lib/diameter/src/compiler/diameter_dict_util.erl
@@ -630,13 +630,28 @@ reset(K, Dict, Opts) ->
opt({inherits = Key, "-"}, Dict) ->
dict:erase(Key, Dict);
+
opt({inherits = Key, Mod}, Dict) ->
- dict:append(Key, [0, {word, 0, Mod}], Dict);
+ case lists:splitwith(fun(C) -> C /= $/ end, Mod) of
+ {Mod, ""} ->
+ dict:append(Key, [0, {word, 0, Mod}], Dict);
+ {From, [$/|To]} ->
+ dict:store(Key,
+ [reinherit(From, To, M) || M <- find(Key, Dict)],
+ Dict)
+ end;
+
opt({Key, Val}, Dict) ->
- dict:store(Key, [0, {word, 0, Val}], Dict);
+ dict:store(Key, [[0, {word, 0, Val}]], Dict);
+
opt(_, Dict) ->
Dict.
+reinherit(From, To, [L, {word, _, From} = T | Avps]) ->
+ [L, setelement(3, T, To) | Avps];
+reinherit(_, _, T) ->
+ T.
+
%% ===========================================================================
%% pass1/1
%%