Skip to content

Commit 20df823

Browse files
authored
Better document AST metadata in Macro
1 parent 2567938 commit 20df823

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/elixir/lib/macro.ex

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ defmodule Macro do
146146
* `:delimiter` - contains the opening delimiter for sigils, strings,
147147
and charlists as a string (such as `"{"`, `"/"`, `"'"`, and the like)
148148
149-
* `:format` - set to `:keyword` when an atom is defined as a keyword
150-
151149
* `:do` - contains metadata about the `do` location in a function call with
152150
`do`-`end` blocks (when `:token_metadata` is true)
153151
@@ -159,10 +157,17 @@ defmodule Macro do
159157
expressions inside "blocks of code", which are either direct children
160158
of a `__block__` or the right side of `->`. The last expression of the
161159
block does not have metadata if it is not followed by an end of line
162-
character (either a newline or `;`)
160+
character (either a newline or `;`). This entry may appear multiple times
161+
in the same metadata if the expression is surround by parens
162+
163+
* `:format` - set to `:keyword` when an atom is defined as a keyword
163164
164165
* `:indentation` - indentation of a sigil heredoc
165166
167+
* `:parens` - denote a node was surrounded by parens for grouping.
168+
This entry may appear multiple times in the same metadata if
169+
multiple pairs are used for grouping
170+
166171
The following metadata keys are private:
167172
168173
* `:alias` - Used for alias hygiene.

0 commit comments

Comments
 (0)