anchor.diff:    end.
   
   % Output raw Erlang bytecode for inclusion into compiled Reia bytecode
  -compile_expressions(Filename, Expressions, Options) ->  
  -  Module = case Options#compile_options.toplevel_wrapper of
  -    true  -> wrapped_module(Expressions);
  -    false -> unwrapped_module(Expressions)
  +compile_expressions(Filename, Exprs, Options) ->  
  +  {Module, _Submodules} = case Options#compile_options.toplevel_wrapper of
  +    true  -> wrapped_module(Exprs);
  +    false -> unwrapped_module(Exprs)
     end,
     
     ErlModule = [
  
positive.code: 	{ok, Name, Result}.
    
  % Compiled evaluation of a parsed Reia file
  compile(Filename, Expressions) ->
    compile(Filename, Expressions, #compile_options{}).
  
  compile(Filename, Expressions, Options) ->
    io:format("Output Code: ~p~n", [Expressions]),
    case compile_expressions(Filename, Expressions, Options) of
      {ok, _Module, Bin} ->
        Module = #reia_module{filename=Filename, base_module=Bin},
        {ok, term_to_binary(Module)};
  
negative.code:   
    compile:forms(ErlModule, compile_options(Options)).
  
  wrapped_module(_Exprs) ->
    throw({error, "toplevel wrapper not supported yet, sorry!"}).
    
  unwrapped_module(Exprs) ->
    case Exprs of
      [{module, Line, Name, Functions}] -> 
        {ok, Functions2, Submodules} = reia_modules:replace(Functions, fun module_loader/1),
        Module = #module{line=Line, name=Name, functions=Functions2},
        {Module, Submodules};
      _ ->
        throw({error, "code without a toplevel wrapper should define exactly one module"})
    end.
  