anchor.diff:      end.
   
   type(Is, Data, Imports) ->
  +    case lists:keyfind(type, 1, Is) of
  +	false ->
  +	    undefined;
  +	{type, _, T, _} = Type ->
  +	    case binary:split(T, <<":">>) of
  +		[Pfx, Ts] ->
  +		    ImpData = orddict:fetch(Pfx, Imports),
  +		    case [D1 || {typedef,_,T1,D1} <- ImpData, Ts == T1] of
  +			[Def] ->
  +			    type(Def, ImpData, Imports);
  +			[] ->
  +			    descr_type(Type)
  +		    end;
  +		_ ->
  +		    case [D1 || {typedef,_,T1,D1} <- Data, T == T1] of
  +			[Def|_] ->
  +			    type(Def, Data, Imports);
  +			[] ->
  +			    descr_type(Type)
  +		    end
  +	    end
  +    end.
  +
  +descr_type(Is, Data, Imports) ->
       case lists:keyfind(type, 1, Is) of
   	false ->
   	    "untyped";
  
positive.code: 	    end
      end.
  
  descr_type({type, _, <<"enumeration">>, [{enum,_,E,I} |En]}) ->
      [ enum_value(I), " (", E, ")" | [ [ " | ", enum_value(I1), " (", E1, ")"]
  				     || {enum,_,E1,I1} <- En ] ];
  descr_type({type, _, <<"boolean">>, _}) ->
      "\"1\" (true) | \"0\" (false)";
  descr_type({type, _, T, _}) ->
      T.
  
  enum_value(I) ->
      {value,_,V,_} = lists:keyfind(value, 1, I),
      ["\"", binary_to_list(V), "\""].
  
  
negative.code: 	[] -> [];
  	[{K,{D,T}}|Tail] ->
  	    ["**descriptions**\n",
  	     "<dl><dt>", K, "</dt>\n", "<dd>", D,
  	     " (<b>type:</b> ", type_to_text(T), ")", "</dd>",
  	     [["\n<dt>", K1, "</dt>\n", "<dd>", D1, 
  	       " (<b>type:</b> ", type_to_text(T1), ")", "</dd>"]
  	      || {K1,{D1,T1}} <- Tail],
  	     "\n</dl>\n\n"]
      end.
  