     {result, data, pos}
   end
 
-  defp exponential(<<@minus_sign>> <> data, pos, chars, :exp),
-    do: exponential(data, pos + 1, [chars, @minus_sign], :minus)
+  defp exponential(<<?->> <> data, pos, chars, :exp),
+    do: exponential(data, pos + 1, [chars, ?-], :minus)
   defp exponential(<<char>> <> data, pos, chars, _last)
     when char in @digits,
     do: exponential(data, pos + 1, [chars, char], :digit)

  end

  defp json(<<char>> <> data, pos)
    when char in @whitespace,
    do: json(data, pos + 1)
  defp json(<<char>> <> data, pos)
    when char == @quotation_mark,
    do: string(data, pos + 1, [])
  defp json(<<char>> <> data, pos)
    when char == @left_square_bracket,
    do: list(data, pos + 1, [])
  defp json(<<char>> <> data, pos)
    when char == @left_curly_bracket,
    do: map(data, pos + 1, [])
  defp json(<<char>> <> data, pos)
    when char in '-0123456789',
    do: number(data, pos + 1, [char], (if char == ?-, do: :minus, else: :digit))
  defp json(<<"true">> <> data, pos),
    do: {true, data, pos + 4}
  defp json(<<"false">> <> data, pos),
    do: {false, data, pos + 5}
  defp json(<<"null">> <> data, pos),
    do: {nil, data, pos + 4}
  defp json(_data, pos),
    do: throw {:json, pos + 1}

  defp key(<<char>> <> data, pos)
    when char in @whitespace,
    do: key(data, pos + 1)
  defp key(<<char>> <> data, pos)
    when char == @quotation_mark,
    do: string(data, pos + 1, [])
  defp key(_data, pos),
    do: throw {:key, pos}

    do: throw{:list, pos}

  defp map(<<char>> <> data, pos, list)
    when char in @whitespaces,
    do: map(data,  pos + 1, list)
  defp map(<<?}>> <> data, pos, list) do
    result = for [value, key] <- Enum.chunk(list, 2), into: %{}, do: {key, value}
    {result, data, pos + 1}
  end
  defp map(<<?,>> <> _data, pos, []),
    do: throw {:map, pos + 1}
  defp map(<<?,>> <> data, pos, list) do
    {result, data, pos} = key(data, pos + 1)
    map(data, pos + 1, [result|list])
  end
  defp map(<<?:>> <> _data, pos, []),
    do: throw {:map, pos + 1}
  defp map(<<?:>> <> data, pos, list) do
    {result, data, pos} = json(data, pos + 1)
    map(data, pos + 1, [result|list])
  end
