anchor.diff:  -include_lib("compiler/src/core_parse.hrl").
   
   -record(comp, {base="",				%Base name
  +	       odir=".",			%Output directory
   	       lfile="",			%Lisp file
   	       bfile="",			%Beam file
   	       cfile="",			%Core file
   	       opts=[],				%User options
   	       mod=[],				%Module name
  -	       ret=file				%Return file|dcore|tcore|bin
  +	       target=beam,			%Target beam|to_core0|to_core
  +	       ret=file,			%Do we return value|file
  +	       code=none
   	      }).
   
   %% file(Name) ->
  
positive.code: erl_comp(Core, Warns, St) ->
      Eopts = erl_comp_opts(St#comp.opts),	%Fix options for compiler
      %% Do work and fix returns accordingly.
      Ret = case St#comp.ret of
  	      dcore ->
  		  ok = file:write_file(St#comp.cfile, [core_pp:format(Core),$\n]),
  		  {ok,[],[]};
  	      to_core ->
  		  case compile:forms(Core, [from_core,to_core|Eopts]) of
  		      {ok,_,Cfr,Ews} ->
  			  Cpp = [core_pp:format(Cfr),$\n],
  			  ok = file:write_file(St#comp.cfile, Cpp),
  			  {ok,[],Ews};
  		      Error -> Error
  		  end;
  	      binary ->
  		  case compile:forms(Core, [from_core,binary|Eopts]) of
  		      {ok,_,Bin,Ews} -> {ok,[Bin],Ews};
  		      Error -> Error
  		  end;
  	      file ->
  		  case compile:forms(Core, [from_core,binary|Eopts]) of
  		      {ok,_,Bin,Ews} ->
  			  ok = file:write_file(St#comp.bfile, Bin),
  			  {ok,[],Ews};
  		      Error -> Error
  		  end
  	  end,
  
negative.code: 
  %% erl_comp_opts(Options) -> Options.
  %%  Strip out report options and make sure erlang compiler returns
  %%  errors and warnings. Also remove other options which might cause
  %%  strange behaviour.
  
  erl_comp_opts(Os) ->
      filter(fun (report) -> false;
  	       (report_warnings) -> false;
  	       (report_errors) -> false;
  	       ('S') -> false;
  	       ('E') -> false;
  	       (_) -> true			%Everything else
  	   end, [return|Os]).			%Ensure return!
  
  %% do_ok_return(Ret, Warnings, State) -> {ok,Mod,...}.
  %% do_error_return(Errors, Warnings, State) -> {error,...} | error.
  