File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 48
48
; * special
49
49
(
50
50
(identifier) @constant.builtin
51
- (#match ? @constant.builtin "^( __MODULE__| __DIR__| __ENV__| __CALLER__| __STACKTRACE__)$ ")
51
+ (#any-of ? @constant.builtin "__MODULE__" " __DIR__" " __ENV__" " __CALLER__" " __STACKTRACE__")
52
52
)
53
53
54
54
; Comment
122
122
; * definition keyword
123
123
(call
124
124
target: (identifier) @keyword
125
- (#match ? @keyword "^( def| defdelegate| defexception| defguard| defguardp| defimpl| defmacro| defmacrop| defmodule| defn| defnp| defoverridable| defp| defprotocol| defstruct)$ "))
125
+ (#any-of ? @keyword "def" " defdelegate" " defexception" " defguard" " defguardp" " defimpl" " defmacro" " defmacrop" " defmodule" " defn" " defnp" " defoverridable" " defp" " defprotocol" " defstruct"))
126
126
127
127
; * kernel or special forms keyword
128
128
(call
129
129
target: (identifier) @keyword
130
- (#match ? @keyword "^( alias| case| cond| for|if| import| quote| raise| receive| require| reraise| super| throw| try| unless| unquote| unquote_splicing| use| with)$ "))
130
+ (#any-of ? @keyword "alias" " case" " cond" " for" "if" " import" " quote" " raise" " receive" " require" " reraise" " super" " throw" " try" " unless" " unquote" " unquote_splicing" " use" " with"))
131
131
132
132
; * just identifier in function definition
133
133
(call
139
139
left: (identifier) @function
140
140
operator: "when")
141
141
])
142
- (#match ? @keyword "^( def| defdelegate| defguard| defguardp| defmacro| defmacrop| defn| defnp| defp)$ "))
142
+ (#any-of ? @keyword "def" " defdelegate" " defguard" " defguardp" " defmacro" " defmacrop" " defn" " defnp" " defp"))
143
143
144
144
; * pipe into identifier (function call)
145
145
(binary_operator
153
153
(binary_operator
154
154
operator: "|>"
155
155
right: (identifier) @variable ))
156
- (#match ? @keyword "^( def| defdelegate| defguard| defguardp| defmacro| defmacrop| defn| defnp| defp)$ "))
156
+ (#any-of ? @keyword "def" " defdelegate" " defguard" " defguardp" " defmacro" " defmacrop" " defn" " defnp" " defp"))
157
157
158
158
; * pipe into field without parentheses (function call)
159
159
(binary_operator
208
208
quoted_end: _ @comment.doc ) @comment.doc
209
209
(boolean) @comment.doc
210
210
]))
211
- (#match ? @comment.doc.__attribute__ "^( moduledoc| typedoc| doc)$ "))
211
+ (#any-of ? @comment.doc.__attribute__ "moduledoc" " typedoc" " doc"))
212
212
213
213
; Module
214
214
Original file line number Diff line number Diff line change 2
2
((sigil
3
3
(sigil_name) @_sigil_name
4
4
(quoted_content) @injection.content )
5
- (#match ? @_sigil_name "^(H| LVN)$ ")
5
+ (#any-of ? @_sigil_name "H" " LVN")
6
6
(#set! injection.language "heex")
7
7
(#set! injection.combined))
Original file line number Diff line number Diff line change 4
4
(call
5
5
target: (identifier) @ignore
6
6
(arguments (alias) @name )
7
- (#match ? @ignore "^( defmodule| defprotocol)$ ")) @definition.module
7
+ (#any-of ? @ignore "defmodule" " defprotocol")) @definition.module
8
8
9
9
; * functions/macros
10
10
(call
20
20
left: (call target: (identifier) @name )
21
21
operator: "when")
22
22
])
23
- (#match ? @ignore "^( def| defp| defdelegate| defguard| defguardp| defmacro| defmacrop| defn| defnp)$ ")) @definition.function
23
+ (#any-of ? @ignore "def" " defp" " defdelegate" " defguard" " defguardp" " defmacro" " defmacrop" " defn" " defnp")) @definition.function
24
24
25
25
; References
26
26
27
27
; ignore calls to kernel/special-forms keywords
28
28
(call
29
29
target: (identifier) @ignore
30
- (#match ? @ignore "^( def| defp| defdelegate| defguard| defguardp| defmacro| defmacrop| defn| defnp| defmodule| defprotocol| defimpl| defstruct| defexception| defoverridable| alias| case| cond| else| for|if| import| quote| raise| receive| require| reraise| super| throw| try| unless| unquote| unquote_splicing| use| with)$ "))
30
+ (#any-of ? @ignore "def" " defp" " defdelegate" " defguard" " defguardp" " defmacro" " defmacrop" " defn" " defnp" " defmodule" " defprotocol" " defimpl" " defstruct" " defexception" " defoverridable" " alias" " case" " cond" " else" " for" "if" " import" " quote" " raise" " receive" " require" " reraise" " super" " throw" " try" " unless" " unquote" " unquote_splicing" " use" " with"))
31
31
32
32
; ignore module attributes
33
33
(unary_operator
You can’t perform that action at this time.
0 commit comments