Method: Transcriptic::OkJson#pairparse

Defined in:
lib/vendor/okjson.rb

#pairparse(ts) ⇒ Object

Parses a “member” in the sense of RFC 4627. Returns the parsed value and any trailing tokens.



120
121
122
123
124
125
126
127
128
# File 'lib/vendor/okjson.rb', line 120

def pairparse(ts)
  (typ, _, k), ts = ts[0], ts[1..-1]
  if typ != :str
    raise Transcriptic::OkJson::ParserError, "unexpected #{k.inspect}"
  end
  ts = eat(':', ts)
  v, ts = valparse(ts)
  [k, v, ts]
end