aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-11-07 13:26:09 +0100
committerBjörn Gustavsson <[email protected]>2014-11-07 13:26:09 +0100
commit7b803c5fbc69458d3e1dba8a88322c2306f77e44 (patch)
tree1c86d999132f51ef20fd043ff8f50ee99ee1038c /lib
parent7ee73ff2f7c7b64768903316c4ed9a0faaacfa3e (diff)
parentbad6a90f51a4e66a0c17910ff2791aaa09c564a1 (diff)
downloadotp-7b803c5fbc69458d3e1dba8a88322c2306f77e44.tar.gz
otp-7b803c5fbc69458d3e1dba8a88322c2306f77e44.tar.bz2
otp-7b803c5fbc69458d3e1dba8a88322c2306f77e44.zip
Merge branch 'bjorn/compiler/v3_core-type-fix'
* bjorn/compiler/v3_core-type-fix: Extract annotations from filter qualifiers in a type-friendly way
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/src/v3_core.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 3d9fc3a609..6b9450e481 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -1173,7 +1173,7 @@ preprocess_quals(Line, [Q|Qs0], St0, Acc) ->
{Gen,St} = generator(Line, Q, Gs, St0),
preprocess_quals(Line, Qs, St, [Gen|Acc]);
false ->
- LAnno = #a{anno=lineno_anno(get_anno(Q), St0)},
+ LAnno = #a{anno=lineno_anno(get_qual_anno(Q), St0)},
case is_guard_test(Q) of
true ->
%% When a filter is a guard test, its argument in the
@@ -1198,6 +1198,11 @@ is_generator({generate,_,_,_}) -> true;
is_generator({b_generate,_,_,_}) -> true;
is_generator(_) -> false.
+%% Retrieve the annotation from an Erlang AST form.
+%% (Use get_anno/1 to retrieve the annotation from Core Erlang forms).
+
+get_qual_anno(Abstract) -> element(2, Abstract).
+
%%
%% Generators are abstracted as sextuplets:
%% - acc_pat is the accumulator pattern, e.g. [Pat|Tail] for Pat <- Expr.