@@ -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
@@ -357,13 +357,13 @@ defmodule Macro do
357
357
358
358
* Macros (local or remote);
359
359
* Aliases are expanded (if possible) and return atoms;
360
- * All pseudo-variables (__FILE__, __MODULE__, etc);
361
- * Module attributes reader (@foo);
360
+ * All pseudo-variables (` __FILE__`, ` __MODULE__` , etc);
361
+ * Module attributes reader (` @foo` );
362
362
363
363
In case the expression cannot be expanded, it returns the expression
364
- itself. Notice that `Macro. expand_once/2` performs the expansion just
365
- once and it is not recursive. Check `Macro. expand/2` for expansion
366
- until the node no longer represents a macro and `Macro. expand_all/2`
364
+ itself. Notice that `expand_once/2` performs the expansion just
365
+ once and it is not recursive. Check `expand/2` for expansion
366
+ until the node no longer represents a macro and `expand_all/2`
367
367
for recursive expansion.
368
368
369
369
## Examples
@@ -526,8 +526,8 @@ defmodule Macro do
526
526
527
527
@ doc """
528
528
Receives a AST node and expands it until it no longer represents
529
- a macro. Check `Macro. expand_once/2` for more information on how
530
- expansion works and `Macro. expand_all/2` for recursive expansion.
529
+ a macro. Check `expand_once/2` for more information on how
530
+ expansion works and `expand_all/2` for recursive expansion.
531
531
"""
532
532
def expand ( tree , env ) do
533
533
expand ( tree , env , nil ) |> elem ( 0 )
@@ -550,16 +550,16 @@ defmodule Macro do
550
550
Receives a AST node and expands it until it no longer represents
551
551
a macro. Then it expands all of its children recursively.
552
552
553
- The documentation for `Macro. expand_once/2` goes into more detail
554
- on how expansion works. Keep in mind that `Macro. expand_all/2` is
553
+ The documentation for `expand_once/2` goes into more detail
554
+ on how expansion works. Keep in mind that `expand_all/2` is
555
555
naive as it doesn't mutate the environment. Take this example:
556
556
557
557
quoted = quote do: __MODULE__
558
558
Macro.to_string Macro.expand_all(quoted, __ENV__)
559
559
#=> "nil"
560
560
561
561
The example above, works as expected. Outside of a module,
562
- `__MODULE__` returns nil. Now consider this variation:
562
+ `__MODULE__` returns ` nil` . Now consider this variation:
563
563
564
564
quoted = quote do
565
565
defmodule Foo, do: __MODULE__
@@ -604,8 +604,8 @@ defmodule Macro do
604
604
end
605
605
606
606
@ doc """
607
- Recurs the quoted expression checking if all sub terms are
608
- safe (i.e. they represented data structured and don't actually
607
+ Recurs the quoted expression checking if all sub- terms are
608
+ safe (i.e. they represent data structures and don't actually
609
609
evaluate code) and returns `:ok` unless a given term is unsafe,
610
610
which is returned as `{ :unsafe, term }`.
611
611
"""
0 commit comments