@@ -32,7 +32,7 @@ defmodule Macro do
32
32
a valid call syntax.
33
33
34
34
This is useful for macros that want to provide the same
35
- arguments syntax available in def/defp/defmacro and friends.
35
+ argument syntax available in def/defp/defmacro and friends.
36
36
37
37
## Examples
38
38
@@ -50,7 +50,7 @@ defmodule Macro do
50
50
Recursively escapes a value so it can be inserted
51
51
into a syntax tree.
52
52
53
- One may pass `unquote: true` to `Macro. escape/2`
53
+ One may pass `unquote: true` to `escape/2`
54
54
which leaves unquote statements unescaped, effectively
55
55
unquoting the contents on escape.
56
56
@@ -118,7 +118,7 @@ defmodule Macro do
118
118
def unescape_map(?v), do: ?\v
119
119
def unescape_map(e), do: e
120
120
121
- If the `unescape_map` function returns false. The char is
121
+ If the `unescape_map` function returns ` false` . The char is
122
122
not escaped and `\` is kept in the char list.
123
123
124
124
## Octals
@@ -128,7 +128,7 @@ defmodule Macro do
128
128
129
129
## Hex
130
130
131
- Octals will by default be escaped unless the map function
131
+ Hexadecimals will by default be escaped unless the map function
132
132
returns false for ?x.
133
133
134
134
## Examples
@@ -354,13 +354,13 @@ defmodule Macro do
354
354
355
355
* Macros (local or remote);
356
356
* Aliases are expanded (if possible) and return atoms;
357
- * All pseudo-variables (__FILE__, __MODULE__, etc);
358
- * Module attributes reader (@foo);
357
+ * All pseudo-variables (` __FILE__`, ` __MODULE__` , etc);
358
+ * Module attributes reader (` @foo` );
359
359
360
360
In case the expression cannot be expanded, it returns the expression
361
- itself. Notice that `Macro. expand_once/2` performs the expansion just
362
- once and it is not recursive. Check `Macro. expand/2` for expansion
363
- until the node no longer represents a macro and `Macro. expand_all/2`
361
+ itself. Notice that `expand_once/2` performs the expansion just
362
+ once and it is not recursive. Check `expand/2` for expansion
363
+ until the node no longer represents a macro and `expand_all/2`
364
364
for recursive expansion.
365
365
366
366
## Examples
@@ -523,8 +523,8 @@ defmodule Macro do
523
523
524
524
@ doc """
525
525
Receives a AST node and expands it until it no longer represents
526
- a macro. Check `Macro. expand_once/2` for more information on how
527
- expansion works and `Macro. expand_all/2` for recursive expansion.
526
+ a macro. Check `expand_once/2` for more information on how
527
+ expansion works and `expand_all/2` for recursive expansion.
528
528
"""
529
529
def expand ( tree , env ) do
530
530
expand ( tree , env , nil ) |> elem ( 0 )
@@ -547,16 +547,16 @@ defmodule Macro do
547
547
Receives a AST node and expands it until it no longer represents
548
548
a macro. Then it expands all of its children recursively.
549
549
550
- The documentation for `Macro. expand_once/2` goes into more detail
551
- on how expansion works. Keep in mind that `Macro. expand_all/2` is
550
+ The documentation for `expand_once/2` goes into more detail
551
+ on how expansion works. Keep in mind that `expand_all/2` is
552
552
naive as it doesn't mutate the environment. Take this example:
553
553
554
554
quoted = quote do: __MODULE__
555
555
Macro.to_string Macro.expand_all(quoted, __ENV__)
556
556
#=> "nil"
557
557
558
558
The example above, works as expected. Outside of a module,
559
- `__MODULE__` returns nil. Now consider this variation:
559
+ `__MODULE__` returns ` nil` . Now consider this variation:
560
560
561
561
quoted = quote do
562
562
defmodule Foo, do: __MODULE__
@@ -601,8 +601,8 @@ defmodule Macro do
601
601
end
602
602
603
603
@ doc """
604
- Recurs the quoted expression checking if all sub terms are
605
- safe (i.e. they represented data structured and don't actually
604
+ Recurs the quoted expression checking if all sub- terms are
605
+ safe (i.e. they represent data structures and don't actually
606
606
evaluate code) and returns `:ok` unless a given term is unsafe,
607
607
which is returned as `{ :unsafe, term }`.
608
608
"""
0 commit comments