module Spring::OkJson

def textparse(ts)

except that it does not accept atomic values.
Note: this is almost the same as valparse,
Returns the parsed value and any trailing tokens.
Parses a "json text" in the sense of RFC 4627.
def textparse(ts)
  if ts.length <= 0
    raise Error, 'empty'
  end
  typ, _, val = ts[0]
  case typ
  when '{' then objparse(ts)
  when '[' then arrparse(ts)
  else
    raise Error, "unexpected #{val.inspect}"
  end
end