@@ -164,8 +164,8 @@ defmodule Macro do
164
164
165
165
@ doc % B """
166
166
Unescape the given chars according to the map given.
167
- Check `unescape /1` if you want to use the same map as
168
- Elixir single- and double-quoted strings.
167
+ Check `unescape_binary /1` if you want to use the same map
168
+ as Elixir single- and double-quoted strings.
169
169
170
170
## Map
171
171
@@ -211,19 +211,21 @@ defmodule Macro do
211
211
212
212
@ doc """
213
213
Unescape the given tokens according to the default map.
214
- Check `unescape/1` and `unescape/2` for more information
215
- about unescaping. Only tokens that are binaries are
216
- unescaped, all others are ignored. This function is useful
217
- when implementing your own sigils. Check the implementation
218
- of `Kernel.__b__` for examples.
214
+ Check `unescape_binary/1` and `unescape_binary/2` for more
215
+ information about unescaping.
216
+
217
+ Only tokens that are binaries are unescaped, all others are
218
+ ignored. This function is useful when implementing your own
219
+ sigils. Check the implementation of `Kernel.__b__`
220
+ for examples.
219
221
"""
220
222
def unescape_tokens( tokens) do
221
223
:elixir_interpolation . unescape_tokens ( tokens )
222
224
end
223
225
224
226
@ doc """
225
227
Unescape the given tokens according to the given map.
226
- Check `unescape_tokens/1` and `unescaped /2` for more information.
228
+ Check `unescape_tokens/1` and `unescape_binary /2` for more information.
227
229
"""
228
230
def unescape_tokens ( tokens , map ) do
229
231
:elixir_interpolation . unescape_tokens ( tokens , map )
@@ -597,16 +599,16 @@ defmodule Macro do
597
599
do_safe_term ( terms ) || :ok
598
600
end
599
601
600
- def do_safe_term ( { local , _ , terms } ) when local in [ :{} , :[ ] , :__aliases__ ] do
602
+ defp do_safe_term ( { local , _ , terms } ) when local in [ :{} , :[ ] , :__aliases__ ] do
601
603
do_safe_term ( terms )
602
604
end
603
605
604
- def do_safe_term ( { unary , _ , [ term ] } ) when unary in [ :+ , :- ] do
606
+ defp do_safe_term ( { unary , _ , [ term ] } ) when unary in [ :+ , :- ] do
605
607
do_safe_term ( term )
606
608
end
607
609
608
- def do_safe_term ( { left , right } ) , do: do_safe_term ( left ) || do_safe_term ( right )
609
- def do_safe_term ( terms ) when is_list ( terms ) , do: Enum . find_value ( terms , do_safe_term ( & 1 ) )
610
- def do_safe_term ( terms ) when is_tuple ( terms ) , do: { :unsafe , terms }
611
- def do_safe_term ( _ ) , do: nil
610
+ defp do_safe_term ( { left , right } ) , do: do_safe_term ( left ) || do_safe_term ( right )
611
+ defp do_safe_term ( terms ) when is_list ( terms ) , do: Enum . find_value ( terms , do_safe_term ( & 1 ) )
612
+ defp do_safe_term ( terms ) when is_tuple ( terms ) , do: { :unsafe , terms }
613
+ defp do_safe_term ( _ ) , do: nil
612
614
end
0 commit comments