| 5544 | } |
| 5545 | |
| 5546 | static int is_array(Lua L) |
| 5547 | { |
| 5548 | int n = luaL_getn(L, -1); |
| 5549 | if (n < 1) return 0; |
| 5550 | lua_pushnumber(L, n); |
| 5551 | if (lua_next(L, -2)) { |
| 5552 | // not array: there is stuff after numeric index |
| 5553 | lua_pop(L, 2); |
| 5554 | return 0; |
| 5555 | } |
| 5556 | return 1; |
| 5557 | } |
| 5558 | |
| 5559 | // value to convert is on top of stack |
| 5560 | static cson_value *table_to_cson(Lua L, int lvl, json_conv *conv) |
no test coverage detected