Skip to content

Commit 91344a2

Browse files
eksperimentaljosevalim
authored andcommitted
Format source code with new rules
1 parent 5fbdee2 commit 91344a2

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

lib/elixir/lib/code/formatter.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule Code.Formatter do
1313
@ampersand_prec Code.Identifier.unary_op(:&) |> elem(1)
1414

1515
# Operators that are composed of multiple binary operators
16-
@multi_binary_operators [:..//]
16+
@multi_binary_operators [:"..//"]
1717

1818
# Operators that do not have space between operands
1919
@no_space_binary_operators [:.., :"//"]
@@ -516,7 +516,7 @@ defmodule Code.Formatter do
516516
end
517517

518518
# 1..2//3
519-
defp quoted_to_algebra({:..//, meta, [left, middle, right]}, context, state) do
519+
defp quoted_to_algebra({:"..//", meta, [left, middle, right]}, context, state) do
520520
quoted_to_algebra({:"//", meta, [{:.., meta, [left, middle]}, right]}, context, state)
521521
end
522522

lib/elixir/lib/code/identifier.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ defmodule Code.Identifier do
8383
charlist = Atom.to_charlist(atom)
8484

8585
cond do
86-
atom in [:%, :%{}, :{}, :<<>>, :..., :.., :., :..//, :->] ->
86+
atom in [:%, :%{}, :{}, :<<>>, :..., :.., :., :"..//", :->] ->
8787
:not_callable
8888

8989
atom in [:"::", :"//"] ->

lib/elixir/lib/exception.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ defmodule Exception do
253253
defp rewrite_arg(arg) do
254254
Macro.prewalk(arg, fn
255255
{:%{}, meta, [__struct__: Range, first: first, last: last, step: step]} ->
256-
{:..//, meta, [first, last, step]}
256+
{:"..//", meta, [first, last, step]}
257257

258258
other ->
259259
other

lib/elixir/lib/macro.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ defmodule Macro do
11431143
:error
11441144
end
11451145

1146-
defp op_call({:..//, _, [left, middle, right]} = ast, fun) do
1146+
defp op_call({:"..//", _, [left, middle, right]} = ast, fun) do
11471147
left = op_to_string(left, fun, :.., :left)
11481148
middle = op_to_string(middle, fun, :.., :right)
11491149
right = op_to_string(right, fun, :"//", :right)

lib/elixir/test/elixir/kernel/parser_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ defmodule Kernel.ParserTest do
1717

1818
describe "ternary ops" do
1919
test "root" do
20-
assert parse!("1..2//3") == {:..//, [line: 1], [1, 2, 3]}
21-
assert parse!("(1..2)//3") == {:..//, [line: 1], [1, 2, 3]}
20+
assert parse!("1..2//3") == {:"..//", [line: 1], [1, 2, 3]}
21+
assert parse!("(1..2)//3") == {:"..//", [line: 1], [1, 2, 3]}
2222
end
2323

2424
test "with do-blocks" do
2525
assert parse!("foo do end..bar do end//baz do end") == {
26-
:..//,
26+
:"..//",
2727
[line: 1],
2828
[
2929
{:foo, [line: 1], [[do: {:__block__, [], []}]]},
@@ -35,7 +35,7 @@ defmodule Kernel.ParserTest do
3535

3636
test "with no parens" do
3737
assert parse!("1..foo do end//bar bat, baz") == {
38-
:..//,
38+
:"..//",
3939
[line: 1],
4040
[
4141
1,

0 commit comments

Comments
 (0)