setAnyKey assigns the value of a key-value into the native map m, following the (possibly dotted) key and creating intermediate maps as needed.
(m map[string]interface{}, key unstable.Iterator, value *unstable.Node)
| 559 | // setAnyKey assigns the value of a key-value into the native map m, following |
| 560 | // the (possibly dotted) key and creating intermediate maps as needed. |
| 561 | func (d *decoder) setAnyKey(m map[string]interface{}, key unstable.Iterator, value *unstable.Node) error { |
| 562 | cur := m |
| 563 | for key.Next() { |
| 564 | name := d.intern(key.Node().Data) |
| 565 | if key.IsLast() { |
| 566 | av, err := d.decodeAny(value) |
| 567 | if err != nil { |
| 568 | return err |
| 569 | } |
| 570 | cur[name] = av |
| 571 | return nil |
| 572 | } |
| 573 | cur = d.anyChildTable(cur, name) |
| 574 | } |
| 575 | return nil |
| 576 | } |
| 577 | |
| 578 | // anyChildTable returns the child table at name within cur, creating it if |
| 579 | // absent and descending into the current (last) element when an array table |