Skip to content

Commit a48c2d5

Browse files
committed
Remove deprecated code and add TODOs
1 parent 65ffb5d commit a48c2d5

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

lib/elixir/lib/code/formatter.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ defmodule Code.Formatter do
289289
end
290290
end
291291

292+
# TODO: Remove this clause on Elixir v2.0 once single-quoted charlists are removed
292293
defp quoted_to_algebra(
293294
{{:., _, [List, :to_charlist]}, meta, [entries]} = quoted,
294295
context,
@@ -2224,6 +2225,7 @@ defmodule Code.Formatter do
22242225
(not interpolated?(entries) and eol_or_comments?(meta, state))
22252226
end
22262227

2228+
# TODO: Remove this clause on Elixir v2.0 once single-quoted charlists are removed
22272229
defp next_break_fits?({{:., _, [List, :to_charlist]}, meta, [[_ | _]]}, _state) do
22282230
meta[:delimiter] == ~s[''']
22292231
end

lib/elixir/lib/code/normalizer.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ defmodule Code.Normalizer do
9696
end
9797

9898
# Charlists with interpolations
99+
# TODO: Remove this clause on Elixir v2.0 once single-quoted charlists are removed
99100
defp do_normalize({{:., dot_meta, [List, :to_charlist]}, call_meta, [parts]} = quoted, state) do
100101
if list_interpolated?(parts) do
101102
parts =

lib/elixir/test/elixir/code_normalizer/quoted_ast_test.exs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -688,28 +688,6 @@ defmodule Code.Normalizer.QuotedASTTest do
688688
assert quoted_to_string(~c"\x00\x01\x10") == ~S/[0, 1, 16]/
689689
end
690690

691-
test "charlists with interpolations" do
692-
# using string_to_quoted to avoid the formatter fixing the charlists
693-
694-
assert Code.string_to_quoted!(~S/'one #{2} three'/) |> quoted_to_string(escape: false) ==
695-
~S/~c"one #{2} three"/
696-
697-
assert Code.string_to_quoted!(~S/'one #{2} three'/) |> quoted_to_string() ==
698-
~S/~c"one #{2} three"/
699-
700-
assert Code.string_to_quoted!(~S/'one\n\'#{2}\'\nthree'/) |> quoted_to_string(escape: false) ==
701-
~s[~c"one\n'\#{2}'\nthree"]
702-
703-
assert Code.string_to_quoted!(~S/'one\n\'#{2}\'\nthree'/) |> quoted_to_string() ==
704-
~S[~c"one\n'#{2}'\nthree"]
705-
706-
assert Code.string_to_quoted!(~S/'one\n"#{2}"\nthree'/) |> quoted_to_string(escape: false) ==
707-
~s[~c"one\n\\"\#{2}\\"\nthree"]
708-
709-
assert Code.string_to_quoted!(~S/'one\n"#{2}"\nthree'/) |> quoted_to_string() ==
710-
~S[~c"one\n\"#{2}\"\nthree"]
711-
end
712-
713691
test "atoms" do
714692
assert quoted_to_string(quote(do: :"a\nb\tc"), escape: false) == ~s/:"a\nb\tc"/
715693
assert quoted_to_string(quote(do: :"a\nb\tc")) == ~S/:"a\nb\tc"/

0 commit comments

Comments
 (0)