Update uses of # to . in our scheme files where they are interchangeable.

uses of `#` cause ERRORs in our scheme highlighting
This commit is contained in:
Nate Butler 2023-07-27 12:41:19 -04:00
parent 85f193dd09
commit 86fa27eb54
30 changed files with 81 additions and 83 deletions

View file

@ -54,5 +54,5 @@
( (
(command (_) @constant) (command (_) @constant)
(#match? @constant "^-") (.match? @constant "^-")
) )

View file

@ -86,7 +86,7 @@
(identifier) @variable (identifier) @variable
((identifier) @constant ((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$")) (.match? @constant "^_*[A-Z][A-Z\\d_]*$"))
(call_expression (call_expression
function: (identifier) @function) function: (identifier) @function)
@ -106,4 +106,3 @@
(primitive_type) (primitive_type)
(sized_type_specifier) (sized_type_specifier)
] @type ] @type

View file

@ -1,7 +1,7 @@
(preproc_def (preproc_def
value: (preproc_arg) @content value: (preproc_arg) @content
(#set! "language" "c")) (.set! "language" "c"))
(preproc_function_def (preproc_function_def
value: (preproc_arg) @content value: (preproc_arg) @content
(#set! "language" "c")) (.set! "language" "c"))

View file

@ -31,13 +31,13 @@
declarator: (field_identifier) @function) declarator: (field_identifier) @function)
((namespace_identifier) @type ((namespace_identifier) @type
(#match? @type "^[A-Z]")) (.match? @type "^[A-Z]"))
(auto) @type (auto) @type
(type_identifier) @type (type_identifier) @type
((identifier) @constant ((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$")) (.match? @constant "^_*[A-Z][A-Z\\d_]*$"))
(field_identifier) @property (field_identifier) @property
(statement_identifier) @label (statement_identifier) @label

View file

@ -1,7 +1,7 @@
(preproc_def (preproc_def
value: (preproc_arg) @content value: (preproc_arg) @content
(#set! "language" "c++")) (.set! "language" "c++"))
(preproc_function_def (preproc_function_def
value: (preproc_arg) @content value: (preproc_arg) @content
(#set! "language" "c++")) (.set! "language" "c++"))

View file

@ -46,7 +46,7 @@
(property_name) (property_name)
(plain_value) (plain_value)
] @variable.special ] @variable.special
(#match? @variable.special "^--") (.match? @variable.special "^--")
) )
[ [

View file

@ -3,7 +3,7 @@
operator: "@" operator: "@"
operand: (call operand: (call
target: (identifier) @unary target: (identifier) @unary
(#match? @unary "^(doc)$")) (.match? @unary "^(doc)$"))
) @context ) @context
. .
(call (call
@ -18,10 +18,10 @@
target: (identifier) @name) target: (identifier) @name)
operator: "when") operator: "when")
]) ])
(#match? @name "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @item (.match? @name "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @item
) )
(call (call
target: (identifier) @name target: (identifier) @name
(arguments (alias) @name) (arguments (alias) @name)
(#match? @name "^(defmodule|defprotocol)$")) @item (.match? @name "^(defmodule|defprotocol)$")) @item

View file

@ -54,13 +54,13 @@
(sigil_name) @__name__ (sigil_name) @__name__
quoted_start: _ @string quoted_start: _ @string
quoted_end: _ @string quoted_end: _ @string
(#match? @__name__ "^[sS]$")) @string (.match? @__name__ "^[sS]$")) @string
(sigil (sigil
(sigil_name) @__name__ (sigil_name) @__name__
quoted_start: _ @string.regex quoted_start: _ @string.regex
quoted_end: _ @string.regex quoted_end: _ @string.regex
(#match? @__name__ "^[rR]$")) @string.regex (.match? @__name__ "^[rR]$")) @string.regex
(sigil (sigil
(sigil_name) @__name__ (sigil_name) @__name__
@ -69,7 +69,7 @@
( (
(identifier) @comment.unused (identifier) @comment.unused
(#match? @comment.unused "^_") (.match? @comment.unused "^_")
) )
(call (call
@ -91,7 +91,7 @@
operator: "|>" operator: "|>"
right: (identifier)) right: (identifier))
]) ])
(#match? @keyword "^(def|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defp)$")) (.match? @keyword "^(def|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defp)$"))
(binary_operator (binary_operator
operator: "|>" operator: "|>"
@ -99,15 +99,15 @@
(call (call
target: (identifier) @keyword target: (identifier) @keyword
(#match? @keyword "^(def|defdelegate|defexception|defguard|defguardp|defimpl|defmacro|defmacrop|defmodule|defn|defnp|defoverridable|defp|defprotocol|defstruct)$")) (.match? @keyword "^(def|defdelegate|defexception|defguard|defguardp|defimpl|defmacro|defmacrop|defmodule|defn|defnp|defoverridable|defp|defprotocol|defstruct)$"))
(call (call
target: (identifier) @keyword target: (identifier) @keyword
(#match? @keyword "^(alias|case|cond|else|for|if|import|quote|raise|receive|require|reraise|super|throw|try|unless|unquote|unquote_splicing|use|with)$")) (.match? @keyword "^(alias|case|cond|else|for|if|import|quote|raise|receive|require|reraise|super|throw|try|unless|unquote|unquote_splicing|use|with)$"))
( (
(identifier) @constant.builtin (identifier) @constant.builtin
(#match? @constant.builtin "^(__MODULE__|__DIR__|__ENV__|__CALLER__|__STACKTRACE__)$") (.match? @constant.builtin "^(__MODULE__|__DIR__|__ENV__|__CALLER__|__STACKTRACE__)$")
) )
(unary_operator (unary_operator
@ -121,7 +121,7 @@
(sigil) (sigil)
(boolean) (boolean)
] @comment.doc)) ] @comment.doc))
(#match? @__attribute__ "^(moduledoc|typedoc|doc)$")) (.match? @__attribute__ "^(moduledoc|typedoc|doc)$"))
(comment) @comment (comment) @comment
@ -150,4 +150,4 @@
((sigil ((sigil
(sigil_name) @_sigil_name (sigil_name) @_sigil_name
(quoted_content) @embedded) (quoted_content) @embedded)
(#eq? @_sigil_name "H")) (.eq? @_sigil_name "H"))

View file

@ -3,5 +3,5 @@
((sigil ((sigil
(sigil_name) @_sigil_name (sigil_name) @_sigil_name
(quoted_content) @content) (quoted_content) @content)
(#eq? @_sigil_name "H") (.eq? @_sigil_name "H")
(#set! language "heex")) (.set! language "heex"))

View file

@ -1,7 +1,7 @@
(call (call
target: (identifier) @context target: (identifier) @context
(arguments (alias) @name) (arguments (alias) @name)
(#match? @context "^(defmodule|defprotocol)$")) @item (.match? @context "^(defmodule|defprotocol)$")) @item
(call (call
target: (identifier) @context target: (identifier) @context
@ -23,4 +23,4 @@
")" @context.extra)) ")" @context.extra))
operator: "when") operator: "when")
]) ])
(#match? @context "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @item (.match? @context "^(def|defp|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp)$")) @item

View file

@ -1,2 +1,2 @@
((glsl_content) @content ((glsl_content) @content
(#set! "language" "glsl")) (.set! "language" "glsl"))

View file

@ -1,7 +1,7 @@
((code) @content ((code) @content
(#set! "language" "ruby") (.set! "language" "ruby")
(#set! "combined")) (.set! "combined"))
((content) @content ((content) @content
(#set! "language" "html") (.set! "language" "html")
(#set! "combined")) (.set! "combined"))

View file

@ -74,7 +74,7 @@
(sized_type_specifier) @type (sized_type_specifier) @type
((identifier) @constant ((identifier) @constant
(#match? @constant "^[A-Z][A-Z\\d_]*$")) (.match? @constant "^[A-Z][A-Z\\d_]*$"))
(identifier) @variable (identifier) @variable
@ -114,5 +114,5 @@
( (
(identifier) @variable.builtin (identifier) @variable.builtin
(#match? @variable.builtin "^gl_") (.match? @variable.builtin "^gl_")
) )

View file

@ -5,9 +5,9 @@
(expression_value) (expression_value)
(ending_expression_value) (ending_expression_value)
] @content) ] @content)
(#set! language "elixir") (.set! language "elixir")
(#set! combined) (.set! combined)
) )
((expression (expression_value) @content) ((expression (expression_value) @content)
(#set! language "elixir")) (.set! language "elixir"))

View file

@ -1,7 +1,7 @@
(script_element (script_element
(raw_text) @content (raw_text) @content
(#set! "language" "javascript")) (.set! "language" "javascript"))
(style_element (style_element
(raw_text) @content (raw_text) @content
(#set! "language" "css")) (.set! "language" "css"))

View file

@ -44,7 +44,7 @@
; Special identifiers ; Special identifiers
((identifier) @type ((identifier) @type
(#match? @type "^[A-Z]")) (.match? @type "^[A-Z]"))
(type_identifier) @type (type_identifier) @type
(predefined_type) @type.builtin (predefined_type) @type.builtin
@ -53,7 +53,7 @@
(shorthand_property_identifier) (shorthand_property_identifier)
(shorthand_property_identifier_pattern) (shorthand_property_identifier_pattern)
] @constant ] @constant
(#match? @constant "^_*[A-Z_][A-Z\\d_]*$")) (.match? @constant "^_*[A-Z_][A-Z\\d_]*$"))
; Literals ; Literals
@ -214,4 +214,4 @@
"type" "type"
"readonly" "readonly"
"override" "override"
] @keyword ] @keyword

View file

@ -127,7 +127,7 @@
(identifier) @variable (identifier) @variable
((identifier) @variable.special ((identifier) @variable.special
(#eq? @variable.special "self")) (.eq? @variable.special "self"))
(variable_list (variable_list
attribute: (attribute attribute: (attribute
@ -137,7 +137,7 @@
;; Constants ;; Constants
((identifier) @constant ((identifier) @constant
(#match? @constant "^[A-Z][A-Z_0-9]*$")) (.match? @constant "^[A-Z][A-Z_0-9]*$"))
(vararg_expression) @constant (vararg_expression) @constant
@ -180,7 +180,7 @@
(function_call (function_call
(identifier) @function.builtin (identifier) @function.builtin
(#any-of? @function.builtin (.any-of? @function.builtin
;; built-in functions in Lua 5.1 ;; built-in functions in Lua 5.1
"assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable" "ipairs" "assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable" "ipairs"
"load" "loadfile" "loadstring" "module" "next" "pairs" "pcall" "print" "load" "loadfile" "loadstring" "module" "next" "pairs" "pcall" "print"

View file

@ -43,15 +43,15 @@
(relative_scope) @variable.builtin (relative_scope) @variable.builtin
((name) @constant ((name) @constant
(#match? @constant "^_?[A-Z][A-Z\\d_]+$")) (.match? @constant "^_?[A-Z][A-Z\\d_]+$"))
((name) @constant.builtin ((name) @constant.builtin
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$")) (.match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
((name) @method.constructor ((name) @method.constructor
(#match? @method.constructor "^[A-Z]")) (.match? @method.constructor "^[A-Z]"))
((name) @variable.builtin ((name) @variable.builtin
(#eq? @variable.builtin "this")) (.eq? @variable.builtin "this"))
(variable_name) @variable (variable_name) @variable

View file

@ -1,3 +1,3 @@
((text) @content ((text) @content
(#set! "language" "html") (.set! "language" "html")
(#set! "combined")) (.set! "combined"))

View file

@ -18,16 +18,16 @@
; Identifier naming conventions ; Identifier naming conventions
((identifier) @type ((identifier) @type
(#match? @type "^[A-Z]")) (.match? @type "^[A-Z]"))
((identifier) @constant ((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$")) (.match? @constant "^_*[A-Z][A-Z\\d_]*$"))
; Builtin functions ; Builtin functions
((call ((call
function: (identifier) @function.builtin) function: (identifier) @function.builtin)
(#match? (.match?
@function.builtin @function.builtin
"^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$")) "^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$"))
@ -122,4 +122,4 @@
"yield" "yield"
"match" "match"
"case" "case"
] @keyword ] @keyword

File diff suppressed because one or more lines are too long

View file

@ -6,5 +6,5 @@
(symbol) @name (symbol) @name
(list . (symbol) @name) (list . (symbol) @name)
] ]
(#match? @start-symbol "^define") (.match? @start-symbol "^define")
) @item ) @item

View file

@ -11,4 +11,4 @@
(begin "begin" @open "end" @close) (begin "begin" @open "end" @close)
(module "module" @open "end" @close) (module "module" @open "end" @close)
(_ . "def" @open "end" @close) (_ . "def" @open "end" @close)
(_ . "class" @open "end" @close) (_ . "class" @open "end" @close)

View file

@ -33,12 +33,12 @@
(identifier) @variable (identifier) @variable
((identifier) @keyword ((identifier) @keyword
(#match? @keyword "^(private|protected|public)$")) (.match? @keyword "^(private|protected|public)$"))
; Function calls ; Function calls
((identifier) @function.method.builtin ((identifier) @function.method.builtin
(#eq? @function.method.builtin "require")) (.eq? @function.method.builtin "require"))
"defined?" @function.method.builtin "defined?" @function.method.builtin
@ -60,7 +60,7 @@
] @property ] @property
((identifier) @constant.builtin ((identifier) @constant.builtin
(#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$")) (.match? @constant.builtin "^__(FILE|LINE|ENCODING)__$"))
(file) @constant.builtin (file) @constant.builtin
(line) @constant.builtin (line) @constant.builtin
@ -71,7 +71,7 @@
) @constant.builtin ) @constant.builtin
((constant) @constant ((constant) @constant
(#match? @constant "^[A-Z\\d_]+$")) (.match? @constant "^[A-Z\\d_]+$"))
(constant) @type (constant) @type

View file

@ -38,11 +38,11 @@
; Assume uppercase names are types/enum-constructors ; Assume uppercase names are types/enum-constructors
((identifier) @type ((identifier) @type
(#match? @type "^[A-Z]")) (.match? @type "^[A-Z]"))
; Assume all-caps names are constants ; Assume all-caps names are constants
((identifier) @constant ((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$")) (.match? @constant "^_*[A-Z][A-Z\\d_]*$"))
[ [
"(" "("

View file

@ -1,7 +1,7 @@
(macro_invocation (macro_invocation
(token_tree) @content (token_tree) @content
(#set! "language" "rust")) (.set! "language" "rust"))
(macro_rule (macro_rule
(token_tree) @content (token_tree) @content
(#set! "language" "rust")) (.set! "language" "rust"))

View file

@ -14,7 +14,7 @@
(directive)] @comment (directive)] @comment
((symbol) @operator ((symbol) @operator
(#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$")) (.match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$"))
(list (list
. .
@ -23,6 +23,6 @@
(list (list
. .
(symbol) @keyword (symbol) @keyword
(#match? @keyword (.match? @keyword
"^(define-syntax|let\\*|lambda|λ|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$" "^(define-syntax|let\\*|lambda|λ|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$"
)) ))

View file

@ -6,5 +6,5 @@
(symbol) @name (symbol) @name
(list . (symbol) @name) (list . (symbol) @name)
] ]
(#match? @start-symbol "^define") (.match? @start-symbol "^define")
) @item ) @item

View file

@ -2,27 +2,27 @@
; -------------- ; --------------
(script_element (script_element
(raw_text) @content (raw_text) @content
(#set! "language" "javascript")) (.set! "language" "javascript"))
((script_element ((script_element
(start_tag (start_tag
(attribute (attribute
(quoted_attribute_value (attribute_value) @_language))) (quoted_attribute_value (attribute_value) @_language)))
(raw_text) @content) (raw_text) @content)
(#eq? @_language "ts") (.eq? @_language "ts")
(#set! "language" "typescript")) (.set! "language" "typescript"))
((script_element ((script_element
(start_tag (start_tag
(attribute (attribute
(quoted_attribute_value (attribute_value) @_language))) (quoted_attribute_value (attribute_value) @_language)))
(raw_text) @content) (raw_text) @content)
(#eq? @_language "typescript") (.eq? @_language "typescript")
(#set! "language" "typescript")) (.set! "language" "typescript"))
(style_element (style_element
(raw_text) @content (raw_text) @content
(#set! "language" "css")) (.set! "language" "css"))
((raw_text_expr) @content ((raw_text_expr) @content
(#set! "language" "javascript")) (.set! "language" "javascript"))

View file

@ -44,10 +44,10 @@
; Special identifiers ; Special identifiers
((identifier) @method.constructor ((identifier) @method.constructor
(#match? @method.constructor "^[A-Z]")) (.match? @method.constructor "^[A-Z]"))
((identifier) @type ((identifier) @type
(#match? @type "^[A-Z]")) (.match? @type "^[A-Z]"))
(type_identifier) @type (type_identifier) @type
(predefined_type) @type.builtin (predefined_type) @type.builtin
@ -56,7 +56,7 @@
(shorthand_property_identifier) (shorthand_property_identifier)
(shorthand_property_identifier_pattern) (shorthand_property_identifier_pattern)
] @constant ] @constant
(#match? @constant "^_*[A-Z_][A-Z\\d_]*$")) (.match? @constant "^_*[A-Z_][A-Z\\d_]*$"))
; Literals ; Literals