aboutsummaryrefslogtreecommitdiffstats
path: root/queries/erlang
diff options
context:
space:
mode:
authorPham Huy Hoang <hoangtun0810@gmail.com>2024-01-06 15:05:50 +0900
committerChristian Clason <c.clason@uni-graz.at>2024-01-19 16:58:37 +0100
commit57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch)
tree70bf645539882b88e6fa129cefd30986b89bbac3 /queries/erlang
parentci: add query lint job (diff)
downloadnvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip
chore: query formatting
Diffstat (limited to 'queries/erlang')
-rw-r--r--queries/erlang/highlights.scm136
1 files changed, 97 insertions, 39 deletions
diff --git a/queries/erlang/highlights.scm b/queries/erlang/highlights.scm
index da0d1e600..1b9aeaf4e 100644
--- a/queries/erlang/highlights.scm
+++ b/queries/erlang/highlights.scm
@@ -1,8 +1,12 @@
-((atom) @constant (#set! "priority" "90"))
+((atom) @constant
+ (#set! "priority" "90"))
+
(var) @variable
(char) @character
+
(integer) @number
+
(float) @number.float
(comment) @comment @spell
@@ -10,13 +14,13 @@
((comment) @comment.documentation
(#lua-match? @comment.documentation "^[%%][%%]"))
-;; keyword
+; keyword
[
"fun"
"div"
] @keyword
-;; bracket
+; bracket
[
"("
")"
@@ -27,7 +31,7 @@
"#"
] @punctuation.bracket
-;;; Comparisons
+; Comparisons
[
"=="
"=:="
@@ -36,14 +40,14 @@
">="
"<"
">"
-] @operator ;; .comparison
+] @operator ; .comparison
-;;; operator
+; operator
[
":"
":="
"!"
- ;; "-"
+ ; "-"
"+"
"="
"->"
@@ -58,7 +62,7 @@
";"
] @punctuation.delimiter
-;; conditional
+; conditional
[
"receive"
"if"
@@ -77,54 +81,108 @@
"try"
] @keyword.exception
-((atom) @boolean (#any-of? @boolean "true" "false"))
+((atom) @boolean
+ (#any-of? @boolean "true" "false"))
-;; Macros
-((macro_call_expr) @constant.macro (#set! "priority" 101))
+; Macros
+((macro_call_expr) @constant.macro
+ (#set! "priority" 101))
-;; Preprocessor
+; Preprocessor
(pp_define
- lhs: _ @constant.macro (#set! "priority" 101)
-)
-(_preprocessor_directive) @keyword.directive (#set! "priority" 99)
+ lhs: _ @constant.macro
+ (#set! "priority" 101))
-;; Attributes
+(_preprocessor_directive) @keyword.directive
+(#set! "priority" 99)
+
+; Attributes
(pp_include) @keyword.import
+
(pp_include_lib) @keyword.import
+
(export_attribute) @keyword.import
+
(export_type_attribute) @type.definition
-(export_type_attribute types: (fa fun: _ @type (#set! "priority" 101)))
+
+(export_type_attribute
+ types:
+ (fa
+ fun: _ @type
+ (#set! "priority" 101)))
+
(behaviour_attribute) @keyword.import
-(module_attribute (atom) @module) @keyword.import
-(wild_attribute name: (attr_name name: _ @attribute)) @attribute
-;; Records
+(module_attribute
+ (atom) @module) @keyword.import
+
+(wild_attribute
+ name:
+ (attr_name
+ name: _ @attribute)) @attribute
+
+; Records
(record_expr) @type
-(record_field_expr _ @variable.member) @type
-(record_field_name _ @variable.member) @type
-(record_name "#" @type name: _ @type) @type
-(record_decl name: _ @type) @type.definition
-(record_field name: _ @variable.member)
-(record_field name: _ @variable.member ty: _ @type)
-;; Type alias
-(type_alias name: _ @type) @type.definition
+(record_field_expr
+ _ @variable.member) @type
+
+(record_field_name
+ _ @variable.member) @type
+
+(record_name
+ "#" @type
+ name: _ @type) @type
+
+(record_decl
+ name: _ @type) @type.definition
+
+(record_field
+ name: _ @variable.member)
+
+(record_field
+ name: _ @variable.member
+ ty: _ @type)
+
+; Type alias
+(type_alias
+ name: _ @type) @type.definition
+
(spec) @type.definition
-[(string) (binary)] @string
+[
+ (string)
+ (binary)
+] @string
+
+; expr_function_call
+(call
+ expr:
+ [
+ (atom)
+ (remote)
+ (var)
+ ] @function)
-;;; expr_function_call
-(call expr: [(atom) (remote) (var)] @function)
-(call (atom) @keyword.exception (#any-of? @keyword.exception "error" "throw" "exit"))
+(call
+ (atom) @keyword.exception
+ (#any-of? @keyword.exception "error" "throw" "exit"))
-;;; Parenthesized expression: (SomeFunc)(), only highlight the parens
+; Parenthesized expression: (SomeFunc)(), only highlight the parens
(call
- expr: (paren_expr "(" @function.call ")" @function.call)
-)
+ expr:
+ (paren_expr
+ "(" @function.call
+ ")" @function.call))
-;;; function
+; function
(external_fun) @function.call
-(internal_fun fun: (atom) @function.call)
-(function_clause name: (atom) @function)
-(fa fun: (atom) @function)
+(internal_fun
+ fun: (atom) @function.call)
+
+(function_clause
+ name: (atom) @function)
+
+(fa
+ fun: (atom) @function)