aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_lint.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-03-14 14:15:47 +0100
committerHans Bolinder <[email protected]>2017-03-14 14:15:47 +0100
commitdcba34b6295edca4cc9c899152612f410d23c1ef (patch)
tree37d87f0b5189d6056c94d49ce395e96795c986b1 /lib/stdlib/src/erl_lint.erl
parent318e9dfbba306e7b18f2e74d6f468c81e1ac1f57 (diff)
parent568706c4c4b8261e7a63e20be9a355ebe5d6562e (diff)
downloadotp-dcba34b6295edca4cc9c899152612f410d23c1ef.tar.gz
otp-dcba34b6295edca4cc9c899152612f410d23c1ef.tar.bz2
otp-dcba34b6295edca4cc9c899152612f410d23c1ef.zip
Merge branch 'hasse/fix_erl_anno_use'
* hasse/fix_erl_anno_use: parsetools: Fix handling of locations and annotations diameter: Fix handling of locations and annotations kernel: Fix handling of locations and annotations compiler: Fix handling of locations and annotations eunit: Fix handling of locations and annotations Update preloaded erts: Fix handling of locations and annotations dialyzer: Fix handling of annotations in a test debugger: Fix handling of locations and annotations stdlib: Extend functions in erl_parse to handle form_info() stdlib: Fix handling of locations and annotations erts: Correct the documentation of abstract end-of-file stdlib: Add debug tests to the erl_parse module stdlib: improve the erl_anno module's debug tests stdlib: Improve the erl_pp module's debug tests
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r--lib/stdlib/src/erl_lint.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 1b84234fac..0ffca0886f 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -737,7 +737,12 @@ start_state({attribute,_,module,M}, St0) ->
St1 = St0#lint{module=M},
St1#lint{state=attribute};
start_state(Form, St) ->
- St1 = add_error(element(2, Form), undefined_module, St),
+ Anno = case Form of
+ {eof, L} -> erl_anno:new(L);
+ %% {warning, Warning} and {error, Error} not possible here.
+ _ -> element(2, Form)
+ end,
+ St1 = add_error(Anno, undefined_module, St),
attribute_state(Form, St1#lint{state=attribute}).
%% attribute_state(Form, State) ->