   @doc """
   Exponent followed by a digit during a decimal context.
   """
-  def parse(<<?e, n, t::binary>>, [:decimal | context], output) when n in ?0..?9 do
+  def parse(<<?e, n, t::binary>>, [:decimal | context], output) when n in @digits do
     debug "Found exponent and digit #{<<n>>} during a decimal context, dropping decimal context and adding exponent context", t, context, output
     parse(t, [:exponent | context], output <> <<?e, n>>)
   end

  @doc """
  Drop decimal context if no more digits.
  """
  def parse(<<n, t::binary>>, [:decimal | context], output) when not n in ?0..?9 do
    debug "Dropping decimal context", t, context, output
    parse(<<n>> <> t, context, output)
  end


  # just for reference mainly
  @contexts { :string, :number, :decimal, :exponent, :array, :object, :pair, :key, :value, :boolean }
  @whitespace '\s\n\t\r'
  @number_start '-0123456789'
  @digits ?0..?9

  @doc """
  The entry point. A "value" is expected, so that context is pushed onto the stack.
