Commit cbfe0a31 authored by Sean DuBois's avatar Sean DuBois

Implement the \x86 TUPLE2 opcode for decoding, operation 'Build a two-tuple

out of the top two items on the stack.'
parent eb26998f
......@@ -205,6 +205,8 @@ func (d Decoder) Decode() (interface{}, error) {
err = d.loadSetItem()
case opTuple:
err = d.loadTuple()
case opTuple2:
err = d.loadTuple2()
case opEmptyTuple:
d.push([]interface{}{})
case opSetitems:
......@@ -607,6 +609,13 @@ func (d *Decoder) loadTuple() error {
return nil
}
func (d *Decoder) loadTuple2() error {
k := d.marker()
v := append([]interface{}{}, d.stack[k:]...)
d.stack = append(d.stack[:k], v)
return nil
}
func (d *Decoder) obj() error {
return errNotImplemented
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment