Skip to content

Commit 265b9aa

Browse files
committed
Update AST metadata documentation (#14120)
1 parent b9bd0e3 commit 265b9aa

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/elixir/lib/macro.ex

Lines changed: 9 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,18 @@ 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.
164+
It may also be set to `:atom` to distinguish `nil`, `false`, and `true`
163165
164166
* `:indentation` - indentation of a sigil heredoc
165167
168+
* `:parens` - denotes a node was surrounded by parens for grouping.
169+
This entry may appear multiple times in the same metadata if
170+
multiple pairs are used for grouping
171+
166172
The following metadata keys are private:
167173
168174
* `:alias` - Used for alias hygiene.

0 commit comments

Comments
 (0)