Permalink
Browse files

Merge pull request #4 from tomlion/master

Use the 're' module instead of the 'binary' module to be compatible with R13.
  • Loading branch information...
2 parents 4ae609c + e775c1f commit 264db8acfe68443c0ef84a60af36f4130ad5715a @knutin knutin committed Aug 23, 2011
Showing with 5 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +4 −6 src/eredis_parser.erl
View
@@ -0,0 +1 @@
+ebin/*
View
@@ -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) ->

0 comments on commit 264db8a

Please sign in to comment.