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) { ...@@ -205,6 +205,8 @@ func (d Decoder) Decode() (interface{}, error) {
err = d.loadSetItem() err = d.loadSetItem()
case opTuple: case opTuple:
err = d.loadTuple() err = d.loadTuple()
case opTuple2:
err = d.loadTuple2()
case opEmptyTuple: case opEmptyTuple:
d.push([]interface{}{}) d.push([]interface{}{})
case opSetitems: case opSetitems:
...@@ -607,6 +609,13 @@ func (d *Decoder) loadTuple() error { ...@@ -607,6 +609,13 @@ func (d *Decoder) loadTuple() error {
return nil 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 { func (d *Decoder) obj() error {
return errNotImplemented 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