Skip to content

Commit 415d464

Browse files
committed
Remove invalid escaping of sigils, closes #10864
1 parent 91344a2 commit 415d464

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/elixir/lib/macro.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,6 @@ defmodule Macro do
10871087
"\#{" <> to_string(arg, fun) <> "}"
10881088

10891089
binary when is_binary(binary) ->
1090-
binary = inspect_no_limit(binary)
1091-
binary = binary_part(binary, 1, byte_size(binary) - 2)
10921090
escape_sigil(binary, left)
10931091
end)
10941092

lib/elixir/test/elixir/macro_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,12 @@ defmodule MacroTest do
327327

328328
test "sigil call" do
329329
assert Macro.to_string(quote(do: ~r"123")) == ~S/~r"123"/
330-
assert Macro.to_string(quote(do: ~r"\n123")) == ~S/~r"\\n123"/
331-
assert Macro.to_string(quote(do: ~r"12\"3")) == ~S/~r"12\\"3"/
330+
assert Macro.to_string(quote(do: ~r"\n123")) == ~S/~r"\n123"/
331+
assert Macro.to_string(quote(do: ~r"12\"3")) == ~S/~r"12\"3"/
332332
assert Macro.to_string(quote(do: ~r/12\/3/u)) == ~S"~r/12\/3/u"
333-
assert Macro.to_string(quote(do: ~r{\n123})) == ~S/~r{\\n123}/
333+
assert Macro.to_string(quote(do: ~r{\n123})) == ~S/~r{\n123}/
334334
assert Macro.to_string(quote(do: ~r((1\)(2\)3))) == ~S/~r((1\)(2\)3)/
335-
assert Macro.to_string(quote(do: ~r{\n1{1\}23})) == ~S/~r{\\n1{1\}23}/
335+
assert Macro.to_string(quote(do: ~r{\n1{1\}23})) == ~S/~r{\n1{1\}23}/
336336
assert Macro.to_string(quote(do: ~r|12\|3|)) == ~S"~r|12\|3|"
337337

338338
assert Macro.to_string(quote(do: ~r[1#{two}3])) == ~S/~r[1#{two}3]/

0 commit comments

Comments
 (0)