Skip to content

Commit

Permalink
Merge pull request wooga#4 from tomlion/master
Browse files Browse the repository at this point in the history
Use the 're' module instead of the 'binary' module to be compatible with R13.
  • Loading branch information
knutin committed Aug 23, 2011
2 parents 4ae609c + e775c1f commit 264db8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ebin/*
10 changes: 4 additions & 6 deletions src/eredis_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,13 @@ parse_simple({incomplete_simple, OldData}, NewData0) ->
%%
%% INTERNAL HELPERS
%%

get_newline_pos(B) ->
case binary:match(B, <<?NL>>) of
{Pos, _} ->
Pos;
nomatch ->
undefined
case re:run(B, ?NL) of
{match, [{Pos, _}]} -> Pos;
nomatch -> undefined
end.


%% @doc: Helper for handling the result of parsing. Will update the
%% parser state with the continuation of given name if necessary.
return_result({ok, Value, <<>>}, _State, _StateName) ->
Expand Down

0 comments on commit 264db8a

Please sign in to comment.