anchor.diff:  	      Dict
         end, orddict:new(), Data).
   
  -import_(M, IOpts, Opts, L, Dict) ->
  -    {Yi, Types} = parse_expand(<<M/binary, ".yang">>, L, Opts),
  +import_(M, IOpts, Opts, L, Ps, Dict) ->
  +    {Yi, Types} = parse_expand(<<M/binary, ".yang">>, L, Opts, Ps),
       Prefix = case lists:keyfind(prefix,1,IOpts) of
   		 {prefix,_,P,_} -> P;
   		 false ->
  -		     case lists:keyfind(prefix,1,Yi) of
  -			 {prefix,_,P1,_} -> P1;
  -			 false -> M
  -		     end
  +		     %% The prefix substatement is mandatory in modules
  +		     {_, _, P1, _} = lists:keyfind(prefix,1,Yi),
  +		     P1
   	     end,
  -    orddict:store(Prefix, {M, Yi, Types}, Dict).
  -
  -
  -parse_expand(F, L, Opts) ->
  +    orddict:store(Prefix, #mod{module = M,
  +			       prefix = Prefix,
  +			       data = Yi,
  +			       typedefs = Types}, Dict).
  +
  +
  +parse_expand(F, L, Opts, Ps) ->
       case parse(F, Opts) of
  -	{ok, [{Mod, _, Name, Data}]} when Mod==module; Mod==submodule ->
  -	    expand_module(Data, Name, Opts);
  +	{ok, [{Type, _, Name, Data}]} when Type==module; Type==submodule ->
  +	    expand_module(Type, Data, Name, Opts, Ps);
   	{error, Error} ->
   	    error({Error, [import, L, F]})
       end.
   
  -submodules(Data, M, Opts) ->
  +submodules(Data, Pfx, M, Opts, Ps) ->
       {Res, _} =
   	lists:mapfoldl(
   	  fun({include, L, SubM, IOpts}, Visited) ->
  
positive.code: 		      true ->
  			  error({include_loop, {L, [SubM|Visited]}});
  		      false ->
  			  Data1 = include_submodule(SubM, IOpts, Opts),
  			  {Data1, [SubM|Visited]}
  		  end;
  	     (Other, Acc) ->
  
negative.code:     fold(Fun, [], File, Opts).
  
  deep_parse(File) ->
      deep_parse(File, [], []).
  
  deep_parse(File, Opts) ->
      deep_parse(File, Opts, []).
  
  deep_parse(File, Opts, Parents) ->
      case parse(File, Opts) of
  	{ok, Yang} ->
  	    expand(Yang, set_cur(filename:absname(
  				   filename:dirname(File)), Opts), Parents);
  	{error, _} = E ->
  	    E
      end.
  