| 1587 | } |
| 1588 | |
| 1589 | static void lpbE_map(lpb_Env *e, const pb_Field *f, int idx) { |
| 1590 | lua_State *L = e->L; |
| 1591 | const pb_Field *kf = pb_field(f->type, 1); |
| 1592 | const pb_Field *vf = pb_field(f->type, 2); |
| 1593 | if (kf == NULL || vf == NULL) return; |
| 1594 | lpb_checktable(L, f, idx); |
| 1595 | lua_pushnil(L); |
| 1596 | while (lua_next(L, lpb_relindex(idx, 1))) { |
| 1597 | size_t len; |
| 1598 | pb_addvarint32(e->b, pb_pair(f->number, PB_TBYTES)); |
| 1599 | len = pb_bufflen(e->b); |
| 1600 | lpbE_tagfield(e, kf, 1, -2); |
| 1601 | lpbE_tagfield(e, vf, 1, -1); |
| 1602 | lpb_addlength(L, e->b, len); |
| 1603 | |
| 1604 | lua_pop(L, 1); |
| 1605 | } |
| 1606 | } |
| 1607 | |
| 1608 | static void lpbE_repeated(lpb_Env *e, const pb_Field *f, int idx) { |
| 1609 | lua_State *L = e->L; |
no test coverage detected