diff options
| author | Joakker <joaquinandresleon108@gmail.com> | 2021-06-24 14:45:31 -0400 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2021-06-25 00:22:48 +0200 |
| commit | c699cc2e47fe302e9f414356cceb20a309be5bc6 (patch) | |
| tree | 961806f7baf8cc44432ffc813c71c5304907cb16 | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.tar nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.tar.gz nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.tar.bz2 nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.tar.lz nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.tar.xz nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.tar.zst nvim-treesitter-c699cc2e47fe302e9f414356cceb20a309be5bc6.zip | |
Use #any-of? instead of #match? where posible
| -rw-r--r-- | queries/bash/highlights.scm | 4 | ||||
| -rw-r--r-- | queries/clojure/highlights.scm | 6 | ||||
| -rw-r--r-- | queries/comment/highlights.scm | 8 | ||||
| -rw-r--r-- | queries/glimmer/highlights.scm | 2 | ||||
| -rw-r--r-- | queries/go/highlights.scm | 11 | ||||
| -rw-r--r-- | queries/julia/highlights.scm | 2 | ||||
| -rw-r--r-- | queries/ocaml/highlights.scm | 5 | ||||
| -rw-r--r-- | queries/svelte/injections.scm | 4 | ||||
| -rw-r--r-- | queries/vue/injections.scm | 4 |
9 files changed, 31 insertions, 15 deletions
diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm index 9b2921e66..2c23efc3f 100644 --- a/queries/bash/highlights.scm +++ b/queries/bash/highlights.scm @@ -90,7 +90,9 @@ (command_name (word) @function) ((command_name (word) @function.builtin) - (#match? @function.builtin "^(cd|echo|eval|exit|getopts|pushd|popd|return|set|shift)$")) + (#any-of? @function.builtin + "cd" "echo" "eval" "exit" "getopts" + "pushd" "popd" "return" "set" "shift")) (command argument: [ diff --git a/queries/clojure/highlights.scm b/queries/clojure/highlights.scm index 965ec1369..0502f5684 100644 --- a/queries/clojure/highlights.scm +++ b/queries/clojure/highlights.scm @@ -38,7 +38,11 @@ (sym_lit) @function.macro . (sym_lit) @function - (#match? @function.macro "^(declare|def|definline|definterface|defmacro|defmethod|defmulti|defn|defn-|defonce|defprotocol|defstruct|deftype|ns)$")) + (#any-of? @function.macro + "declare" "def" "definline" "definterface" + "defmacro" "defmethod" "defmulti" "defn" + "defn-" "defonce" "defprotocol" "defstruct" + "deftype" "ns")) ;; other macros (list_lit diff --git a/queries/comment/highlights.scm b/queries/comment/highlights.scm index 88ae027db..2edfd82d1 100644 --- a/queries/comment/highlights.scm +++ b/queries/comment/highlights.scm @@ -8,16 +8,16 @@ (tag (name) @text.note (user)? @constant) ((tag ((name) @text.warning)) - (#match? @text.warning "^(TODO|HACK|WARNING)$")) + (#any-of? @text.warning "TODO" "HACK" "WARNING)$")) ("text" @text.warning - (#match? @text.warning "^(TODO|HACK|WARNING)$")) + (#any-of? @text.warning "TODO" "HACK" "WARNING")) ((tag ((name) @text.danger)) - (#match? @text.danger "^(FIXME|XXX|BUG)$")) + (#any-of? @text.danger "FIXME" "XXX" "BUG")) ("text" @text.danger - (#match? @text.danger "^(FIXME|XXX|BUG)$")) + (#any-of? @text.danger "FIXME" "XXX" "BUG")) ; Issue number (#123) ("text" @number (#match? @number "^#[0-9]+$")) diff --git a/queries/glimmer/highlights.scm b/queries/glimmer/highlights.scm index e81762014..e6ab3a60e 100644 --- a/queries/glimmer/highlights.scm +++ b/queries/glimmer/highlights.scm @@ -58,7 +58,7 @@ ; If the identifier is just "yield" or "outlet", it's a keyword ((mustache_statement (identifier) @keyword) - (#match? @keyword "yield|outlet")) + (#any-of? @keyword "yield" "outlet")) ; Helpers are functions ((helper_invocation helper: [ diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm index 7ac6fd0d5..ace75b133 100644 --- a/queries/go/highlights.scm +++ b/queries/go/highlights.scm @@ -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 diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index 1107eace9..a53dabe53 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -134,7 +134,7 @@ "type" ] @keyword -((identifier) @keyword (#match? @keyword "^(global|local)$")) +((identifier) @keyword (#any-of? @keyword "global" "local")) (compound_expression ["begin" "end"] @keyword) diff --git a/queries/ocaml/highlights.scm b/queries/ocaml/highlights.scm index 855e3e547..292d3238c 100644 --- a/queries/ocaml/highlights.scm +++ b/queries/ocaml/highlights.scm @@ -8,7 +8,10 @@ ( (type_constructor) @type.builtin - (#match? @type.builtin "^(int|char|bytes|string|float|bool|unit|exn|array|list|option|int32|int64|nativeint|format6|lazy_t)$") + (#any-of? @type.builtin + "int" "char" "bytes" "string" "float" + "bool" "unit" "exn" "array" "list" "option" + "int32" "int64" "nativeint" "format6" "lazy_t") ) [(class_name) (class_type_name) (type_constructor)] @type diff --git a/queries/svelte/injections.scm b/queries/svelte/injections.scm index cca623f3a..6f29bb9c2 100644 --- a/queries/svelte/injections.scm +++ b/queries/svelte/injections.scm @@ -6,7 +6,7 @@ (attribute (quoted_attribute_value (attribute_value) @_lang))) (raw_text) @scss) - (#match? @_lang "(scss|postcss|less)") + (#any-of? @_lang "scss" "postcss" "less") ) ((attribute @@ -22,7 +22,7 @@ (attribute (quoted_attribute_value (attribute_value) @_lang))) (raw_text) @typescript) - (#match? @_lang "(ts|typescript)") + (#any-of? @_lang "ts" "typescript") ) (comment) @comment diff --git a/queries/vue/injections.scm b/queries/vue/injections.scm index 490983878..4d372da30 100644 --- a/queries/vue/injections.scm +++ b/queries/vue/injections.scm @@ -6,7 +6,7 @@ (attribute (quoted_attribute_value (attribute_value) @_lang))) (raw_text) @scss) - (#match? @_lang "(scss|postcss|less)") + (#any-of? @_lang "scss" "postcss" "less") ) ( @@ -15,7 +15,7 @@ (attribute (quoted_attribute_value (attribute_value) @_lang))) (raw_text) @typescript) - (#match? @_lang "(ts|typescript)") + (#any-of? @_lang "ts" "typescript") ) ((interpolation |
