Improve Haskell highlighting

This commit is contained in:
Ananda Umamil 2022-01-08 11:12:08 +07:00 committed by Stephan Seitz
parent a7c0c1764b
commit 50fee51d35

View file

@ -11,6 +11,7 @@
(comment) @comment
;; ----------------------------------------------------------------------------
;; Punctuation
@ -72,10 +73,7 @@
"@"
] @operator
(qualified_module (module) @constructor)
(qualified_type (module) @namespace)
(qualified_variable (module) @namespace)
(import (module) @namespace)
(module) @namespace
[
(where)
@ -96,27 +94,34 @@
"do"
"mdo"
"rec"
"infix"
"infixl"
"infixr"
] @keyword
;; ----------------------------------------------------------------------------
;; Functions and variables
(signature name: (variable) @type)
(function name: (variable) @function)
(variable) @variable
"_" @punctuation.special
(pat_wildcard) @variable
(signature name: (variable) @type)
(function
name: (variable) @function
patterns: (patterns))
(exp_infix (variable) @operator) ; consider infix functions as operators
("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
(exp_apply . (exp_name (variable) @function))
(exp_apply . (exp_name (qualified_variable (variable) @function)))
;; ----------------------------------------------------------------------------
;; Types
(type) @type
(type_variable) @type
(constructor) @constructor