From e8410b695f6bc431a7d16297ca31eb3c8368edf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 8 Apr 2015 07:10:01 +0200 Subject: dbg_iload: Correct translation of generators The pattern in the generator for a list or binary comprehension was processed as an expression instead of as a pattern. That happened to work because expressions and patterns were translated in the same way. In the future we might want to process expressions and patterns differently. --- lib/debugger/src/dbg_iload.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/debugger') diff --git a/lib/debugger/src/dbg_iload.erl b/lib/debugger/src/dbg_iload.erl index f1a85e8e71..d47d412893 100644 --- a/lib/debugger/src/dbg_iload.erl +++ b/lib/debugger/src/dbg_iload.erl @@ -457,9 +457,9 @@ expr({'try',Anno,Es0,CaseCs0,CatchCs0,As0}, Lc) -> {'try',ln(Anno),Es,CaseCs,CatchCs,As}; expr({lc,Anno,E0,Gs0}, _Lc) -> %R8. Gs = lists:map(fun ({generate,L,P0,Qs}) -> - {generate,L,expr(P0, false),expr(Qs, false)}; + {generate,L,pattern(P0),expr(Qs, false)}; ({b_generate,L,P0,Qs}) -> %R12. - {b_generate,L,expr(P0, false),expr(Qs, false)}; + {b_generate,L,pattern(P0),expr(Qs, false)}; (Expr) -> case erl_lint:is_guard_test(Expr) of true -> {guard,guard([[Expr]])}; @@ -469,9 +469,9 @@ expr({lc,Anno,E0,Gs0}, _Lc) -> %R8. {lc,ln(Anno),expr(E0, false),Gs}; expr({bc,Anno,E0,Gs0}, _Lc) -> %R12. Gs = lists:map(fun ({generate,L,P0,Qs}) -> - {generate,L,expr(P0, false),expr(Qs, false)}; + {generate,L,pattern(P0),expr(Qs, false)}; ({b_generate,L,P0,Qs}) -> %R12. - {b_generate,L,expr(P0, false),expr(Qs, false)}; + {b_generate,L,pattern(P0),expr(Qs, false)}; (Expr) -> case erl_lint:is_guard_test(Expr) of true -> {guard,guard([[Expr]])}; -- cgit v1.2.3