aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_core.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2010-02-05 16:43:30 +0100
committerBjörn Gustavsson <[email protected]>2010-02-10 10:43:10 +0100
commita612e99fb5aaa934fe5a8591db0f083d7fa0b20a (patch)
tree51c9139b885bff3fed3d104263a18930e16dd734 /lib/compiler/src/v3_core.erl
parent054b4fdf69fbbdf4e47b555b4c73f524fc3eeec2 (diff)
downloadotp-a612e99fb5aaa934fe5a8591db0f083d7fa0b20a.tar.gz
otp-a612e99fb5aaa934fe5a8591db0f083d7fa0b20a.tar.bz2
otp-a612e99fb5aaa934fe5a8591db0f083d7fa0b20a.zip
compiler: keep line numbers for attributes
In the future, we might want to generate warnings for attributes, referring to them with line numbers. sys_pre_expand used to replace line number for attributes with 0. Change sys_pre_expand to retain the real line number. v3_core used to throw away the line numbers. Change v3_core so that it retains the line numbers in annotations. While at it, do some tidying as suggested by tidier.
Diffstat (limited to 'lib/compiler/src/v3_core.erl')
-rw-r--r--lib/compiler/src/v3_core.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index a39a3c538f..746fce7578 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -164,8 +164,8 @@ form({attribute,_,file,{File,_Line}}, {Fs,As,Es,Ws,_}, _Opts) ->
form({attribute,_,_,_}=F, {Fs,As,Es,Ws,File}, _Opts) ->
{Fs,[attribute(F)|As],Es,Ws,File}.
-attribute({attribute,_,Name,Val}) ->
- {#c_literal{val=Name},#c_literal{val=Val}}.
+attribute({attribute,Line,Name,Val}) ->
+ {#c_literal{val=Name, anno=[Line]}, #c_literal{val=Val, anno=[Line]}}.
function({function,_,Name,Arity,Cs0}, Es0, Ws0, File, Opts) ->
%%ok = io:fwrite("~p - ", [{Name,Arity}]),