@@ -164,8 +164,8 @@ defmodule Macro do
164164
165165 @ doc % B """
166166 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.
169169
170170 ## Map
171171
@@ -211,19 +211,21 @@ defmodule Macro do
211211
212212 @ doc """
213213 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.
219221 """
220222 def unescape_tokens( tokens) do
221223 :elixir_interpolation . unescape_tokens ( tokens )
222224 end
223225
224226 @ doc """
225227 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.
227229 """
228230 def unescape_tokens ( tokens , map ) do
229231 :elixir_interpolation . unescape_tokens ( tokens , map )
@@ -597,16 +599,16 @@ defmodule Macro do
597599 do_safe_term ( terms ) || :ok
598600 end
599601
600- def do_safe_term ( { local , _ , terms } ) when local in [ :{} , :[ ] , :__aliases__ ] do
602+ defp do_safe_term ( { local , _ , terms } ) when local in [ :{} , :[ ] , :__aliases__ ] do
601603 do_safe_term ( terms )
602604 end
603605
604- def do_safe_term ( { unary , _ , [ term ] } ) when unary in [ :+ , :- ] do
606+ defp do_safe_term ( { unary , _ , [ term ] } ) when unary in [ :+ , :- ] do
605607 do_safe_term ( term )
606608 end
607609
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
612614end
0 commit comments