treesitter: fix lint

This commit is contained in:
Thomas Vigouroux
2020-06-23 09:08:56 +02:00
parent b652f74ca3
commit 35cc8b6e83

View File

@@ -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);
}