anchor.diff:  -export([encode/1]).
   
   %%--------------------------------------------------------------------------------
  -%% Macros
  +%% Macros & Types
   %%--------------------------------------------------------------------------------
   -define(ERROR(Function, Args), {error, {badarg, [{?MODULE, Function, Args, [{line, ?LINE}]}]}}).
   -define(IS_REDUNDANT_UTF8(B1, B2, FirstBitN), (B1 =:= 0 andalso B2 < (1 bsl (FirstBitN + 1)))).
   -define(HEX(N, I), (binary:at(<<"0123456789abcdef">>, (N bsr (I * 4)) band 2#1111))).
   -define(UNICODE_TO_HEX(Code), ?HEX(Code, 3), ?HEX(Code, 2), ?HEX(Code, 1), ?HEX(Code, 0)).
   
  +-type encode_result() :: {ok, binary()} | {error, {Reason::term(), [erlang:stack_item()]}}.
  +-type next() :: {array_values, [jsone:json_value()]}
  +              | {object_value, jsone:json_value(), jsone:json_object_members()}
  +              | {object_members, jsone:json_object_members()}.
  +
   %%--------------------------------------------------------------------------------
   %% Exported Functions
   %%--------------------------------------------------------------------------------
   %% @doc JSON値をバイナリ形式にエンコードする.
  -% -spec encode(jsone:json_value()) -> binary().
  +-spec encode(jsone:json_value()) -> encode_result().
   encode(Value) ->
       value(Value, [], <<"">>).
   
   %%--------------------------------------------------------------------------------
   %% Internal Functions
   %%--------------------------------------------------------------------------------
  +-spec next([next()], binary()) -> encode_result().
   next([], Buf)             -> {ok, Buf};
   next([Next | Nexts], Buf) ->
       case Next of
  
positive.code:             end
      end.
  
  % -spec value(jsone:json_value(), binary()) -> binary().
  value(null, Nexts, Buf)                         -> next(Nexts, <<Buf/binary, "null">>);
  value(false, Nexts, Buf)                        -> next(Nexts, <<Buf/binary, "false">>);
  value(true, Nexts, Buf)                         -> next(Nexts, <<Buf/binary, "true">>);
  
negative.code: escape_string(Str, Nexts, Buf) ->
      ?ERROR(escape_string, [Str, Nexts, Buf]).
  
  -spec escape_unicode_char(binary(), char(), [next()], binary()) -> encode_result().
  escape_unicode_char(<<Str/binary>>, Unicode, Nexts, Buf) when Unicode =< 16#FFFF ->
      escape_string(Str, Nexts, <<Buf/binary, $\\, $u, ?UNICODE_TO_HEX(Unicode)>>);
  escape_unicode_char(<<Str/binary>>, Unicode, Nexts, Buf) ->
  