Permalink
Browse files

(do_do/5): moved grep function to panLib

  • Loading branch information...
masse
masse committed May 12, 2003
1 parent 99bb8bf commit afa69e0b45e05055d2c27d9e68767a1a530e33b1
Showing with 1 addition and 21 deletions.
  1. +1 −21 lib/pan/src/panScan.erl
View
@@ -124,7 +124,7 @@ do_do(Patt, end_of_trace, Out, Line, Stat) ->
io:fwrite(Out, "~w - hits: ~w - scanned: ~w~n",
[?MODULE, Stat#state.hits, Line-1]);
do_do(Patt, Ms, Out, Line, Stat) ->
- case grep(Patt, Ms) of
+ case panLib:grep(Patt, Ms) of
false ->
Stat#state{line = Line+1};
true ->
@@ -139,26 +139,6 @@ safe_cb(M, F, A, Ms, Line, Out, Internal) ->
Nint -> Nint
end.
-grep('', T) -> true;
-grep(P, T) when list(P) ->
- case grp(P, T) of
- [] -> true;
- _ -> false
- end;
-grep(P, T) -> grep([P], T).
-
-grp([], _) -> [];
-grp(P, []) -> P;
-grp(P, T) when tuple(T) -> grp(P--[T], tuple_to_list(T));
-grp(P, Port) when port(Port) -> grp(P, list_to_atom(erlang:port_to_list(Port)));
-grp(P, Rf) when reference(Rf) -> grp(P, list_to_atom(erlang:ref_to_list(Rf)));
-grp(P, Pid) when pid(Pid) -> grp(P, list_to_atom(pid_to_list(Pid)));
-grp(P, L) when list(L) ->
- case lists:member(L, P) of
- true -> grp(P--[L], []);
- false -> grp(grp(P, hd(L)), tl(L))
- end;
-grp(P, T) -> grp(P--[T], []).
write(no_out, _, _) -> ok;
write(Out, Line, Ms) -> io:fwrite(Out, "~8w ~s - ~w~n", [Line, ts(Ms), Ms]).

0 comments on commit afa69e0

Please sign in to comment.