Use #any-of? instead of #match? where posible

This commit is contained in:
Joakker 2021-06-24 14:45:31 -04:00 committed by Stephan Seitz
parent 55c5620aa3
commit c699cc2e47
9 changed files with 31 additions and 15 deletions

View file

@ -109,13 +109,20 @@
;; Builtin types
((type_identifier) @type.builtin
(#match? @type.builtin "^(bool|byte|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$"))
(#any-of? @type.builtin
"bool" "byte" "complex128" "complex64" "error"
"float32" "float64" "int" "int16" "int32" "int64"
"int8" "rune" "string" "uint" "uint16" "uint32"
"uint64" "uint8" "uintptr"))
;; Builtin functions
((identifier) @function.builtin
(#match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))
(#any-of? @function.builtin
"append" "cap" "close" "complex" "copy"
"delete" "imag" "len" "make" "new" "panic"
"print" "println" "real" "recover"))
; Delimiters