Permalink
Browse files

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
  • Loading branch information...
2 parents 0610ab2 + 8cfe29e commit e986108d71a71d835c241d22cdb08f97584958c5 Anders Svensson committed Dec 20, 2011
Showing with 17 additions and 2 deletions.
  1. +17 −2 lib/diameter/src/compiler/diameter_dict_util.erl
View
19 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
%%

0 comments on commit e986108

Please sign in to comment.