anchor.diff:  module(Mfs, #cinfo{opts=Opts,file=File}) ->
       St0 = #lfe_cg{opts=Opts,file=File},
       {AST,St1} = compile_module(Mfs, St0),
  -    {ok,St1#lfe_cg.module,AST,[]}.
  +    return_status(AST, St1).
  +
  +return_status(AST, #lfe_cg{module=M,errors=[]}=St) ->
  +    {ok,M,AST,St#lfe_cg.warnings};
  +return_status(_AST, St) ->
  +    {error,St#lfe_cg.errors,St#lfe_cg.warnings}.
   
   compile_module(Mfs, St0) ->
       %% Collect all the module attributes and output them first.
       St1 = collect_mod_defs(Mfs, St0),
       Attrs = compile_attributes(St1),
  -    %% Now we do the meta, function and record forms in order.
  -    Forms = compile_forms(Mfs, St1),
  -    {Attrs ++ Forms,St1}.
  +    %% Now we do the meta, function and record forms in order. Here we
  +    %% can get translation errors.
  +    %% Forms = compile_forms(Mfs, St1),
  +    {Forms,St2} =
  +        try
  +            {compile_forms(Mfs, St1),St1}
  +        catch
  +            error:{illegal_code,Line,Code} ->
  +                {[],add_error(Line, {illegal_code,Code}, St1)}
  +        end,
  +    {Attrs ++ Forms,St2}.
   
   %% collect_mod_defs(ModuleForms, State) -> State.
   %%  Collect the attributee information in define-module and
  
positive.code: 
  -module(lfe_codegen).
  
  -export([module/2]).
  
  %% -compile(export_all).
  
  
negative.code:         {ok,Val} -> Val;
          error -> Def
      end.
  
  %% add_error(Line, Error, State) -> State.
  
  add_error(L, E, #lfe_cg{errors=Errs}=St) ->
      St#lfe_cg{errors=Errs ++ [{L,?MODULE,E}]}.
  