aboutsummaryrefslogtreecommitdiff
path: root/test/functional/treesitter/parser_spec.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2021-11-23 18:29:29 +0100
committerChristian Clason <c.clason@uni-graz.at>2021-11-23 18:38:22 +0100
commit5676edb86d5d82b1426d7fff53996c0aebdf95de (patch)
treeed79301f68aea2a975d6361be78f405f49028e25 /test/functional/treesitter/parser_spec.lua
parentfaae47eddb9ab87e53e913a064675822cc55f18a (diff)
downloadrneovim-5676edb86d5d82b1426d7fff53996c0aebdf95de.tar.gz
rneovim-5676edb86d5d82b1426d7fff53996c0aebdf95de.tar.bz2
rneovim-5676edb86d5d82b1426d7fff53996c0aebdf95de.zip
fix(tests): adapt parser_spec test to tree-sitter bump
Change query to include anonymous nodes (`(_)` -> `[_]`) and use new syntax (`{vim,lua}.match?`->`#{vim,lua}.match?`)
Diffstat (limited to 'test/functional/treesitter/parser_spec.lua')
-rw-r--r--test/functional/treesitter/parser_spec.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/treesitter/parser_spec.lua b/test/functional/treesitter/parser_spec.lua
index ffaa4141c4..1138cfbf4c 100644
--- a/test/functional/treesitter/parser_spec.lua
+++ b/test/functional/treesitter/parser_spec.lua
@@ -231,11 +231,11 @@ void ui_refresh(void)
insert('char* astring = "\\n"; (1 + 1) * 2 != 2;')
local res = exec_lua([[
- cquery = vim.treesitter.parse_query("c", '((_) @plus (vim-match? @plus "^\\\\+$"))'..
- '((_) @times (vim-match? @times "^\\\\*$"))'..
- '((_) @paren (vim-match? @paren "^\\\\($"))'..
- '((_) @escape (vim-match? @escape "^\\\\\\\\n$"))'..
- '((_) @string (vim-match? @string "^\\"\\\\\\\\n\\"$"))')
+ cquery = vim.treesitter.parse_query("c", '([_] @plus (#vim-match? @plus "^\\\\+$"))'..
+ '([_] @times (#vim-match? @times "^\\\\*$"))'..
+ '([_] @paren (#vim-match? @paren "^\\\\($"))'..
+ '([_] @escape (#vim-match? @escape "^\\\\\\\\n$"))'..
+ '([_] @string (#vim-match? @string "^\\"\\\\\\\\n\\"$"))')
parser = vim.treesitter.get_parser(0, "c")
tree = parser:parse()[1]
res = {}
@@ -321,7 +321,7 @@ void ui_refresh(void)
insert('char* astring = "Hello World!";')
local res = exec_lua([[
- cquery = vim.treesitter.parse_query("c", '((_) @quote (vim-match? @quote "^\\"$")) ((_) @quote (lua-match? @quote "^\\"$"))')
+ cquery = vim.treesitter.parse_query("c", '([_] @quote (#vim-match? @quote "^\\"$")) ([_] @quote (#lua-match? @quote "^\\"$"))')
parser = vim.treesitter.get_parser(0, "c")
tree = parser:parse()[1]
res = {}