Skip to content

Commit

Permalink
Fix type formatting for empty bitstring and operators
Browse files Browse the repository at this point in the history
  • Loading branch information
Blatts12 committed Oct 10, 2023
1 parent 395c9b9 commit 8e8ad4f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/contexted/module_analyzer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ defmodule Contexted.ModuleAnalyzer do
defp format_type({:type, _, :range, [{:integer, _, from}, {:integer, _, to}]}, _module),
do: "#{from}..#{to}"

defp format_type({:type, _, :binary, [{:integer, _, 0}, {:integer, _, 0}]}, _module),
do: "<<>>"

defp format_type({:type, _, :binary, [{:integer, _, size}, {:integer, _, 0}]}, _module),
do: "<<_::#{size}>>"

Expand All @@ -126,6 +129,8 @@ defmodule Contexted.ModuleAnalyzer do

defp format_type({:type, _, type_name, _}, _module), do: "#{type_name}()"

defp format_type({:op, _, operator, type}, module), do: "#{operator}#{format_type(type, module)}"

defp format_type({:integer, _, integer}, _module), do: "#{integer}"

defp format_type({:user_type, _, atom, _}, module) do
Expand Down

0 comments on commit 8e8ad4f

Please sign in to comment.