mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(treesitter): correct include_bytes arg for parse()
This commit is contained in:
parent
8a3220ba49
commit
4f75960660
@ -405,8 +405,6 @@ static int parser_parse(lua_State *L)
|
|||||||
old_tree = tmp ? *tmp : NULL;
|
old_tree = tmp ? *tmp : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool include_bytes = (lua_gettop(L) >= 3) && lua_toboolean(L, 3);
|
|
||||||
|
|
||||||
TSTree *new_tree = NULL;
|
TSTree *new_tree = NULL;
|
||||||
size_t len;
|
size_t len;
|
||||||
const char *str;
|
const char *str;
|
||||||
@ -443,6 +441,8 @@ static int parser_parse(lua_State *L)
|
|||||||
return luaL_argerror(L, 3, "expected either string or buffer handle");
|
return luaL_argerror(L, 3, "expected either string or buffer handle");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool include_bytes = (lua_gettop(L) >= 4) && lua_toboolean(L, 4);
|
||||||
|
|
||||||
// Sometimes parsing fails (timeout, or wrong parser ABI)
|
// Sometimes parsing fails (timeout, or wrong parser ABI)
|
||||||
// In those case, just return an error.
|
// In those case, just return an error.
|
||||||
if (!new_tree) {
|
if (!new_tree) {
|
||||||
|
Loading…
Reference in New Issue
Block a user