summaryrefslogtreecommitdiff
path: root/queries/erlang/highlights.scm
blob: c51019fd5131d856def95834140ed86aaff8fc2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
;; keywoord
[
  "fun"
  "div"
] @keyword
;; bracket
[
  "("
  ")"
  "{"
  "}"
  "["
  "]"
	"#"
] @punctuation.bracket
;; conditional
[
  "receive"
  "if"
  "case"
  "of"
  "when"
  "after"
  "end"
] @conditional

[
  "catch"
	"try"
	"throw"
] @exception
;;; 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.call 
) 

(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
)