aboutsummaryrefslogtreecommitdiffstats
path: root/queries/haskell
diff options
context:
space:
mode:
authorMarc Jakobi <marc.jakobi@tiko.energy>2023-10-10 10:12:36 +0200
committerGitHub <noreply@github.com>2023-10-10 17:12:36 +0900
commit0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543 (patch)
treef4485abcd220b177f1ec1ad2e98f683f043cd6f7 /queries/haskell
parentUpdate parsers: beancount, vimdoc, wing (diff)
downloadnvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.tar
nvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.tar.gz
nvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.tar.bz2
nvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.tar.lz
nvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.tar.xz
nvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.tar.zst
nvim-treesitter-0eb1a0ad1c82e080e77e7b9d7a5e42632cefb543.zip
fix(haskell): prevent segfault due to anchorless queries (#5502)
Diffstat (limited to 'queries/haskell')
-rw-r--r--queries/haskell/highlights.scm58
1 files changed, 27 insertions, 31 deletions
diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm
index 1340cfd46..ecd267cc4 100644
--- a/queries/haskell/highlights.scm
+++ b/queries/haskell/highlights.scm
@@ -162,26 +162,11 @@
;; Functions and variables
(signature name: (variable) @function)
-((signature name: (variable) @variable)
- (function
- name: (variable) @_name
- rhs: [
- (exp_literal)
- (exp_apply
- (exp_name
- [(constructor)
- (variable)
- ]))
- (quasiquote)
- ((exp_name) . (operator))
- ])
- (#eq? @variable @_name))
((signature name: (variable) @variable)
- (function
- name: (variable) @_name
- rhs: (exp_infix
- [
+ . (function
+ name: (variable) @_name
+ rhs: [
(exp_literal)
(exp_apply
(exp_name
@@ -190,26 +175,36 @@
]))
(quasiquote)
((exp_name) . (operator))
- ]))
+ ])
+ (#eq? @variable @_name))
+
+((signature name: (variable) @variable)
+ . (function
+ name: (variable) @_name
+ rhs: (exp_infix
+ [
+ (exp_literal)
+ (exp_apply
+ (exp_name
+ [(constructor)
+ (variable)
+ ]))
+ (quasiquote)
+ ((exp_name) . (operator))
+ ]))
(#eq? @variable @_name))
((signature name: (variable) @function)
- (function
- name: (variable) @_name
- patterns: (patterns))
+ . (function
+ name: (variable) @_name
+ patterns: (patterns))
(#eq? @function @_name))
-(signature
- name: (variable) @function
- type: (fun))
-((signature
- name: (variable) @_name
- type: (fun))
- (function
- name: (variable) @function)
- (#eq? @function @_name))
+;; For some reason, `(signature name: (variable) type: (fun))` doesn't work here
+(signature (variable) @function . (fun))
(function name: (variable) @function)
+
(function
name: (variable) @variable
rhs: [
@@ -222,6 +217,7 @@
(quasiquote)
((exp_name) . (operator))
])
+
(function
name: (variable) @variable
rhs: (exp_infix [