Skip to content
Snippets Groups Projects
Commit f2b5ac73 authored by Dmitry Simonenko's avatar Dmitry Simonenko
Browse files

lua-plus-dict: use old tuple print format

parent 20fad78e
No related branches found
No related tags found
No related merge requests found
......@@ -663,20 +663,6 @@ tarantool_lua(struct lua_State *L,
lua_settop(L, 0);
return;
}
/* convert all tuples to tables */
for (int i = 1; i <= top; i++) {
if (lua_getmetatable(L, i) == 0)
continue;
luaL_getmetatable(L, "box.tuple");
int is_tuple = 0;
if (lua_equal(L, -1, -2))
is_tuple = 1;
lua_pop(L, 2);
if (is_tuple) {
luaL_callmeta(L, i, "totable");
lua_replace(L, i);
}
}
yamlL_encode(L);
lua_replace(L, 1);
lua_pop(L, 1);
......
......@@ -436,15 +436,18 @@ static int dump_scalar(struct lua_yaml_dumper *dumper) {
len -= 2;
break;
}
} else if (type == LUA_TUSERDATA || type == LUA_TFUNCTION) {
} else if (type == LUA_TUSERDATA) {
str = dump_tostring(dumper->L, -1);
len = strlen(str);
style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
} else if (type == LUA_TFUNCTION) {
str = dump_tostring(dumper->L, -1);
len = strlen(str);
}
yaml_scalar_event_initialize(
&ev, NULL, tag, (unsigned char *)str, len,
yaml_scalar_event_initialize(&ev, NULL, tag, (unsigned char *)str, len,
!is_binary, !is_binary, style);
if (is_binary) lua_pop(dumper->L, 1);
if (is_binary)
lua_pop(dumper->L, 1);
return yaml_emitter_emit(&dumper->emitter, &ev);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment