From: Oleg Babin <olegrok@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>,
tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 4/7] box/console: rename luaL_yaml_default to serializer_yaml
Date: Mon, 18 May 2020 15:11:04 +0300 [thread overview]
Message-ID: <6c634b97-e9bd-c2eb-0916-c303cd2ccadf@tarantool.org> (raw)
In-Reply-To: <20200512135052.221379-5-gorcunov@gmail.com>
Hi! I'm not sure that we really should do that. Functions with LuaL
prefix is a part of Lua code convention AFAIK.
(https://www.lua.org/manual/5.1/manual.html#4)
But LGTM if nobody doesn't have objections.
On 12/05/2020 16:50, Cyrill Gorcunov wrote:
> 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: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
> src/box/lua/console.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/box/lua/console.c b/src/box/lua/console.c
> index 734c0ee47..c8e0dea58 100644
> --- a/src/box/lua/console.c
> +++ b/src/box/lua/console.c
> @@ -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.
>
next prev parent reply other threads:[~2020-05-18 12:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 13:50 [Tarantool-patches] [PATCH 0/7] box/console: add support for internal types Cyrill Gorcunov
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 1/7] box/console: console_session_vtab -- use designated initialization Cyrill Gorcunov
2020-05-18 12:03 ` Oleg Babin
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 2/7] box/console: use tabs instead of spaces in consolelib Cyrill Gorcunov
2020-05-18 12:04 ` Oleg Babin
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 3/7] box/console: rename format to format_yaml Cyrill Gorcunov
2020-05-18 12:04 ` Oleg Babin
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 4/7] box/console: rename luaL_yaml_default to serializer_yaml Cyrill Gorcunov
2020-05-18 12:11 ` Oleg Babin [this message]
2020-05-18 21:17 ` Igor Munkin
2020-05-19 6:47 ` Oleg Babin
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 5/7] box/console: implement lua serializer Cyrill Gorcunov
2020-05-18 12:18 ` Oleg Babin
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 6/7] box/console: switch to new " Cyrill Gorcunov
2020-05-18 12:21 ` Oleg Babin
2020-05-12 13:50 ` [Tarantool-patches] [PATCH 7/7] test: extend console lua test Cyrill Gorcunov
2020-05-18 12:22 ` Oleg Babin
2020-05-18 12:25 ` Cyrill Gorcunov
2020-05-18 12:46 ` [Tarantool-patches] [PATCH 0/7] box/console: add support for internal types Kirill Yukhin
-- strict thread matches above, loose matches on Subject: below --
2020-05-08 11:47 Cyrill Gorcunov
2020-05-08 11:47 ` [Tarantool-patches] [PATCH 4/7] box/console: rename luaL_yaml_default to serializer_yaml Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6c634b97-e9bd-c2eb-0916-c303cd2ccadf@tarantool.org \
--to=olegrok@tarantool.org \
--cc=gorcunov@gmail.com \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 4/7] box/console: rename luaL_yaml_default to serializer_yaml' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox