aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_iload.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-02-10 15:32:02 +0100
committerBjörn Gustavsson <[email protected]>2014-02-10 15:32:02 +0100
commite2cd468965a3c699d63867b1c99319fdbd06c08e (patch)
tree6521829fe2b35765ef3fd3acf571cd16b276f0bb /lib/debugger/src/dbg_iload.erl
parent13f0700943371aa3130598d3f76d6e6d96ced78f (diff)
parentfb8b207dff92916b1525ed1461dac96ce0922a4d (diff)
downloadotp-e2cd468965a3c699d63867b1c99319fdbd06c08e.tar.gz
otp-e2cd468965a3c699d63867b1c99319fdbd06c08e.tar.bz2
otp-e2cd468965a3c699d63867b1c99319fdbd06c08e.zip
Merge branch 'nox/debugger/erl_eval_SUITE/OTP-11676'
* nox/debugger/erl_eval_SUITE/OTP-11676: Truly test debugger in erl_eval_SUITE copy
Diffstat (limited to 'lib/debugger/src/dbg_iload.erl')
-rw-r--r--lib/debugger/src/dbg_iload.erl40
1 files changed, 2 insertions, 38 deletions
diff --git a/lib/debugger/src/dbg_iload.erl b/lib/debugger/src/dbg_iload.erl
index 45956a206e..266cf239dd 100644
--- a/lib/debugger/src/dbg_iload.erl
+++ b/lib/debugger/src/dbg_iload.erl
@@ -457,7 +457,7 @@ expr({lc,Line,E0,Gs0}, _Lc) -> %R8.
({b_generate,L,P0,Qs}) -> %R12.
{b_generate,L,expr(P0, false),expr(Qs, false)};
(Expr) ->
- case is_guard(Expr) of
+ case erl_lint:is_guard_test(Expr) of
true -> {guard,guard([[Expr]])};
false -> expr(Expr, false)
end
@@ -469,7 +469,7 @@ expr({bc,Line,E0,Gs0}, _Lc) -> %R12.
({b_generate,L,P0,Qs}) -> %R12.
{b_generate,L,expr(P0, false),expr(Qs, false)};
(Expr) ->
- case is_guard(Expr) of
+ case erl_lint:is_guard_test(Expr) of
true -> {guard,guard([[Expr]])};
false -> expr(Expr, false)
end
@@ -512,42 +512,6 @@ expr({bin_element,Line,Expr,Size,Type}, _Lc) ->
expr(Other, _Lc) ->
exit({?MODULE,{unknown_expr,Other}}).
-%% is_guard(Expression) -> true | false.
-%% Test if a general expression is a guard test or guard BIF.
-%% Cannot use erl_lint here as sys_pre_expand has transformed source.
-
-is_guard({op,_,Op,L,R}) ->
- erl_internal:comp_op(Op, 2) andalso is_gexpr_list([L,R]);
-is_guard({call,_,{remote,_,{atom,_,erlang},{atom,_,Test}},As}) ->
- Arity = length(As),
- (erl_internal:guard_bif(Test, Arity) orelse
- erl_internal:old_type_test(Test, Arity)) andalso is_gexpr_list(As);
-is_guard({atom,_,true}) -> true;
-is_guard(_) -> false.
-
-is_gexpr({var,_,_}) -> true;
-is_gexpr({atom,_,_}) -> true;
-is_gexpr({integer,_,_}) -> true;
-is_gexpr({char,_,_}) -> true;
-is_gexpr({float,_,_}) -> true;
-is_gexpr({string,_,_}) -> true;
-is_gexpr({nil,_}) -> true;
-is_gexpr({cons,_,H,T}) -> is_gexpr_list([H,T]);
-is_gexpr({tuple,_,Es}) -> is_gexpr_list(Es);
-is_gexpr({call,_,{remote,_,{atom,_,erlang},{atom,_,F}},As}) ->
- Ar = length(As),
- case erl_internal:guard_bif(F, Ar) of
- true -> is_gexpr_list(As);
- false -> erl_internal:arith_op(F, Ar) andalso is_gexpr_list(As)
- end;
-is_gexpr({op,_,Op,A}) ->
- erl_internal:arith_op(Op, 1) andalso is_gexpr(A);
-is_gexpr({op,_,Op,A1,A2}) ->
- erl_internal:arith_op(Op, 2) andalso is_gexpr_list([A1,A2]);
-is_gexpr(_) -> false.
-
-is_gexpr_list(Es) -> lists:all(fun (E) -> is_gexpr(E) end, Es).
-
consify([A|As]) ->
{cons,0,A,consify(As)};
consify([]) -> {value,0,[]}.