aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/xref_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tools/src/xref_utils.erl')
-rw-r--r--lib/tools/src/xref_utils.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl
index 680b7e8aac..9d4a175d88 100644
--- a/lib/tools/src/xref_utils.erl
+++ b/lib/tools/src/xref_utils.erl
@@ -18,6 +18,8 @@
%%
-module(xref_utils).
+%% Avoid warning for local function error/1 clashing with autoimported BIF.
+-compile({no_auto_import,[error/1]}).
-export([xset/2]).
-export([is_directory/1, file_info/1, fa_to_mfa/2]).
@@ -640,22 +642,22 @@ neighbours([], G, Fun, VT, L, _V, Vs) ->
neighbours(Vs, G, Fun, VT, L).
match_list(L, RExpr) ->
- {ok, Expr} = regexp:parse(RExpr),
+ {ok, Expr} = re:compile(RExpr),
filter(fun(E) -> match(E, Expr) end, L).
match_one(VarL, Con, Col) ->
select_each(VarL, fun(E) -> Con =:= element(Col, E) end).
match_many(VarL, RExpr, Col) ->
- {ok, Expr} = regexp:parse(RExpr),
+ {ok, Expr} = re:compile(RExpr),
select_each(VarL, fun(E) -> match(element(Col, E), Expr) end).
match(I, Expr) when is_integer(I) ->
S = integer_to_list(I),
- {match, 1, length(S)} =:= regexp:first_match(S, Expr);
+ {match, [{0,length(S)}]} =:= re:run(S, Expr, [{capture, first}]);
match(A, Expr) when is_atom(A) ->
S = atom_to_list(A),
- {match, 1, length(S)} =:= regexp:first_match(S, Expr).
+ {match, [{0,length(S)}]} =:= re:run(S, Expr, [{capture, first}]).
select_each([{Mod,Funs} | L], Pred) ->
case filter(Pred, Funs) of