aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/xref_utils.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2010-03-03 09:44:34 +0000
committerErlang/OTP <[email protected]>2010-03-03 09:44:34 +0000
commitf94ff4fb58b9db3926ce0fea2c0fb4b18b1823ca (patch)
tree10f69dc132d379d9c36a9697801ab83f709af5c7 /lib/tools/src/xref_utils.erl
parent4ce2c1bd3ed90e6f1c208b4749ee33ae4ee9d723 (diff)
downloadotp-f94ff4fb58b9db3926ce0fea2c0fb4b18b1823ca.tar.gz
otp-f94ff4fb58b9db3926ce0fea2c0fb4b18b1823ca.tar.bz2
otp-f94ff4fb58b9db3926ce0fea2c0fb4b18b1823ca.zip
OTP-8472 tools: xref: re/regexp
Xref has been updated to use the re module instead of the deprecated regexp module.
Diffstat (limited to 'lib/tools/src/xref_utils.erl')
-rw-r--r--lib/tools/src/xref_utils.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl
index 680b7e8aac..0ef199cec7 100644
--- a/lib/tools/src/xref_utils.erl
+++ b/lib/tools/src/xref_utils.erl
@@ -640,22 +640,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