Remove invalid escaping of sigils, closes #10864

This commit is contained in:
José Valim
2021-04-02 23:14:38 +02:00
parent 91344a24a8
commit 415d4647c4
2 changed files with 4 additions and 6 deletions
-2
View File
@@ -1087,8 +1087,6 @@ defmodule Macro do
"\#{" <> to_string(arg, fun) <> "}"
binary when is_binary(binary) ->
binary = inspect_no_limit(binary)
binary = binary_part(binary, 1, byte_size(binary) - 2)
escape_sigil(binary, left)
end)
+4 -4
View File
@@ -327,12 +327,12 @@ defmodule MacroTest do
test "sigil call" do
assert Macro.to_string(quote(do: ~r"123")) == ~S/~r"123"/
assert Macro.to_string(quote(do: ~r"\n123")) == ~S/~r"\\n123"/
assert Macro.to_string(quote(do: ~r"12\"3")) == ~S/~r"12\\"3"/
assert Macro.to_string(quote(do: ~r"\n123")) == ~S/~r"\n123"/
assert Macro.to_string(quote(do: ~r"12\"3")) == ~S/~r"12\"3"/
assert Macro.to_string(quote(do: ~r/12\/3/u)) == ~S"~r/12\/3/u"
assert Macro.to_string(quote(do: ~r{\n123})) == ~S/~r{\\n123}/
assert Macro.to_string(quote(do: ~r{\n123})) == ~S/~r{\n123}/
assert Macro.to_string(quote(do: ~r((1\)(2\)3))) == ~S/~r((1\)(2\)3)/
assert Macro.to_string(quote(do: ~r{\n1{1\}23})) == ~S/~r{\\n1{1\}23}/
assert Macro.to_string(quote(do: ~r{\n1{1\}23})) == ~S/~r{\n1{1\}23}/
assert Macro.to_string(quote(do: ~r|12\|3|)) == ~S"~r|12\|3|"
assert Macro.to_string(quote(do: ~r[1#{two}3])) == ~S/~r[1#{two}3]/