Skip to content

Commit c54eb33

Browse files
committed
Update erlang highlights and locals
Switch from '#match?' to '#any-of?' for alternations. Treat 'nominal's the same as types/opaques.
1 parent 6309bc8 commit c54eb33

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

runtime/queries/erlang/highlights.scm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(variable) @variable
88
(atom) @string.special.symbol
99
((atom) @constant.builtin.boolean
10-
(#match? @constant.builtin.boolean "^(true|false)$"))
10+
(#any-of? @constant.builtin.boolean "true" "false"))
1111
[(string) (sigil)] @string
1212
(character) @constant.character
1313
(escape_sequence) @constant.character.escape
@@ -121,7 +121,7 @@
121121
(stab_clause
122122
pattern: (arguments (variable)? @variable.parameter)
123123
body: (variable)? @variable.parameter))
124-
(#match? @keyword "(spec|callback)"))
124+
(#any-of? @keyword "spec" "callback"))
125125
; functions
126126
(function_clause pattern: (arguments (variable) @variable.parameter))
127127
; anonymous functions
@@ -133,7 +133,7 @@
133133
(binary_operator
134134
left: (call (arguments (variable) @variable.parameter))
135135
operator: "::")))
136-
(#match? @keyword "(type|opaque)"))
136+
(#any-of? @keyword "type" "opaque" "nominal"))
137137
; macros
138138
((attribute
139139
name: (atom) @keyword

runtime/queries/erlang/locals.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
; parametric `-type`s
99
((attribute
10-
name: (atom) @_type
10+
name: (atom) @keyword
1111
(arguments
1212
(binary_operator
1313
left: (call (arguments (variable) @local.definition.variable.parameter))
1414
operator: "::") @local.scope))
15-
(#match? @_type "(type|opaque)"))
15+
(#any-of? @keyword "type" "opaque" "nominal"))
1616

1717
; `fun`s
1818
(anonymous_function (stab_clause pattern: (arguments (variable) @local.definition.variable.parameter))) @local.scope

0 commit comments

Comments
 (0)