mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
treesitter: fix tests
This commit is contained in:
parent
662688817b
commit
6a93077475
@ -162,16 +162,17 @@ function Query:match_preds(match, pattern, bufnr)
|
|||||||
-- Here we only want to return if a predicate DOES NOT match, and
|
-- Here we only want to return if a predicate DOES NOT match, and
|
||||||
-- continue on the other case. This way unknown predicates will not be considered,
|
-- continue on the other case. This way unknown predicates will not be considered,
|
||||||
-- which allows some testing and easier user extensibility (#12173).
|
-- which allows some testing and easier user extensibility (#12173).
|
||||||
|
-- Also, tree-sitter strips the leading # from predicates for us.
|
||||||
if pred[1] == "eq?" then
|
if pred[1] == "eq?" then
|
||||||
local node = match[pred[2]]
|
local node = match[pred[2]]
|
||||||
local node_text = get_node_text(node, bufnr)
|
local node_text = get_node_text(node, bufnr)
|
||||||
|
|
||||||
local str
|
local str
|
||||||
if type(pred[3]) == "string" then
|
if type(pred[3]) == "string" then
|
||||||
-- (eq? @aa "foo")
|
-- (#eq? @aa "foo")
|
||||||
str = pred[3]
|
str = pred[3]
|
||||||
else
|
else
|
||||||
-- (eq? @aa @bb)
|
-- (#eq? @aa @bb)
|
||||||
str = get_node_text(match[pred[3]], bufnr)
|
str = get_node_text(match[pred[3]], bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ static int nlua_schedule(lua_State *const lstate)
|
|||||||
; still support \M etc prefixes
|
; still support \M etc prefixes
|
||||||
((identifier) @Constant (#match? @Constant "\M^\[A-Z_]\+$"))
|
((identifier) @Constant (#match? @Constant "\M^\[A-Z_]\+$"))
|
||||||
|
|
||||||
((binary_expression left: (identifier) @WarningMsg.left right: (identifier) @WarningMsg.right) (eq? @WarningMsg.left @WarningMsg.right))
|
((binary_expression left: (identifier) @WarningMsg.left right: (identifier) @WarningMsg.right) (#eq? @WarningMsg.left @WarningMsg.right))
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
]]
|
]]
|
||||||
|
Loading…
Reference in New Issue
Block a user