mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 13:30:01 -04:00
feat(erlang highlight): support erlang highlight (#3141)
This commit is contained in:
parent
4286c8c74a
commit
ab3183107a
2 changed files with 107 additions and 0 deletions
6
queries/erlang/folds.scm
Normal file
6
queries/erlang/folds.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
(function_declaration)
|
||||
(lambda_clause)
|
||||
(expr_case)
|
||||
(map)
|
||||
] @fold
|
||||
101
queries/erlang/highlights.scm
Normal file
101
queries/erlang/highlights.scm
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
;; keywoord
|
||||
[
|
||||
"fun"
|
||||
"div"
|
||||
] @keyword
|
||||
;; bracket
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
"#"
|
||||
] @punctuation.bracket
|
||||
;; conditional
|
||||
[
|
||||
"receive"
|
||||
"try"
|
||||
"throw"
|
||||
"catch"
|
||||
"if"
|
||||
"case"
|
||||
"of"
|
||||
"when"
|
||||
"after"
|
||||
"end"
|
||||
] @conditional
|
||||
;;; module define
|
||||
[
|
||||
"module"
|
||||
"export"
|
||||
] @include
|
||||
;;; operator
|
||||
[
|
||||
":"
|
||||
":="
|
||||
"?"
|
||||
"!"
|
||||
"-"
|
||||
"+"
|
||||
"="
|
||||
"->"
|
||||
"=>"
|
||||
"|"
|
||||
;;;TODO
|
||||
"$"
|
||||
] @operator
|
||||
|
||||
(comment) @comment
|
||||
(string) @string
|
||||
(variable) @variable
|
||||
|
||||
(module_name
|
||||
(atom) @namespace
|
||||
)
|
||||
;;; expr_function_call
|
||||
(expr_function_call
|
||||
name: (computed_function_name) @function
|
||||
)
|
||||
|
||||
(expr_function_call
|
||||
arguments: (atom) @variable
|
||||
)
|
||||
|
||||
;;; map
|
||||
(map
|
||||
(map_entry [
|
||||
(atom)
|
||||
(variable)
|
||||
] @variable)
|
||||
)
|
||||
|
||||
|
||||
(tuple (atom) @variable)
|
||||
(pat_tuple ( pattern (atom) @variable))
|
||||
|
||||
(computed_function_name) @function
|
||||
;;; case
|
||||
(case_clause
|
||||
pattern: (pattern
|
||||
(atom) @variable
|
||||
)
|
||||
)
|
||||
(case_clause
|
||||
body: (atom) @variable
|
||||
)
|
||||
|
||||
;;; function
|
||||
(qualified_function_name
|
||||
module_name: (atom) @attribute
|
||||
function_name: (atom) @function
|
||||
)
|
||||
;; function
|
||||
(function_clause
|
||||
name: (atom) @function)
|
||||
;;;lambda
|
||||
(lambda_clause
|
||||
arguments:
|
||||
(pattern) @variable
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue