 
   # 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.

  @doc """
  Digits in a bare array. Sets number context.
  """
  def parse(<<n, t::binary>>, [:array | context], output) when n in ?0..?9 do
    debug "Found digit while in array: #{<<n>>}", t, context, output
    parse(t, [:number, :array | context], output <> <<n>>)
  end

  @doc """
  Exponent followed by a digit during a decimal context.
  """
  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
