anchor.diff:              [erl_syntax:list([erl_syntax:atom(export_all)])])
           | Tree
       ],
  -
  +    do_compile(Mod, Tree1, [report_errors, report_warnings, return_errors]).
  +
  +
  +
  +%% @doc Compiles a syntaxTree into a module
  +-spec do_compile(atom(), [erl_syntax:syntaxTree()], list()) ->
  +    ok | {error, term()}.
  +
  +do_compile(Mod, Tree, Opts) ->
   %%    io:format("\nGenerated ~p:\n\n", [Mod]),
   %%    [io:format("~s\n\n", [erl_prettypr:format(S)]) || S<-Tree],
  -   
  -    Forms1 = [erl_syntax:revert(X) || X <- Tree1],
  -    Options = [report_errors, report_warnings, return_errors],
  -    case compile:forms(Forms1, Options) of
  +    Forms1 = [erl_syntax:revert(X) || X <- Tree],
  +    case compile:noenv_forms(Forms1, Opts) of
           {ok, Mod, Bin} ->
               code:purge(Mod),
               File = atom_to_list(Mod)++".erl",
               case code:load_binary(Mod, File, Bin) of
  -                {module, Mod} -> 
  -                    {ok, Tree1};
  -                Error -> 
  +                {module, Mod} ->
  +                    {ok, Tree};
  +                Error ->
                       {error, Error}
               end;
           Error ->
  
positive.code:                 [erl_syntax:variable('Other')])
          ]).
  
  
  
  %% @doc Compiles a syntaxTree into a module
  
negative.code:     end.
  
  
  
  
  %% @doc Writes a generated tree as a standard erlang file
  -spec write(atom(), [erl_syntax:syntaxTree()], string()) ->
      ok | {error, term()}.
  
  write(Mod, Tree, BasePath) ->
      Path = filename:join(BasePath, nklib_util:to_list(Mod)++".erl"),
      Content = list_to_binary(
          [io_lib:format("~s\n\n", [erl_prettypr:format(S)]) || S <-Tree]),
      file:write_file(Path, Content).
  