1erl_id_trans(3) Erlang Module Definition erl_id_trans(3)
2
3
4
6 erl_id_trans - An identity parse transform.
7
9 This module performs an identity parse transformation of Erlang code.
10 It is included as an example for users who wants to write their own
11 parse transformers. If option {parse_transform,Module} is passed to the
12 compiler, a user-written function parse_transform/2 is called by the
13 compiler before the code is checked for errors.
14
15 Before the function parse_transform is called, the Erlang Compiler
16 checks if the parse transformation can handle abstract code with column
17 numbers: If the function parse_transform_info/0 is implemented and re‐
18 turns a map where the key error_location is associated with the value
19 line, the compiler removes column numbers from the abstract code before
20 calling the parse transform. Otherwise, the compiler passes the ab‐
21 stract code on without modification.
22
24 parse_transform(Forms, Options) -> Forms
25
26 Types:
27
28 Forms = [erl_parse:abstract_form() | erl_parse:form_info()]
29 Options = [compile:option()]
30
31 Performs an identity transformation on Erlang forms, as an exam‐
32 ple.
33
34 parse_transform_info() -> Info
35
36 Types:
37
38 Info = #{'error_location' => 'column' | 'line'}
39
40 Returns information about the parse transform itself.
41
43 Parse transformations are used if a programmer wants to use Erlang syn‐
44 tax, but with different semantics. The original Erlang code is then
45 transformed into other Erlang code.
46
47 Note:
48 Programmers are strongly advised not to engage in parse transforma‐
49 tions. No support is offered for problems encountered.
50
51
53 erl_parse(3), compile(3)
54
55
56
57Ericsson AB stdlib 3.17.2 erl_id_trans(3)