Skip to content
Snippets Groups Projects
Commit ec34fcdc authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Kirill Yukhin
Browse files

box/console: rename luaL_yaml_default to serializer_yaml


As we gonna implement lua output serializer lets
rename luaL_yaml_default to serializer_yaml which
will be more general name, for other serializers
we will use same serializer_ prefix.

Part-of #4682

Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
parent acc83768
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@
extern char serpent_lua[];
static struct luaL_serializer *luaL_yaml_default = NULL;
static struct luaL_serializer *serializer_yaml;
/*
* Completion engine (Mike Paul's).
......@@ -369,7 +369,7 @@ lbox_console_format_yaml(struct lua_State *L)
}
lua_replace(L, 1);
lua_settop(L, 1);
return lua_yaml_encode(L, luaL_yaml_default, NULL, NULL);
return lua_yaml_encode(L, serializer_yaml, NULL, NULL);
}
int
......@@ -404,7 +404,7 @@ console_dump_plain(struct lua_State *L, uint32_t *size)
{
enum output_format fmt = console_get_output_format();
if (fmt == OUTPUT_FORMAT_YAML) {
int rc = lua_yaml_encode(L, luaL_yaml_default, "!push!",
int rc = lua_yaml_encode(L, serializer_yaml, "!push!",
"tag:tarantool.io/push,2018");
if (rc == 2) {
/*
......@@ -566,11 +566,11 @@ tarantool_lua_console_init(struct lua_State *L)
lua_pushcclosure(L, lbox_console_readline, 1);
lua_setfield(L, -2, "readline");
luaL_yaml_default = lua_yaml_new_serializer(L);
luaL_yaml_default->encode_invalid_numbers = 1;
luaL_yaml_default->encode_load_metatables = 1;
luaL_yaml_default->encode_use_tostring = 1;
luaL_yaml_default->encode_invalid_as_nil = 1;
serializer_yaml = lua_yaml_new_serializer(L);
serializer_yaml->encode_invalid_numbers = 1;
serializer_yaml->encode_load_metatables = 1;
serializer_yaml->encode_use_tostring = 1;
serializer_yaml->encode_invalid_as_nil = 1;
/*
* Hold reference to the formatter in module local
* variable.
......
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