anchor.diff:  %% @hidden
   %% @doc Same as file:consult, but expands known records.
   consult(Path) ->
  -    case file:read_file(Path) of
  -        {ok, Data} ->
  -            case get_forms(binary_to_list(Data)) of
  -                {ok, Forms} ->
  -                    {Terms, OtherForms} =
  -                        lists:foldl(
  -                          fun([Form], {Trms, Other}) ->
  -                                  Trm = 
  -                                      erl_syntax_lib:map(
  -                                        fun(T) ->
  -                                                case erl_syntax:type(T) of
  -                                                    record_expr ->
  -                                                        record_to_tuple(T);
  -                                                    _ ->
  -                                                        T
  -                                                end
  -                                        end, erl_syntax:form_list([Form])),
  -                                  {[Trm|Trms], Other};
  -                             (Form, {Trms, Other}) ->
  -                                          {Trms, [Form|Other]}
  -                          end, {[], []}, Forms),
  -                    TmpFile = filename:join([filename:dirname(Path),
  -                                             filename:basename(Path) ++ "~"]),
  -                    Str = lists:map(
  -                            fun(Tree) ->
  -                                    AbsForm = erl_syntax:revert_forms(Tree),
  -                                    case catch erl_eval:exprs(AbsForm, []) of
  -                                        {'EXIT', _} ->
  -                                            [];
  -                                        {value, Term, _} ->
  -                                            [io_lib:print(Term), $., io_lib:nl()]
  -                                    end
  -                            end, Terms),
  -                    Res = case file:write_file(TmpFile, Str) of
  -                              ok ->
  -                                  case file:consult(TmpFile) of
  -                                      {ok, R} ->
  -                                          {ok, R, OtherForms};
  -                                      Err ->
  -                                          Err
  -                                  end;
  +    case get_forms(Path) of
  +        {ok, Forms} ->
  +            {Terms, OtherForms} =
  +                lists:foldl(
  +                  fun([Form], {Trms, Other}) ->
  +                          Trm = 
  +                              erl_syntax_lib:map(
  +                                fun(T) ->
  +                                        case erl_syntax:type(T) of
  +                                            record_expr ->
  +                                                record_to_tuple(T);
  +                                            _ ->
  +                                                T
  +                                        end
  +                                end, erl_syntax:form_list([Form])),
  +                          {[Trm|Trms], Other};
  +                     (Form, {Trms, Other}) ->
  +                          {Trms, [Form|Other]}
  +                  end, {[], []}, Forms),
  +            TmpFile = filename:join([filename:dirname(Path),
  +                                     filename:basename(Path) ++ "~"]),
  +            Str = lists:map(
  +                    fun(Tree) ->
  +                            AbsForm = erl_syntax:revert_forms(Tree),
  +                            case catch erl_eval:exprs(AbsForm, []) of
  +                                {'EXIT', _} ->
  +                                    [];
  +                                {value, Term, _} ->
  +                                    [io_lib:print(Term), $., io_lib:nl()]
  +                            end
  +                    end, Terms),
  +            Res = case file:write_file(TmpFile, Str) of
  +                      ok ->
  +                          case file:consult(TmpFile) of
  +                              {ok, R} ->
  +                                  {ok, R, OtherForms};
                                 Err ->
                                     Err
  -                          end,
  -                    catch file:delete(TmpFile),
  -                    Res;
  -                Err ->
  -                    Err
  -            end;
  +                          end;
  +                      Err ->
  +                          Err
  +                  end,
  +            catch file:delete(TmpFile),
  +            Res;
           Err ->
               Err
       end.
  
positive.code: %%%-------------------------------------------------------------------
  -module(xml_gen).
  
  %% Generator API
  -export([compile/1]).
  %% Runtime API
  
negative.code:              end, TaggedRecord),
      erl_syntax:tuple([Name|Vals]).
  
  get_forms(Path) ->
      case file:open(Path, [read]) of
          {ok, Fd} ->
              parse(Fd, 1, []);
          Err ->
              Err
      end.
  
  parse(Fd, Line, Acc) ->
      {ok, Pos} = file:position(Fd, cur),
      case epp_dodger:parse_form(Fd, Line) of
          {ok, Form, NewLine} ->
              parse(Fd, NewLine, [Form|Acc]);
          {eof, _} ->
              {ok, lists:reverse(Acc)};
          _Err ->
              file:position(Fd, {bof, Pos}),
              case io:scan_erl_exprs(Fd, "", Line) of
                  {ok, Toks, NewLine} ->
                      case transform_spec_to_form(Toks) of
                          {ok, Form} ->
                              parse(Fd, NewLine, [Form|Acc]);
                          not_spec ->
                              parse(Fd, NewLine, Acc);
                          Err ->
                              Err
                      end;
                  {eof, _} ->
                      {ok, lists:reverse(Acc)};
                  Err ->
                      Err
              end
      end.
  
  transform_spec_to_form([{'-', L0}, {atom, _, 'xml'}, {'(', _}|T]) ->
      case lists:reverse(T) of
          [{dot, L3}, {')', L2}|T1] ->
              T2 = lists:reverse([{dot, L3}, {'}', L2}|T1]),
              case erl_parse:parse_exprs([{'{', L0}|T2]) of
                  {ok, Form} ->
                      {ok, Form};
                  Err ->
                      Err
              end;
          _ ->
              not_spec
      end;
  transform_spec_to_form(_) ->
      not_spec.
  