From 35cc8b6e839f07dbb738900c9c9593041266cdf7 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Tue, 23 Jun 2020 09:08:56 +0200 Subject: [PATCH] treesitter: fix lint --- src/nvim/lua/treesitter.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index aa76ff33a4..913be5afe8 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -387,8 +387,9 @@ static int parser_edit(lua_State *L) static int parser_set_ranges(lua_State *L) { if (lua_gettop(L) < 2) { - lua_pushstring(L, "not enough args to parser:set_included_ranges()"); - return lua_error(L); + return luaL_error( + L, + "not enough args to parser:set_included_ranges()"); } TSLua_parser *p = parser_check(L); @@ -397,8 +398,9 @@ static int parser_set_ranges(lua_State *L) } if (!lua_istable(L, 2)) { - lua_pushstring(L, "argument for parser:set_included_ranges() should be a table."); - return lua_error(L); + return luaL_error( + L, + "argument for parser:set_included_ranges() should be a table."); } size_t tbl_len = lua_objlen(L, 2); @@ -411,18 +413,16 @@ static int parser_set_ranges(lua_State *L) if (!lua_istable(L, -1)) { xfree(ranges); - lua_pushstring( + return luaL_error( L, "argument for parser:set_included_ranges() should be a table of tables."); - return lua_error(L); } if (lua_objlen(L, -1) != 2) { xfree(ranges); - lua_pushstring( + return luaL_error( L, "argument for parser:set_included_ranges() should be a table of ranges of 2 elements."); - return lua_error(L); } @@ -560,7 +560,7 @@ static bool node_check(lua_State *L, int index, TSNode *res) static int node_tostring(lua_State *L) { TSNode node; - if (!node_check(L,1, &node)) { + if (!node_check(L, 1, &node)) { return 0; } lua_pushstring(L, "