Skip to content

Commit

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

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

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

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

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

0 comments on commit 395c9b9

Please sign in to comment.