uwiger / parse_trans

Parse transform utilities for Erlang
Apache License 2.0
230 stars 118 forks source link

Handle annotations and locations better #42

Closed uabboli closed 3 years ago

uabboli commented 3 years ago

This PR is one of several affecting repositories on Github. It aims at fixing bad use of annotations (see erl_anno(3)). The following remarks are common to all PR:s.

Typically the second element of abstract code tuples is assumed to be an integer, which is no longer always true. For instance, the parse transform implementing QLC tables (see qlc(3)) returns code where some annotations are marked as `generated'. Such an annotation is a list, not an integer (it used to be a negative integer).

As of Erlang/OTP 24.0, the location can be a tuple {Line, Column}, which is another reason to handle annotations properly.

paulo-ferraz-oliveira commented 3 years ago

Once this is accepted could parse_trans be tagged? I'm compiling stuff in preparation for OTP 24 and parse_trans is base for many. Thanks.

paulo-ferraz-oliveira commented 3 years ago

Hm... this only improves the parse_trans code, right @uabboli? I still get issues when e.g. parse_trans is used inside jobs.

Edit: I created a pull request to keep previous behaviour from breaking.