now ethically opposed to special casing forced termination. users can just append whitespace

This commit is contained in:
alisdair sullivan 2010-05-27 16:15:45 -07:00
parent 2a2275136a
commit 60943446c0
2 changed files with 9 additions and 25 deletions

View file

@ -61,13 +61,8 @@ test_body(TestSpec, Dir) ->
end.
incremental_decode(F, <<>>) ->
case F(<<>>) of
G when is_function(G) ->
{Result, <<>>} = G(<<>>),
Result
; {Result, Rest} ->
Result
end;
{Result, Rest} = F(<<" "/utf8>>),
Result;
incremental_decode(F, <<A/utf8, Rest/binary>>) ->
case F(<<A/utf8>>) of
G when is_function(G) ->
@ -79,10 +74,9 @@ incremental_decode(F, <<A/utf8, Rest/binary>>) ->
decode(F, JSON) ->
case F(JSON) of
G when is_function(G) ->
{Result, <<>>} = G(<<>>),
{Result, <<>>} = G(<<" "/utf8>>),
Result
; {Result, Rest} ->
{_, <<>>} = (F(Rest))(<<>>),
Result
end.