anchor.diff:  %%--------------------------------------------------------------------
   -spec generate_source(ProtoFile :: string() | atom(), Options :: list()) ->
   			     ok | {error, _}.
  -generate_source(ProtoFile,Options) when is_atom (ProtoFile) ->
  -    generate_source (atom_to_list (ProtoFile) ++ ".proto", Options);
  -generate_source(ProtoFile,Options) when is_list (ProtoFile) ->
  -    Basename = filename:basename (ProtoFile, ".proto") ++ "_pb",
  +generate_source(ProtoFile,Options) when is_atom(ProtoFile) ->
  +    generate_source(atom_to_list(ProtoFile) ++ ".proto", Options);
  +generate_source(ProtoFile,Options) when is_list(ProtoFile) ->
  +    Basename = filename:basename(ProtoFile, ".proto") ++ "_pb",
       {ok,String} = parse_file(ProtoFile),
       {ok,FirstParsed} = parse_string(String),
       ImportPaths = ["./", "src/" | proplists:get_value(imports_dir, Options, [])],
       Parsed = parse_imports(FirstParsed, ImportPaths),
       Collected = collect_full_messages(Parsed),
       Messages = resolve_types(Collected#collected.msg,Collected#collected.enum),
  -    output_source (Basename, Messages, Collected#collected.enum, Options).
  +    output_source(Basename, Messages, Collected#collected.enum, Options).
   
   %% @hidden
   parse_imports(Parsed, Path) ->
  
positive.code:     Other.
  
  %% @hidden
  is_scalar_type ("double") -> true;
  is_scalar_type ("float") -> true;
  is_scalar_type ("int32") -> true;
  is_scalar_type ("int64") -> true;
  is_scalar_type ("uint32") -> true;
  is_scalar_type ("uint64") -> true;
  is_scalar_type ("sint32") -> true;
  is_scalar_type ("sint64") -> true;
  is_scalar_type ("fixed32") -> true;
  is_scalar_type ("fixed64") -> true;
  is_scalar_type ("sfixed32") -> true;
  is_scalar_type ("sfixed64") -> true;
  is_scalar_type ("bool") -> true;
  is_scalar_type ("string") -> true;
  is_scalar_type ("bytes") -> true;
  is_scalar_type (_) -> false.
  
  %% @hidden
  is_enum_type(_Type, [], _Enums) ->
  
negative.code:     [[Name], [Name, Package]].
  
  %% @hidden
  resolve_types(Data, Enums) -> resolve_types (Data, Data, Enums, []).
  resolve_types([{TypePath, Fields,Extended} | Tail], AllPaths, Enums, Acc) ->
      FolderFun = fun (Input, TmpAcc) ->
  			  case Input of
  			      {Index, Rules, Type, Identifier, Other} ->
  				  case is_scalar_type(Type) of
  				      true -> [Input | TmpAcc];
  				      false ->
  					  PossiblePaths =
  					      case string:tokens(Type,".") of
  						  [Type] ->
  						      all_possible_type_paths(Type, TypePath);
  						  FullPath ->
  						% handle types of the form Foo.Bar which are absolute,
  						% so we just convert to a type path and check it.
  						      [lists:reverse(FullPath)]
  					      end,
  					  RealPath =
  					      case find_type(PossiblePaths, AllPaths) of
  						  false ->
  						      case is_enum_type(Type, PossiblePaths, Enums) of
  							  {true,EnumType} ->
  							      [EnumType];
  							  false ->
  							      throw(["Unknown Type ", Type])
  						      end;
  						  ResultType ->
  						      ResultType
  