Skip to content

Commit 506b230

Browse files
author
Aleksei Matiushkin
committed
Satisfy dialyzer/formatter for 1.11
1 parent 7a57683 commit 506b230

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

.iex.exs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
global_settings = "~/.iex.exs"
2+
if File.exists?(global_settings), do: Code.require_file(global_settings)
3+
4+
Application.put_env(:elixir, :ansi_enabled, true)
5+
6+
IEx.configure(
7+
inspect: [limit: :infinity],
8+
colors: [
9+
eval_result: [:cyan, :bright],
10+
eval_error: [[:red, :bright, "\n▶▶▶\n"]],
11+
eval_info: [:yellow, :bright],
12+
syntax_colors: [
13+
number: :red,
14+
atom: :blue,
15+
string: :green,
16+
boolean: :magenta,
17+
nil: :magenta,
18+
list: :white
19+
]
20+
],
21+
default_prompt:
22+
[
23+
# cursor ⇒ column 1
24+
"\e[G",
25+
:blue,
26+
"%prefix",
27+
:magenta,
28+
"|itr|",
29+
:blue,
30+
"%counter",
31+
" ",
32+
:yellow,
33+
"▶",
34+
:reset
35+
]
36+
|> IO.ANSI.format()
37+
|> IO.chardata_to_string()
38+
)
39+
40+
defmodule S do
41+
defstruct dt: DateTime.utc_now(), map: %{foo: 42, bar: %{baz: 73}}
42+
end
43+
44+
import Iteraptor.AST

lib/iteraptor/ast.ex

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,6 @@ defmodule Iteraptor.AST do
33
`Iteraptor.AST` module traverses AST, allowing `map`, `reduce` and family.
44
"""
55

6-
defp fill_struct(ast, env \\ Macro.escape(__ENV__))
7-
defp fill_struct({:%, _, [{:__aliases__, _, _} = aliases, {:%{}, _, data}]}, env) do
8-
quote do
9-
Kernel.struct!(Macro.struct!(unquote(aliases), unquote(env)), unquote(data))
10-
end
11-
end
12-
defp fill_struct(any, _), do: any
13-
14-
defp fill_destruct({:%, _, [{:__aliases__, _, _} = _aliases, {:%{}, meta, data}]}),
15-
do: {:%{}, meta, data} |> IO.inspect(label: "★★★")
16-
defp fill_destruct(any), do: any |> IO.inspect(label: "☆☆☆")
17-
18-
defmacro do_struct(input), do: fill_struct(input)
19-
defmacro do_destruct(input), do: IO.inspect(Macro.expand(input, __CALLER__))
20-
21-
defmacro destruct(input) do
22-
quote do
23-
att = unquote(input)
24-
Iteraptor.AST.do_destruct(att)
25-
end
26-
end
27-
286
@doc """
297
Mapper for the AST.
308

0 commit comments

Comments
 (0)