aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-08 07:10:01 +0200
committerBjörn Gustavsson <[email protected]>2015-04-30 13:14:26 +0200
commite8410b695f6bc431a7d16297ca31eb3c8368edf1 (patch)
tree9b1bf0ffc182b6a17f65841dccad97dafaa8f08d
parente76849def1ea65ef4a231c04baaec04431fa081b (diff)
downloadotp-e8410b695f6bc431a7d16297ca31eb3c8368edf1.tar.gz
otp-e8410b695f6bc431a7d16297ca31eb3c8368edf1.tar.bz2
otp-e8410b695f6bc431a7d16297ca31eb3c8368edf1.zip
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.
-rw-r--r--lib/debugger/src/dbg_iload.erl8
1 files changed, 4 insertions, 4 deletions
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]])};