diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-06-07 14:19:38 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-06-23 09:11:41 +0200 |
commit | 36d71e775a44526abd70b2720a589a1113c650d7 (patch) | |
tree | 50e7315889c04fde61cc0f367051ee0893993009 /src/nvim/lua/executor.c | |
parent | 721f69c4af8bc81ba04088e7b56f8cdba653b418 (diff) | |
download | rneovim-36d71e775a44526abd70b2720a589a1113c650d7.tar.gz rneovim-36d71e775a44526abd70b2720a589a1113c650d7.tar.bz2 rneovim-36d71e775a44526abd70b2720a589a1113c650d7.zip |
treesitter: simplify puhstree call process
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 327ed6d6b7..4b47b34d8a 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1128,21 +1128,11 @@ void ex_luafile(exarg_T *const eap) } } -static int create_tslua_parser(lua_State *L) -{ - if (lua_gettop(L) < 1 || !lua_isstring(L, 1)) { - return luaL_error(L, "string expected"); - } - - const char *lang_name = lua_tostring(L, 1); - return tslua_push_parser(L, lang_name); -} - static void nlua_add_treesitter(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL { tslua_init(lstate); - lua_pushcfunction(lstate, create_tslua_parser); + lua_pushcfunction(lstate, tslua_push_parser); lua_setfield(lstate, -2, "_create_ts_parser"); lua_pushcfunction(lstate, tslua_add_language); |