anchor.diff:  dict(File) ->
       dict(File, []).
   
  +%% format/1
  +%%
  +%% Turn an orddict returned by dict/1-2 back into a dictionary file
  +%% in the form of an iolist().
  +
  +-spec format(orddict:orddict())
  +   -> iolist().
  +
  +format(Dict) ->
  +    diameter_dict_util:format(Dict).
  +
  +%% reformat/1
  +%%
  +%% Parse a dictionary file and return its formatted equivalent.
  +
  +-spec reformat(File)
  +   -> {ok, iolist()}
  +    | {error, Reason}
  + when File :: string(),
  +      Reason :: string().
  +
  +reformat(File) ->
  +    case dict(File) of
  +        {ok, Dict} ->
  +            {ok, format(Dict)};
  +        {error, _} = No ->
  +            No
  +    end.
  +
   %% ===========================================================================
   
   make(_, _, _, []) ->
       ok;
   make(File, Opts, Dict, [Mode | Rest]) ->
  -    try diameter_codegen:from_dict(File, Dict, Opts, Mode) of
  -        ok ->
  -            make(File, Opts, Dict, Rest)
  +    try
  +        ok = diameter_codegen:from_dict(File, Dict, Opts, Mode),
  +        make(File, Opts, Dict, Rest)
       catch
           error: Reason ->
  -            {error, {Reason, Mode, erlang:get_stacktrace()}}
  +            erlang:error({Reason, Mode, erlang:get_stacktrace()})
       end.
  
positive.code:             E
      end.
  
  file(File) ->
      file(File, []).
  
  %% dict/2
  
  -spec dict(string(), [opt()])
     -> {ok, orddict:orddict()}
  
negative.code: %%
  %% Module alternative to diameterc for dictionary compilation.
  %%
  %% Eg. 1> diameter_make:codec("mydict.dia").
  %%
  %%     $ erl -noinput \
  %%           -boot start_clean \
  %%           -eval 'ok = diameter_make:codec("mydict.dia")' \
  %%           -s init stop
  %%
  
  -module(diameter_make).
  
  -export([codec/1,
           codec/2,
           dict/1,
           dict/2,
           format/1,
           reformat/1]).
  
  -export_type([opt/0]).
  
  -type opt() :: {include|outdir|name|prefix|inherits, string()}
               | verbose
               | debug.
  
  %% ===========================================================================
  
  %% codec/1-2
  %%
  %% Parse a dictionary file and generate a codec module.
  
  -spec codec(Path, [opt()])
     -> ok
      | {error, Reason}
   when Path :: string(),
        Reason :: string().
  
  codec(File, Opts) ->
      case dict(File, Opts) of
          {ok, Dict} ->
              make(File,
  