Fix highlight colors and other minor fixes
This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -14,10 +14,6 @@
|
|||||||
path = libs/tree-sitter-ruby
|
path = libs/tree-sitter-ruby
|
||||||
url = https://github.com/tree-sitter/tree-sitter-ruby.git
|
url = https://github.com/tree-sitter/tree-sitter-ruby.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
[submodule "libs/tree-sitter-c"]
|
|
||||||
path = libs/tree-sitter-c
|
|
||||||
url = https://github.com/tree-sitter/tree-sitter-c.git
|
|
||||||
ignore = dirty
|
|
||||||
[submodule "libs/tree-sitter-cpp"]
|
[submodule "libs/tree-sitter-cpp"]
|
||||||
path = libs/tree-sitter-cpp
|
path = libs/tree-sitter-cpp
|
||||||
url = https://github.com/tree-sitter/tree-sitter-cpp.git
|
url = https://github.com/tree-sitter/tree-sitter-cpp.git
|
||||||
|
|||||||
12
Makefile
12
Makefile
@@ -34,15 +34,15 @@ TREE_SITTER_LIBS := $(wildcard libs/tree-sitter-*/libtree-sitter*.a)
|
|||||||
|
|
||||||
PHP_LIB := libs/tree-sitter-php/php/libtree-sitter-php.a
|
PHP_LIB := libs/tree-sitter-php/php/libtree-sitter-php.a
|
||||||
|
|
||||||
|
NGINX_OBJ_PARSER := libs/tree-sitter-nginx/build/Release/obj.target/tree_sitter_nginx_binding/src/parser.o
|
||||||
|
|
||||||
|
GITIGNORE_OBJ_PARSER := libs/tree-sitter-gitignore/build/Release/obj.target/tree_sitter_ignore_binding/src/parser.o
|
||||||
|
|
||||||
FISH_OBJ_PARSER := libs/tree-sitter-fish/build/Release/obj.target/tree_sitter_fish_binding/src/parser.o
|
FISH_OBJ_PARSER := libs/tree-sitter-fish/build/Release/obj.target/tree_sitter_fish_binding/src/parser.o
|
||||||
FISH_OBJ_SCANNER := libs/tree-sitter-fish/build/Release/obj.target/tree_sitter_fish_binding/src/scanner.o
|
FISH_OBJ_SCANNER := libs/tree-sitter-fish/build/Release/obj.target/tree_sitter_fish_binding/src/scanner.o
|
||||||
|
|
||||||
NGINX_OBJ_PARSER := libs/tree-sitter-nginx/build/Release/obj.target/tree_sitter_nginx_binding/src/parser.o
|
|
||||||
|
|
||||||
CABAL_OBJ_PARSER := libs/tree-sitter-cabal/build/Release/obj.target/tree_sitter_cabal_binding/src/parser.o
|
CABAL_OBJ_PARSER := libs/tree-sitter-cabal/build/Release/obj.target/tree_sitter_cabal_binding/src/parser.o
|
||||||
CABAL_OBJ_SCANNER := libs/tree-sitter-cabal/src/scanner.o
|
CABAL_OBJ_SCANNER := libs/tree-sitter-cabal/src/libscanner.a
|
||||||
|
|
||||||
GITIGNORE_OBJ_PARSER := libs/tree-sitter-gitignore/build/Release/obj.target/tree_sitter_ignore_binding/src/parser.o
|
|
||||||
|
|
||||||
MD_OBJ_PARSER := libs/tree-sitter-markdown/build/Release/obj.target/tree_sitter_markdown_binding/tree-sitter-markdown/src/parser.o
|
MD_OBJ_PARSER := libs/tree-sitter-markdown/build/Release/obj.target/tree_sitter_markdown_binding/tree-sitter-markdown/src/parser.o
|
||||||
MD_OBJ_SCANNER := libs/tree-sitter-markdown/build/Release/obj.target/tree_sitter_markdown_binding/tree-sitter-markdown/src/scanner.o
|
MD_OBJ_SCANNER := libs/tree-sitter-markdown/build/Release/obj.target/tree_sitter_markdown_binding/tree-sitter-markdown/src/scanner.o
|
||||||
@@ -55,9 +55,9 @@ LIBS := \
|
|||||||
$(NGINX_OBJ_PARSER) \
|
$(NGINX_OBJ_PARSER) \
|
||||||
$(GITIGNORE_OBJ_PARSER) \
|
$(GITIGNORE_OBJ_PARSER) \
|
||||||
$(FISH_OBJ_PARSER) \
|
$(FISH_OBJ_PARSER) \
|
||||||
|
$(FISH_OBJ_SCANNER) \
|
||||||
$(CABAL_OBJ_PARSER) \
|
$(CABAL_OBJ_PARSER) \
|
||||||
$(CABAL_OBJ_SCANNER) \
|
$(CABAL_OBJ_SCANNER) \
|
||||||
$(FISH_OBJ_SCANNER) \
|
|
||||||
$(MD_OBJ_PARSER) \
|
$(MD_OBJ_PARSER) \
|
||||||
$(MD_OBJ_SCANNER) \
|
$(MD_OBJ_SCANNER) \
|
||||||
-lpcre2-8 -lmagic
|
-lpcre2-8 -lmagic
|
||||||
|
|||||||
315
grammar/bash.scm
315
grammar/bash.scm
@@ -1,4 +1,4 @@
|
|||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"("
|
"("
|
||||||
")"
|
")"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"))"
|
"))"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
";"
|
";"
|
||||||
";;"
|
";;"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"&"
|
"&"
|
||||||
] @punctuation.delimiter
|
] @punctuation.delimiter
|
||||||
|
|
||||||
;; #ffffff #000000 0 1 0 1
|
;; #F29668 #000000 0 1 0 1
|
||||||
[
|
[
|
||||||
">"
|
">"
|
||||||
">>"
|
">>"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"!"
|
"!"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #AAD94C #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(string)
|
(string)
|
||||||
(raw_string)
|
(raw_string)
|
||||||
@@ -57,14 +57,14 @@
|
|||||||
(heredoc_body)
|
(heredoc_body)
|
||||||
] @string
|
] @string
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #E6C08A #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(heredoc_start)
|
(heredoc_start)
|
||||||
(heredoc_end)
|
(heredoc_end)
|
||||||
] @label
|
] @label
|
||||||
|
|
||||||
(variable_assignment
|
(variable_assignment
|
||||||
(word) @string)
|
(word) @variable)
|
||||||
|
|
||||||
(command
|
(command
|
||||||
argument: "$" @string) ; bare dollar
|
argument: "$" @string) ; bare dollar
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
(concatenation
|
(concatenation
|
||||||
(word) @string)
|
(word) @string)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
"then"
|
"then"
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
"esac"
|
"esac"
|
||||||
] @keyword.conditional
|
] @keyword.conditional
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"for"
|
"for"
|
||||||
"do"
|
"do"
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
"while"
|
"while"
|
||||||
] @keyword.repeat
|
] @keyword.repeat
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"declare"
|
"declare"
|
||||||
"typeset"
|
"typeset"
|
||||||
@@ -104,39 +104,39 @@
|
|||||||
"unsetenv"
|
"unsetenv"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"export" @keyword.import
|
"export" @keyword.import
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"function" @keyword.function
|
"function" @keyword.function
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(special_variable_name) @constant
|
(special_variable_name) @constant
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((word) @constant.builtin
|
((word) @constant.builtin
|
||||||
(#match? @constant.builtin "^(SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGBUS|SIGFPE|SIGKILL|SIGUSR1|SIGSEGV|SIGUSR2|SIGPIPE|SIGALRM|SIGTERM|SIGSTKFLT|SIGCHLD|SIGCONT|SIGSTOP|SIGTSTP|SIGTTIN|SIGTTOU|SIGURG|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGIO|SIGPWR|SIGSYS|SIGRTMIN|SIGRTMIN\+1|SIGRTMIN\+2|SIGRTMIN\+3|SIGRTMIN\+4|SIGRTMIN\+5|SIGRTMIN\+6|SIGRTMIN\+7|SIGRTMIN\+8|SIGRTMIN\+9|SIGRTMIN\+10|SIGRTMIN\+11|SIGRTMIN\+12|SIGRTMIN\+13|SIGRTMIN\+14|SIGRTMIN\+15|SIGRTMAX\-14|SIGRTMAX\-13|SIGRTMAX\-12|SIGRTMAX\-11|SIGRTMAX\-10|SIGRTMAX\-9|SIGRTMAX\-8|SIGRTMAX\-7|SIGRTMAX\-6|SIGRTMAX\-5|SIGRTMAX\-4|SIGRTMAX\-3|SIGRTMAX\-2|SIGRTMAX\-1|SIGRTMAX)$"))
|
(#match? @constant.builtin "^(SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGBUS|SIGFPE|SIGKILL|SIGUSR1|SIGSEGV|SIGUSR2|SIGPIPE|SIGALRM|SIGTERM|SIGSTKFLT|SIGCHLD|SIGCONT|SIGSTOP|SIGTSTP|SIGTTIN|SIGTTOU|SIGURG|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGIO|SIGPWR|SIGSYS|SIGRTMIN|SIGRTMIN\+1|SIGRTMIN\+2|SIGRTMIN\+3|SIGRTMIN\+4|SIGRTMIN\+5|SIGRTMIN\+6|SIGRTMIN\+7|SIGRTMIN\+8|SIGRTMIN\+9|SIGRTMIN\+10|SIGRTMIN\+11|SIGRTMIN\+12|SIGRTMIN\+13|SIGRTMIN\+14|SIGRTMIN\+15|SIGRTMAX\-14|SIGRTMAX\-13|SIGRTMAX\-12|SIGRTMAX\-11|SIGRTMAX\-10|SIGRTMAX\-9|SIGRTMAX\-8|SIGRTMAX\-7|SIGRTMAX\-6|SIGRTMAX\-5|SIGRTMAX\-4|SIGRTMAX\-3|SIGRTMAX\-2|SIGRTMAX\-1|SIGRTMAX)$"))
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((word) @boolean.true
|
((word) @boolean.true
|
||||||
(#match? @boolean.true "^true$"))
|
(#match? @boolean.true "^true$"))
|
||||||
|
|
||||||
;; #ee513a #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((word) @boolean.false
|
((word) @boolean.false
|
||||||
(#match? @boolean.false "^false$"))
|
(#match? @boolean.false "^false$"))
|
||||||
|
|
||||||
;; #AAAAAA #000000 0 1 0 1
|
;; #99ADBF #000000 0 1 0 1
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(test_operator) @operator
|
(test_operator) @operator
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(command_substitution
|
(command_substitution
|
||||||
"$(" @punctuation.special
|
"$(" @punctuation.special
|
||||||
")" @punctuation.special)
|
")" @punctuation.special)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(process_substitution
|
(process_substitution
|
||||||
[
|
[
|
||||||
"<("
|
"<("
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
] @punctuation.special
|
] @punctuation.special
|
||||||
")" @punctuation.special)
|
")" @punctuation.special)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(arithmetic_expansion
|
(arithmetic_expansion
|
||||||
[
|
[
|
||||||
"$(("
|
"$(("
|
||||||
@@ -152,43 +152,43 @@
|
|||||||
] @punctuation.special
|
] @punctuation.special
|
||||||
"))" @punctuation.special)
|
"))" @punctuation.special)
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
(arithmetic_expansion
|
(arithmetic_expansion
|
||||||
"," @punctuation.delimiter)
|
"," @punctuation.delimiter)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(ternary_expression
|
(ternary_expression
|
||||||
[
|
[
|
||||||
"?"
|
"?"
|
||||||
":"
|
":"
|
||||||
] @keyword.conditional.ternary)
|
] @keyword.conditional.ternary)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(binary_expression
|
(binary_expression
|
||||||
operator: _ @operator)
|
operator: _ @operator)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(unary_expression
|
(unary_expression
|
||||||
operator: _ @operator)
|
operator: _ @operator)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(postfix_expression
|
(postfix_expression
|
||||||
operator: _ @operator)
|
operator: _ @operator)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(function_definition
|
(function_definition
|
||||||
name: (word) @function)
|
name: (word) @function)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(command_name
|
(command_name
|
||||||
(word) @function.call)
|
(word) @function.call)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(command_name
|
(command_name
|
||||||
(word) @function.builtin
|
(word) @function.builtin
|
||||||
(#match? @function.builtin "^(\.|\:|alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|compopt|continue|coproc|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|mapfile|popd|printf|pushd|pwd|read|readarray|return|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|wait)$"))
|
(#match? @function.builtin "^(\.|\:|alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|compopt|continue|coproc|dirs|disown|echo|enable|eval|exec|exit|false|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|mapfile|popd|printf|pushd|pwd|read|readarray|return|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|wait)$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FFFFFF #000000 0 0 0 1
|
||||||
(command
|
(command
|
||||||
argument: [
|
argument: [
|
||||||
(word) @variable.parameter
|
(word) @variable.parameter
|
||||||
@@ -196,83 +196,302 @@
|
|||||||
(word) @variable.parameter)
|
(word) @variable.parameter)
|
||||||
])
|
])
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FFFFFF #000000 0 0 0 1
|
||||||
(declaration_command
|
(declaration_command
|
||||||
(word) @variable.parameter)
|
(word) @variable.parameter)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FFFFFF #000000 0 0 0 1
|
||||||
(unset_command
|
(unset_command
|
||||||
(word) @variable.parameter)
|
(word) @variable.parameter)
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(number) @number
|
(number) @number
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
((word) @number
|
((word) @number
|
||||||
(#match? @number "^[0-9]+$"))
|
(#match? @number "^[0-9]+$"))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #AAD94C #000000 0 0 0 1
|
||||||
(file_redirect
|
(file_redirect
|
||||||
(word) @string.special.path)
|
(word) @string.special.path)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #AAD94C #000000 0 0 0 1
|
||||||
(herestring_redirect
|
(herestring_redirect
|
||||||
(word) @string)
|
(word) @string)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(file_descriptor) @operator
|
(file_descriptor) @operator
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(simple_expansion
|
(simple_expansion
|
||||||
"$" @punctuation.special) @none
|
"$" @punctuation.special) @none
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(expansion
|
(expansion
|
||||||
"${" @punctuation.special
|
"${" @punctuation.special
|
||||||
"}" @punctuation.special) @none
|
"}" @punctuation.special) @none
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(expansion
|
(expansion
|
||||||
operator: _ @punctuation.special)
|
operator: _ @punctuation.special)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(expansion
|
(expansion
|
||||||
"@"
|
"@"
|
||||||
.
|
.
|
||||||
operator: _ @character.special)
|
operator: _ @character.special)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
((expansion
|
((expansion
|
||||||
(subscript
|
(subscript
|
||||||
index: (word) @character.special))
|
index: (word) @character.special))
|
||||||
(#any-of? @character.special "@" "*"))
|
(#any-of? @character.special "@" "*"))
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
"``" @punctuation.special
|
"``" @punctuation.special
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FFFFFF #000000 0 0 0 1
|
||||||
(variable_name) @variable
|
(variable_name) @variable
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((variable_name) @constant
|
((variable_name) @constant
|
||||||
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((variable_name) @variable.builtin
|
((variable_name) @variable.builtin
|
||||||
(#match? @variable.builtin "^(CDPATH|HOME|IFS|MAIL|MAILPATH|OPTARG|OPTIND|PATH|PS1|PS2|_|BASH|BASHOPTS|BASHPID|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_ARGV0|BASH_CMDS|BASH_COMMAND|BASH_COMPAT|BASH_ENV|BASH_EXECUTION_STRING|BASH_LINENO|BASH_LOADABLES_PATH|BASH_REMATCH|BASH_SOURCE|BASH_SUBSHELL|BASH_VERSINFO|BASH_VERSION|BASH_XTRACEFD|CHILD_MAX|COLUMNS|COMP_CWORD|COMP_LINE|COMP_POINT|COMP_TYPE|COMP_KEY|COMP_WORDBREAKS|COMP_WORDS|COMPREPLY|COPROC|DIRSTACK|EMACS|ENV|EPOCHREALTIME|EPOCHSECONDS|EUID|EXECIGNORE|FCEDIT|FIGNORE|FUNCNAME|FUNCNEST|GLOBIGNORE|GROUPS|histchars|HISTCMD|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTIGNORE|HISTSIZE|HISTTIMEFORMAT|HOSTFILE|HOSTNAME|HOSTTYPE|IGNOREEOF|INPUTRC|INSIDE_EMACS|LANG|LC_ALL|LC_COLLATE|LC_CTYPE|LC_MESSAGES|LC_NUMERIC|LC_TIME|LINENO|LINES|MACHTYPE|MAILCHECK|MAPFILE|OLDPWD|OPTERR|OSTYPE|PIPESTATUS|POSIXLY_CORRECT|PPID|PROMPT_COMMAND|PROMPT_DIRTRIM|PS0|PS3|PS4|PWD|RANDOM|READLINE_ARGUMENT|READLINE_LINE|READLINE_MARK|READLINE_POINT|REPLY|SECONDS|SHELL|SHELLOPTS|SHLVL|SRANDOM|TIMEFORMAT|TMOUT|TMPDIR|UID)$"))
|
(#match? @variable.builtin "^(CDPATH|HOME|IFS|MAIL|MAILPATH|OPTARG|OPTIND|PATH|PS1|PS2|_|BASH|BASHOPTS|BASHPID|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_ARGV0|BASH_CMDS|BASH_COMMAND|BASH_COMPAT|BASH_ENV|BASH_EXECUTION_STRING|BASH_LINENO|BASH_LOADABLES_PATH|BASH_REMATCH|BASH_SOURCE|BASH_SUBSHELL|BASH_VERSINFO|BASH_VERSION|BASH_XTRACEFD|CHILD_MAX|COLUMNS|COMP_CWORD|COMP_LINE|COMP_POINT|COMP_TYPE|COMP_KEY|COMP_WORDBREAKS|COMP_WORDS|COMPREPLY|COPROC|DIRSTACK|EMACS|ENV|EPOCHREALTIME|EPOCHSECONDS|EUID|EXECIGNORE|FCEDIT|FIGNORE|FUNCNAME|FUNCNEST|GLOBIGNORE|GROUPS|histchars|HISTCMD|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTIGNORE|HISTSIZE|HISTTIMEFORMAT|HOSTFILE|HOSTNAME|HOSTTYPE|IGNOREEOF|INPUTRC|INSIDE_EMACS|LANG|LC_ALL|LC_COLLATE|LC_CTYPE|LC_MESSAGES|LC_NUMERIC|LC_TIME|LINENO|LINES|MACHTYPE|MAILCHECK|MAPFILE|OLDPWD|OPTERR|OSTYPE|PIPESTATUS|POSIXLY_CORRECT|PPID|PROMPT_COMMAND|PROMPT_DIRTRIM|PS0|PS3|PS4|PWD|RANDOM|READLINE_ARGUMENT|READLINE_LINE|READLINE_MARK|READLINE_POINT|REPLY|SECONDS|SHELL|SHELLOPTS|SHLVL|SRANDOM|TIMEFORMAT|TMOUT|TMPDIR|UID)$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FFFFFF #000000 0 0 0 1
|
||||||
(case_item
|
(case_item
|
||||||
value: (word) @variable.parameter)
|
value: (word) @variable.parameter)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #95E6CB #000000 0 0 0 2
|
||||||
[
|
[
|
||||||
(regex)
|
(regex)
|
||||||
(extglob_pattern)
|
(extglob_pattern)
|
||||||
] @string.regexp
|
] @string.regexp
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 3
|
;; #AAD94C #000000 0 0 0 3
|
||||||
((program
|
((program
|
||||||
.
|
.
|
||||||
(comment) @keyword.directive @nospell)
|
(comment) @keyword.directive @nospell)
|
||||||
(#match? @keyword.directive "^#!/"))
|
(#match? @keyword.directive "^#!/"))
|
||||||
|
|
||||||
|
; Injections
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !bash
|
||||||
|
(heredoc_body) @bash_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "BASH"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !c
|
||||||
|
(heredoc_body) @c_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "C$"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !cpp
|
||||||
|
(heredoc_body) @cpp_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "CPP"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !css
|
||||||
|
(heredoc_body) @css_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "CSS"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !fish
|
||||||
|
(heredoc_body) @fish_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "FISH"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !go
|
||||||
|
(heredoc_body) @go_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GO"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !haskell
|
||||||
|
(heredoc_body) @haskell_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "HASKELL"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !html
|
||||||
|
(heredoc_body) @html_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "HTML"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !javascript
|
||||||
|
(heredoc_body) @javascript_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "JAVASCRIPT"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !json
|
||||||
|
(heredoc_body) @json_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "JSON"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !lua
|
||||||
|
(heredoc_body) @lua_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "LUA"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !make
|
||||||
|
(heredoc_body) @make_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "MAKE"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !python
|
||||||
|
(heredoc_body) @python_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "PYTHON"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !ruby
|
||||||
|
(heredoc_body) @ruby_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "RUBY"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !rust
|
||||||
|
(heredoc_body) @rust_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "RUST"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !diff
|
||||||
|
(heredoc_body) @diff_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "DIFF"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !embedded_template
|
||||||
|
(heredoc_body) @embedded_template_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "ERB"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !gdscript
|
||||||
|
(heredoc_body) @gdscript_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GDSCRIPT"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !gitattributes
|
||||||
|
(heredoc_body) @gitattributes_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GITATTRIBUTES"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !gitignore
|
||||||
|
(heredoc_body) @gitignore_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GITIGNORE"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !gomod
|
||||||
|
(heredoc_body) @gomod_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GOMOD"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !ini
|
||||||
|
(heredoc_body) @ini_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "INI"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !markdown
|
||||||
|
(heredoc_body) @markdown_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "MARKDOWN"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !nginx
|
||||||
|
(heredoc_body) @nginx_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "NGINX"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !php
|
||||||
|
(heredoc_body) @php_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "PHP"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !query
|
||||||
|
(heredoc_body) @query_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "QUERY"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !regex
|
||||||
|
(heredoc_body) @regex_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "REGEX"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !sql
|
||||||
|
(heredoc_body) @sql_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "SQL"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !toml
|
||||||
|
(heredoc_body) @toml_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "TOML"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !yaml
|
||||||
|
(heredoc_body) @yaml_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "YAML"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
;; !cabal
|
||||||
|
(heredoc_body) @cabal_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "CABAL"))
|
||||||
|
)
|
||||||
|
|||||||
363
grammar/c.scm
Normal file
363
grammar/c.scm
Normal file
@@ -0,0 +1,363 @@
|
|||||||
|
;; #ffffff #000000 0 0 0 1
|
||||||
|
((identifier) @variable
|
||||||
|
(#set! priority 95))
|
||||||
|
|
||||||
|
(preproc_def
|
||||||
|
(preproc_arg) @variable)
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
"default"
|
||||||
|
"goto"
|
||||||
|
"asm"
|
||||||
|
"__asm__"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"enum"
|
||||||
|
"struct"
|
||||||
|
"union"
|
||||||
|
"typedef"
|
||||||
|
] @keyword.type
|
||||||
|
|
||||||
|
[
|
||||||
|
"sizeof"
|
||||||
|
"offsetof"
|
||||||
|
] @keyword.operator
|
||||||
|
|
||||||
|
(alignof_expression
|
||||||
|
.
|
||||||
|
_ @keyword.operator)
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
"return" @keyword.return
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
"while"
|
||||||
|
"for"
|
||||||
|
"do"
|
||||||
|
"continue"
|
||||||
|
"break"
|
||||||
|
] @keyword.repeat
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"else"
|
||||||
|
"case"
|
||||||
|
"switch"
|
||||||
|
] @keyword.conditional
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
"#if"
|
||||||
|
"#ifdef"
|
||||||
|
"#ifndef"
|
||||||
|
"#else"
|
||||||
|
"#elif"
|
||||||
|
"#endif"
|
||||||
|
"#elifdef"
|
||||||
|
"#elifndef"
|
||||||
|
(preproc_directive)
|
||||||
|
] @keyword.directive
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
"#define" @keyword.directive.define
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
"#include" @keyword.import
|
||||||
|
|
||||||
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
";"
|
||||||
|
":"
|
||||||
|
","
|
||||||
|
"."
|
||||||
|
"::"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
;; #BFBDB6 #000000 0 0 0 2
|
||||||
|
"..." @punctuation.special
|
||||||
|
|
||||||
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
;; #F29668 #000000 0 1 0 1
|
||||||
|
[
|
||||||
|
"="
|
||||||
|
"-"
|
||||||
|
"*"
|
||||||
|
"/"
|
||||||
|
"+"
|
||||||
|
"%"
|
||||||
|
"~"
|
||||||
|
"|"
|
||||||
|
"&"
|
||||||
|
"^"
|
||||||
|
"<<"
|
||||||
|
">>"
|
||||||
|
"->"
|
||||||
|
"<"
|
||||||
|
"<="
|
||||||
|
">="
|
||||||
|
">"
|
||||||
|
"=="
|
||||||
|
"!="
|
||||||
|
"!"
|
||||||
|
"&&"
|
||||||
|
"||"
|
||||||
|
"-="
|
||||||
|
"+="
|
||||||
|
"*="
|
||||||
|
"/="
|
||||||
|
"%="
|
||||||
|
"|="
|
||||||
|
"&="
|
||||||
|
"^="
|
||||||
|
">>="
|
||||||
|
"<<="
|
||||||
|
"--"
|
||||||
|
"++"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
;; #F29668 #000000 0 0 0 1
|
||||||
|
(comma_expression
|
||||||
|
"," @operator)
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
(true)
|
||||||
|
(false)
|
||||||
|
] @boolean
|
||||||
|
|
||||||
|
;; #F29668 #000000 0 0 0 1
|
||||||
|
(conditional_expression
|
||||||
|
[
|
||||||
|
"?"
|
||||||
|
":"
|
||||||
|
] @keyword.conditional.ternary)
|
||||||
|
|
||||||
|
;; #aad84c #000000 0 0 0 1
|
||||||
|
(string_literal) @string
|
||||||
|
|
||||||
|
(system_lib_string) @string
|
||||||
|
|
||||||
|
;; #95E6CB #000000 0 0 0 2
|
||||||
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
(null) @constant.builtin
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
(number_literal) @number
|
||||||
|
|
||||||
|
;; #39BAE6 #000000 0 0 0 1
|
||||||
|
(char_literal) @character
|
||||||
|
|
||||||
|
;; #FFB454 #000000 0 0 0 1
|
||||||
|
(preproc_defined) @function.macro
|
||||||
|
|
||||||
|
;; #F07178 #000000 0 0 0 1
|
||||||
|
((field_expression
|
||||||
|
(field_identifier) @property) @_parent)
|
||||||
|
|
||||||
|
(field_designator) @property
|
||||||
|
|
||||||
|
((field_identifier) @property)
|
||||||
|
|
||||||
|
;; #39BAE6 #000000 0 0 0 1
|
||||||
|
(statement_identifier) @label
|
||||||
|
|
||||||
|
(declaration
|
||||||
|
type: (type_identifier) @_type
|
||||||
|
declarator: (identifier) @label
|
||||||
|
(#match? @_type "^__label__$"))
|
||||||
|
|
||||||
|
;; #59C2FF #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
(type_identifier)
|
||||||
|
(type_descriptor)
|
||||||
|
] @type
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
(storage_class_specifier) @keyword.modifier
|
||||||
|
|
||||||
|
[
|
||||||
|
(type_qualifier)
|
||||||
|
(gnu_asm_qualifier)
|
||||||
|
"__extension__"
|
||||||
|
] @keyword.modifier
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
(linkage_specification
|
||||||
|
"extern" @keyword.modifier)
|
||||||
|
|
||||||
|
;; #59C2FF #000000 0 0 0 1
|
||||||
|
(type_definition
|
||||||
|
declarator: (type_identifier) @type.definition)
|
||||||
|
|
||||||
|
;; #59C2FF #000000 0 0 0 1
|
||||||
|
(primitive_type) @type.builtin
|
||||||
|
|
||||||
|
(sized_type_specifier
|
||||||
|
_ @type.builtin
|
||||||
|
type: _?)
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
((identifier) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
||||||
|
|
||||||
|
(preproc_def
|
||||||
|
(preproc_arg) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
||||||
|
|
||||||
|
(enumerator
|
||||||
|
name: (identifier) @constant)
|
||||||
|
|
||||||
|
(case_statement
|
||||||
|
value: (identifier) @constant)
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
((identifier) @constant.builtin
|
||||||
|
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
||||||
|
|
||||||
|
(preproc_def
|
||||||
|
(preproc_arg) @constant.builtin
|
||||||
|
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
(attribute_specifier
|
||||||
|
(argument_list
|
||||||
|
(identifier) @variable.builtin))
|
||||||
|
|
||||||
|
(attribute_specifier
|
||||||
|
(argument_list
|
||||||
|
(call_expression
|
||||||
|
function: (identifier) @variable.builtin)))
|
||||||
|
|
||||||
|
;; #FFB454 #000000 0 0 0 1
|
||||||
|
((call_expression
|
||||||
|
function: (identifier) @function.builtin)
|
||||||
|
(#match? @function.builtin "^__builtin_"))
|
||||||
|
|
||||||
|
((call_expression
|
||||||
|
function: (identifier) @function.builtin))
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
(preproc_def
|
||||||
|
name: (_) @constant.macro)
|
||||||
|
|
||||||
|
(preproc_call
|
||||||
|
directive: (preproc_directive) @_u
|
||||||
|
argument: (_) @constant.macro
|
||||||
|
(#match? @_u "^#undef$"))
|
||||||
|
|
||||||
|
(preproc_ifdef
|
||||||
|
name: (identifier) @constant.macro)
|
||||||
|
|
||||||
|
(preproc_elifdef
|
||||||
|
name: (identifier) @constant.macro)
|
||||||
|
|
||||||
|
(preproc_defined
|
||||||
|
(identifier) @constant.macro)
|
||||||
|
|
||||||
|
;; #FFB454 #000000 0 0 0 3
|
||||||
|
(call_expression
|
||||||
|
function: (identifier) @function.call)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (field_expression
|
||||||
|
field: (field_identifier) @function.call))
|
||||||
|
|
||||||
|
;; #FFB454 #000000 0 0 0 3
|
||||||
|
(function_declarator
|
||||||
|
declarator: (identifier) @function)
|
||||||
|
|
||||||
|
(function_declarator
|
||||||
|
declarator: (parenthesized_declarator
|
||||||
|
(pointer_declarator
|
||||||
|
declarator: (field_identifier) @function)))
|
||||||
|
|
||||||
|
;; #FFB454 #000000 0 0 0 3
|
||||||
|
(preproc_function_def
|
||||||
|
name: (identifier) @function.macro)
|
||||||
|
|
||||||
|
;; #99ADBF #000000 0 1 0 1
|
||||||
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
;; #99ADBF #000000 0 1 0 1
|
||||||
|
((comment) @comment.documentation
|
||||||
|
(#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
||||||
|
|
||||||
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
|
(parameter_declaration
|
||||||
|
declarator: (identifier) @variable.parameter)
|
||||||
|
|
||||||
|
(parameter_declaration
|
||||||
|
declarator: (array_declarator) @variable.parameter)
|
||||||
|
|
||||||
|
(parameter_declaration
|
||||||
|
declarator: (pointer_declarator) @variable.parameter)
|
||||||
|
|
||||||
|
(preproc_params
|
||||||
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
|
[
|
||||||
|
"__attribute__"
|
||||||
|
"__declspec"
|
||||||
|
"__based"
|
||||||
|
"__cdecl"
|
||||||
|
"__clrcall"
|
||||||
|
"__stdcall"
|
||||||
|
"__fastcall"
|
||||||
|
"__thiscall"
|
||||||
|
"__vectorcall"
|
||||||
|
(ms_pointer_modifier)
|
||||||
|
(attribute_declaration)
|
||||||
|
] @attribute
|
||||||
|
|
||||||
|
;; #F07178 #000000 0 0 0 1
|
||||||
|
((identifier) @variable.member
|
||||||
|
(#match? @variable.member "^m_.*$"))
|
||||||
|
|
||||||
|
(parameter_declaration
|
||||||
|
declarator: (reference_declarator) @variable.parameter)
|
||||||
|
|
||||||
|
(variadic_parameter_declaration
|
||||||
|
declarator: (variadic_declarator
|
||||||
|
(_) @variable.parameter))
|
||||||
|
|
||||||
|
(optional_parameter_declaration
|
||||||
|
declarator: (_) @variable.parameter)
|
||||||
|
|
||||||
|
;; #F07178 #000000 0 0 0 1
|
||||||
|
((field_expression
|
||||||
|
(field_identifier) @function.method) @_parent)
|
||||||
|
|
||||||
|
(field_declaration
|
||||||
|
(field_identifier) @variable.member)
|
||||||
|
|
||||||
|
(field_initializer
|
||||||
|
(field_identifier) @property)
|
||||||
|
|
||||||
|
(function_declarator
|
||||||
|
declarator: (field_identifier) @function.method)
|
||||||
|
|
||||||
|
;; #59C2FF #000000 0 0 0 3
|
||||||
|
(concept_definition
|
||||||
|
name: (identifier) @type.definition)
|
||||||
|
|
||||||
|
(alias_declaration
|
||||||
|
name: (type_identifier) @type.definition)
|
||||||
|
|
||||||
|
;; #59C2FF #000000 0 0 0 1
|
||||||
|
(auto) @type.builtin
|
||||||
132
grammar/cpp.scm
132
grammar/cpp.scm
@@ -5,7 +5,7 @@
|
|||||||
(preproc_def
|
(preproc_def
|
||||||
(preproc_arg) @variable)
|
(preproc_arg) @variable)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"default"
|
"default"
|
||||||
"goto"
|
"goto"
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
.
|
.
|
||||||
_ @keyword.operator)
|
_ @keyword.operator)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"return" @keyword.return
|
"return" @keyword.return
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"while"
|
"while"
|
||||||
"for"
|
"for"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"break"
|
"break"
|
||||||
] @keyword.repeat
|
] @keyword.repeat
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
"else"
|
"else"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"switch"
|
"switch"
|
||||||
] @keyword.conditional
|
] @keyword.conditional
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"#if"
|
"#if"
|
||||||
"#ifdef"
|
"#ifdef"
|
||||||
@@ -62,13 +62,13 @@
|
|||||||
(preproc_directive)
|
(preproc_directive)
|
||||||
] @keyword.directive
|
] @keyword.directive
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"#define" @keyword.directive.define
|
"#define" @keyword.directive.define
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"#include" @keyword.import
|
"#include" @keyword.import
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
";"
|
";"
|
||||||
":"
|
":"
|
||||||
@@ -77,10 +77,10 @@
|
|||||||
"::"
|
"::"
|
||||||
] @punctuation.delimiter
|
] @punctuation.delimiter
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #BFBDB6 #000000 0 0 0 2
|
||||||
"..." @punctuation.special
|
"..." @punctuation.special
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"("
|
"("
|
||||||
")"
|
")"
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
"}"
|
"}"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 1 0 1
|
||||||
[
|
[
|
||||||
"="
|
"="
|
||||||
"-"
|
"-"
|
||||||
@@ -128,17 +128,17 @@
|
|||||||
"++"
|
"++"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(comma_expression
|
(comma_expression
|
||||||
"," @operator)
|
"," @operator)
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(true)
|
(true)
|
||||||
(false)
|
(false)
|
||||||
] @boolean
|
] @boolean
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(conditional_expression
|
(conditional_expression
|
||||||
[
|
[
|
||||||
"?"
|
"?"
|
||||||
@@ -150,22 +150,22 @@
|
|||||||
|
|
||||||
(system_lib_string) @string
|
(system_lib_string) @string
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #95E6CB #000000 0 0 0 2
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(null) @constant.builtin
|
(null) @constant.builtin
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(number_literal) @number
|
(number_literal) @number
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #39BAE6 #000000 0 0 0 1
|
||||||
(char_literal) @character
|
(char_literal) @character
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #FFB454 #000000 0 0 0 1
|
||||||
(preproc_defined) @function.macro
|
(preproc_defined) @function.macro
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((field_expression
|
((field_expression
|
||||||
(field_identifier) @property) @_parent)
|
(field_identifier) @property) @_parent)
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
|
|
||||||
((field_identifier) @property)
|
((field_identifier) @property)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #39BAE6 #000000 0 0 0 1
|
||||||
(statement_identifier) @label
|
(statement_identifier) @label
|
||||||
|
|
||||||
(declaration
|
(declaration
|
||||||
@@ -181,13 +181,13 @@
|
|||||||
declarator: (identifier) @label
|
declarator: (identifier) @label
|
||||||
(#match? @_type "^__label__$"))
|
(#match? @_type "^__label__$"))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(type_identifier)
|
(type_identifier)
|
||||||
(type_descriptor)
|
(type_descriptor)
|
||||||
] @type
|
] @type
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(storage_class_specifier) @keyword.modifier
|
(storage_class_specifier) @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
@@ -196,22 +196,22 @@
|
|||||||
"__extension__"
|
"__extension__"
|
||||||
] @keyword.modifier
|
] @keyword.modifier
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(linkage_specification
|
(linkage_specification
|
||||||
"extern" @keyword.modifier)
|
"extern" @keyword.modifier)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(type_definition
|
(type_definition
|
||||||
declarator: (type_identifier) @type.definition)
|
declarator: (type_identifier) @type.definition)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(primitive_type) @type.builtin
|
(primitive_type) @type.builtin
|
||||||
|
|
||||||
(sized_type_specifier
|
(sized_type_specifier
|
||||||
_ @type.builtin
|
_ @type.builtin
|
||||||
type: _?)
|
type: _?)
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
(case_statement
|
(case_statement
|
||||||
value: (identifier) @constant)
|
value: (identifier) @constant)
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((identifier) @constant.builtin
|
((identifier) @constant.builtin
|
||||||
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
(preproc_arg) @constant.builtin
|
(preproc_arg) @constant.builtin
|
||||||
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(attribute_specifier
|
(attribute_specifier
|
||||||
(argument_list
|
(argument_list
|
||||||
(identifier) @variable.builtin))
|
(identifier) @variable.builtin))
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @variable.builtin)))
|
function: (identifier) @variable.builtin)))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #FFB454 #000000 0 0 0 1
|
||||||
((call_expression
|
((call_expression
|
||||||
function: (identifier) @function.builtin)
|
function: (identifier) @function.builtin)
|
||||||
(#match? @function.builtin "^__builtin_"))
|
(#match? @function.builtin "^__builtin_"))
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
((call_expression
|
((call_expression
|
||||||
function: (identifier) @function.builtin))
|
function: (identifier) @function.builtin))
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(preproc_def
|
(preproc_def
|
||||||
name: (_) @constant.macro)
|
name: (_) @constant.macro)
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
(preproc_defined
|
(preproc_defined
|
||||||
(identifier) @constant.macro)
|
(identifier) @constant.macro)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @function.call)
|
function: (identifier) @function.call)
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
function: (field_expression
|
function: (field_expression
|
||||||
field: (field_identifier) @function.call))
|
field: (field_identifier) @function.call))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (identifier) @function)
|
declarator: (identifier) @function)
|
||||||
|
|
||||||
@@ -286,18 +286,18 @@
|
|||||||
(pointer_declarator
|
(pointer_declarator
|
||||||
declarator: (field_identifier) @function)))
|
declarator: (field_identifier) @function)))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(preproc_function_def
|
(preproc_function_def
|
||||||
name: (identifier) @function.macro)
|
name: (identifier) @function.macro)
|
||||||
|
|
||||||
;; #AAAAAA #000000 0 1 0 1
|
;; #99ADBF #000000 0 1 0 1
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
;; #AAAAAA #000000 0 1 0 1
|
;; #99ADBF #000000 0 1 0 1
|
||||||
((comment) @comment.documentation
|
((comment) @comment.documentation
|
||||||
(#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
(#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(parameter_declaration
|
(parameter_declaration
|
||||||
declarator: (identifier) @variable.parameter)
|
declarator: (identifier) @variable.parameter)
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
(preproc_params
|
(preproc_params
|
||||||
(identifier) @variable.parameter)
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"__attribute__"
|
"__attribute__"
|
||||||
"__declspec"
|
"__declspec"
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
(attribute_declaration)
|
(attribute_declaration)
|
||||||
] @attribute
|
] @attribute
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((identifier) @variable.member
|
((identifier) @variable.member
|
||||||
(#match? @variable.member "^m_.*$"))
|
(#match? @variable.member "^m_.*$"))
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@
|
|||||||
(optional_parameter_declaration
|
(optional_parameter_declaration
|
||||||
declarator: (_) @variable.parameter)
|
declarator: (_) @variable.parameter)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((field_expression
|
((field_expression
|
||||||
(field_identifier) @function.method) @_parent)
|
(field_identifier) @function.method) @_parent)
|
||||||
|
|
||||||
@@ -352,29 +352,29 @@
|
|||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (field_identifier) @function.method)
|
declarator: (field_identifier) @function.method)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #59C2FF #000000 0 0 0 3
|
||||||
(concept_definition
|
(concept_definition
|
||||||
name: (identifier) @type.definition)
|
name: (identifier) @type.definition)
|
||||||
|
|
||||||
(alias_declaration
|
(alias_declaration
|
||||||
name: (type_identifier) @type.definition)
|
name: (type_identifier) @type.definition)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(auto) @type.builtin
|
(auto) @type.builtin
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(namespace_identifier) @module
|
(namespace_identifier) @module
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
((namespace_identifier) @type
|
((namespace_identifier) @type
|
||||||
(#match? @type "^[A-Z]"))
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(case_statement
|
(case_statement
|
||||||
value: (qualified_identifier
|
value: (qualified_identifier
|
||||||
(identifier) @constant))
|
(identifier) @constant))
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(using_declaration
|
(using_declaration
|
||||||
.
|
.
|
||||||
"using"
|
"using"
|
||||||
@@ -386,11 +386,11 @@
|
|||||||
(identifier)
|
(identifier)
|
||||||
] @module)
|
] @module)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(destructor_name
|
(destructor_name
|
||||||
(identifier) @function.method)
|
(identifier) @function.method)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(function_declarator
|
(function_declarator
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @function))
|
(identifier) @function))
|
||||||
@@ -420,10 +420,10 @@
|
|||||||
|
|
||||||
"operator" @function
|
"operator" @function
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
"static_assert" @function.builtin
|
"static_assert" @function.builtin
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call_expression
|
(call_expression
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @function.call))
|
(identifier) @function.call))
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
(template_method
|
(template_method
|
||||||
(field_identifier) @function.method))
|
(field_identifier) @function.method))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call_expression
|
(call_expression
|
||||||
(field_expression
|
(field_expression
|
||||||
(field_identifier) @function.method.call))
|
(field_identifier) @function.method.call))
|
||||||
@@ -488,7 +488,7 @@
|
|||||||
(template_method
|
(template_method
|
||||||
(field_identifier) @function.method.call)))
|
(field_identifier) @function.method.call)))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
((function_declarator
|
((function_declarator
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @constructor))
|
(identifier) @constructor))
|
||||||
@@ -513,23 +513,23 @@
|
|||||||
(argument_list))
|
(argument_list))
|
||||||
(#match? @constructor "^[A-Z]"))
|
(#match? @constructor "^[A-Z]"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
(this) @variable.builtin
|
(this) @variable.builtin
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(null
|
(null
|
||||||
"nullptr" @constant.builtin)
|
"nullptr" @constant.builtin)
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(true) @boolean_true
|
(true) @boolean_true
|
||||||
|
|
||||||
;; #ee513a #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(false) @boolean_false
|
(false) @boolean_false
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #aad84c #000000 0 0 0 1
|
||||||
(raw_string_literal) @string
|
(raw_string_literal) @string
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"try"
|
"try"
|
||||||
"catch"
|
"catch"
|
||||||
@@ -537,7 +537,7 @@
|
|||||||
"throw"
|
"throw"
|
||||||
] @keyword.exception
|
] @keyword.exception
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"decltype"
|
"decltype"
|
||||||
"explicit"
|
"explicit"
|
||||||
@@ -548,7 +548,7 @@
|
|||||||
"constexpr"
|
"constexpr"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"class"
|
"class"
|
||||||
"namespace"
|
"namespace"
|
||||||
@@ -557,14 +557,14 @@
|
|||||||
"concept"
|
"concept"
|
||||||
] @keyword.type
|
] @keyword.type
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"co_await"
|
"co_await"
|
||||||
"co_yield"
|
"co_yield"
|
||||||
"co_return"
|
"co_return"
|
||||||
] @keyword.coroutine
|
] @keyword.coroutine
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"public"
|
"public"
|
||||||
"private"
|
"private"
|
||||||
@@ -573,7 +573,7 @@
|
|||||||
"virtual"
|
"virtual"
|
||||||
] @keyword.modifier
|
] @keyword.modifier
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"new"
|
"new"
|
||||||
"delete"
|
"delete"
|
||||||
@@ -590,13 +590,13 @@
|
|||||||
"or"
|
"or"
|
||||||
] @keyword.operator
|
] @keyword.operator
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
"<=>" @operator
|
"<=>" @operator
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
"::" @punctuation.delimiter
|
"::" @punctuation.delimiter
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
(template_argument_list
|
(template_argument_list
|
||||||
[
|
[
|
||||||
"<"
|
"<"
|
||||||
@@ -609,5 +609,5 @@
|
|||||||
">"
|
">"
|
||||||
] @punctuation.bracket)
|
] @punctuation.bracket)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(literal_suffix) @operator
|
(literal_suffix) @operator
|
||||||
|
|||||||
132
grammar/h.scm
132
grammar/h.scm
@@ -5,7 +5,7 @@
|
|||||||
(preproc_def
|
(preproc_def
|
||||||
(preproc_arg) @variable)
|
(preproc_arg) @variable)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"default"
|
"default"
|
||||||
"goto"
|
"goto"
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
.
|
.
|
||||||
_ @keyword.operator)
|
_ @keyword.operator)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"return" @keyword.return
|
"return" @keyword.return
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"while"
|
"while"
|
||||||
"for"
|
"for"
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"break"
|
"break"
|
||||||
] @keyword.repeat
|
] @keyword.repeat
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
"else"
|
"else"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"switch"
|
"switch"
|
||||||
] @keyword.conditional
|
] @keyword.conditional
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"#if"
|
"#if"
|
||||||
"#ifdef"
|
"#ifdef"
|
||||||
@@ -62,13 +62,13 @@
|
|||||||
(preproc_directive)
|
(preproc_directive)
|
||||||
] @keyword.directive
|
] @keyword.directive
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"#define" @keyword.directive.define
|
"#define" @keyword.directive.define
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"#include" @keyword.import
|
"#include" @keyword.import
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
";"
|
";"
|
||||||
":"
|
":"
|
||||||
@@ -77,10 +77,10 @@
|
|||||||
"::"
|
"::"
|
||||||
] @punctuation.delimiter
|
] @punctuation.delimiter
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #BFBDB6 #000000 0 0 0 2
|
||||||
"..." @punctuation.special
|
"..." @punctuation.special
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"("
|
"("
|
||||||
")"
|
")"
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
"}"
|
"}"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 1 0 1
|
||||||
[
|
[
|
||||||
"="
|
"="
|
||||||
"-"
|
"-"
|
||||||
@@ -128,17 +128,17 @@
|
|||||||
"++"
|
"++"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(comma_expression
|
(comma_expression
|
||||||
"," @operator)
|
"," @operator)
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(true)
|
(true)
|
||||||
(false)
|
(false)
|
||||||
] @boolean
|
] @boolean
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
(conditional_expression
|
(conditional_expression
|
||||||
[
|
[
|
||||||
"?"
|
"?"
|
||||||
@@ -150,22 +150,22 @@
|
|||||||
|
|
||||||
(system_lib_string) @string
|
(system_lib_string) @string
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #95E6CB #000000 0 0 0 2
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(null) @constant.builtin
|
(null) @constant.builtin
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(number_literal) @number
|
(number_literal) @number
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #39BAE6 #000000 0 0 0 1
|
||||||
(char_literal) @character
|
(char_literal) @character
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #FFB454 #000000 0 0 0 1
|
||||||
(preproc_defined) @function.macro
|
(preproc_defined) @function.macro
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((field_expression
|
((field_expression
|
||||||
(field_identifier) @property) @_parent)
|
(field_identifier) @property) @_parent)
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
|
|
||||||
((field_identifier) @property)
|
((field_identifier) @property)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #39BAE6 #000000 0 0 0 1
|
||||||
(statement_identifier) @label
|
(statement_identifier) @label
|
||||||
|
|
||||||
(declaration
|
(declaration
|
||||||
@@ -181,13 +181,13 @@
|
|||||||
declarator: (identifier) @label
|
declarator: (identifier) @label
|
||||||
(#match? @_type "^__label__$"))
|
(#match? @_type "^__label__$"))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(type_identifier)
|
(type_identifier)
|
||||||
(type_descriptor)
|
(type_descriptor)
|
||||||
] @type
|
] @type
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(storage_class_specifier) @keyword.modifier
|
(storage_class_specifier) @keyword.modifier
|
||||||
|
|
||||||
[
|
[
|
||||||
@@ -196,22 +196,22 @@
|
|||||||
"__extension__"
|
"__extension__"
|
||||||
] @keyword.modifier
|
] @keyword.modifier
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(linkage_specification
|
(linkage_specification
|
||||||
"extern" @keyword.modifier)
|
"extern" @keyword.modifier)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(type_definition
|
(type_definition
|
||||||
declarator: (type_identifier) @type.definition)
|
declarator: (type_identifier) @type.definition)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(primitive_type) @type.builtin
|
(primitive_type) @type.builtin
|
||||||
|
|
||||||
(sized_type_specifier
|
(sized_type_specifier
|
||||||
_ @type.builtin
|
_ @type.builtin
|
||||||
type: _?)
|
type: _?)
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
(case_statement
|
(case_statement
|
||||||
value: (identifier) @constant)
|
value: (identifier) @constant)
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
((identifier) @constant.builtin
|
((identifier) @constant.builtin
|
||||||
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
(preproc_arg) @constant.builtin
|
(preproc_arg) @constant.builtin
|
||||||
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
(#match? @constant.builtin "^(stderr|stdin|stdout|__FILE__|__LINE__|__DATE__|__TIME__|__STDC__|__STDC_VERSION__|__STDC_HOSTED__|__cplusplus|__OBJC__|__ASSEMBLER__|__BASE_FILE__|__FILE_NAME__|__INCLUDE_LEVEL__|__TIMESTAMP__|__clang__|__clang_major__|__clang_minor__|__clang_patchlevel__|__clang_version__|__clang_literal_encoding__|__clang_wide_literal_encoding__|__FUNCTION__|__func__|__PRETTY_FUNCTION__|__VA_ARGS__|__VA_OPT__)$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(attribute_specifier
|
(attribute_specifier
|
||||||
(argument_list
|
(argument_list
|
||||||
(identifier) @variable.builtin))
|
(identifier) @variable.builtin))
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @variable.builtin)))
|
function: (identifier) @variable.builtin)))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #FFB454 #000000 0 0 0 1
|
||||||
((call_expression
|
((call_expression
|
||||||
function: (identifier) @function.builtin)
|
function: (identifier) @function.builtin)
|
||||||
(#match? @function.builtin "^__builtin_"))
|
(#match? @function.builtin "^__builtin_"))
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
((call_expression
|
((call_expression
|
||||||
function: (identifier) @function.builtin))
|
function: (identifier) @function.builtin))
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(preproc_def
|
(preproc_def
|
||||||
name: (_) @constant.macro)
|
name: (_) @constant.macro)
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
(preproc_defined
|
(preproc_defined
|
||||||
(identifier) @constant.macro)
|
(identifier) @constant.macro)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @function.call)
|
function: (identifier) @function.call)
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
function: (field_expression
|
function: (field_expression
|
||||||
field: (field_identifier) @function.call))
|
field: (field_identifier) @function.call))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (identifier) @function)
|
declarator: (identifier) @function)
|
||||||
|
|
||||||
@@ -286,18 +286,18 @@
|
|||||||
(pointer_declarator
|
(pointer_declarator
|
||||||
declarator: (field_identifier) @function)))
|
declarator: (field_identifier) @function)))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(preproc_function_def
|
(preproc_function_def
|
||||||
name: (identifier) @function.macro)
|
name: (identifier) @function.macro)
|
||||||
|
|
||||||
;; #AAAAAA #000000 0 1 0 1
|
;; #99ADBF #000000 0 1 0 1
|
||||||
(comment) @comment @spell
|
(comment) @comment @spell
|
||||||
|
|
||||||
;; #AAAAAA #000000 0 1 0 1
|
;; #99ADBF #000000 0 1 0 1
|
||||||
((comment) @comment.documentation
|
((comment) @comment.documentation
|
||||||
(#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
(#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(parameter_declaration
|
(parameter_declaration
|
||||||
declarator: (identifier) @variable.parameter)
|
declarator: (identifier) @variable.parameter)
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
(preproc_params
|
(preproc_params
|
||||||
(identifier) @variable.parameter)
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"__attribute__"
|
"__attribute__"
|
||||||
"__declspec"
|
"__declspec"
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
(attribute_declaration)
|
(attribute_declaration)
|
||||||
] @attribute
|
] @attribute
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((identifier) @variable.member
|
((identifier) @variable.member
|
||||||
(#match? @variable.member "^m_.*$"))
|
(#match? @variable.member "^m_.*$"))
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@
|
|||||||
(optional_parameter_declaration
|
(optional_parameter_declaration
|
||||||
declarator: (_) @variable.parameter)
|
declarator: (_) @variable.parameter)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
((field_expression
|
((field_expression
|
||||||
(field_identifier) @function.method) @_parent)
|
(field_identifier) @function.method) @_parent)
|
||||||
|
|
||||||
@@ -352,29 +352,29 @@
|
|||||||
(function_declarator
|
(function_declarator
|
||||||
declarator: (field_identifier) @function.method)
|
declarator: (field_identifier) @function.method)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #59C2FF #000000 0 0 0 3
|
||||||
(concept_definition
|
(concept_definition
|
||||||
name: (identifier) @type.definition)
|
name: (identifier) @type.definition)
|
||||||
|
|
||||||
(alias_declaration
|
(alias_declaration
|
||||||
name: (type_identifier) @type.definition)
|
name: (type_identifier) @type.definition)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(auto) @type.builtin
|
(auto) @type.builtin
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
(namespace_identifier) @module
|
(namespace_identifier) @module
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #59C2FF #000000 0 0 0 1
|
||||||
((namespace_identifier) @type
|
((namespace_identifier) @type
|
||||||
(#match? @type "^[A-Z]"))
|
(#match? @type "^[A-Z]"))
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(case_statement
|
(case_statement
|
||||||
value: (qualified_identifier
|
value: (qualified_identifier
|
||||||
(identifier) @constant))
|
(identifier) @constant))
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(using_declaration
|
(using_declaration
|
||||||
.
|
.
|
||||||
"using"
|
"using"
|
||||||
@@ -386,11 +386,11 @@
|
|||||||
(identifier)
|
(identifier)
|
||||||
] @module)
|
] @module)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(destructor_name
|
(destructor_name
|
||||||
(identifier) @function.method)
|
(identifier) @function.method)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(function_declarator
|
(function_declarator
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @function))
|
(identifier) @function))
|
||||||
@@ -420,10 +420,10 @@
|
|||||||
|
|
||||||
"operator" @function
|
"operator" @function
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
"static_assert" @function.builtin
|
"static_assert" @function.builtin
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call_expression
|
(call_expression
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @function.call))
|
(identifier) @function.call))
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
(template_method
|
(template_method
|
||||||
(field_identifier) @function.method))
|
(field_identifier) @function.method))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call_expression
|
(call_expression
|
||||||
(field_expression
|
(field_expression
|
||||||
(field_identifier) @function.method.call))
|
(field_identifier) @function.method.call))
|
||||||
@@ -488,7 +488,7 @@
|
|||||||
(template_method
|
(template_method
|
||||||
(field_identifier) @function.method.call)))
|
(field_identifier) @function.method.call)))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
((function_declarator
|
((function_declarator
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @constructor))
|
(identifier) @constructor))
|
||||||
@@ -513,23 +513,23 @@
|
|||||||
(argument_list))
|
(argument_list))
|
||||||
(#match? @constructor "^[A-Z]"))
|
(#match? @constructor "^[A-Z]"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
(this) @variable.builtin
|
(this) @variable.builtin
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(null
|
(null
|
||||||
"nullptr" @constant.builtin)
|
"nullptr" @constant.builtin)
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(true) @boolean_true
|
(true) @boolean_true
|
||||||
|
|
||||||
;; #ee513a #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(false) @boolean_false
|
(false) @boolean_false
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #aad84c #000000 0 0 0 1
|
||||||
(raw_string_literal) @string
|
(raw_string_literal) @string
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"try"
|
"try"
|
||||||
"catch"
|
"catch"
|
||||||
@@ -537,7 +537,7 @@
|
|||||||
"throw"
|
"throw"
|
||||||
] @keyword.exception
|
] @keyword.exception
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"decltype"
|
"decltype"
|
||||||
"explicit"
|
"explicit"
|
||||||
@@ -548,7 +548,7 @@
|
|||||||
"constexpr"
|
"constexpr"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"class"
|
"class"
|
||||||
"namespace"
|
"namespace"
|
||||||
@@ -557,14 +557,14 @@
|
|||||||
"concept"
|
"concept"
|
||||||
] @keyword.type
|
] @keyword.type
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"co_await"
|
"co_await"
|
||||||
"co_yield"
|
"co_yield"
|
||||||
"co_return"
|
"co_return"
|
||||||
] @keyword.coroutine
|
] @keyword.coroutine
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"public"
|
"public"
|
||||||
"private"
|
"private"
|
||||||
@@ -573,7 +573,7 @@
|
|||||||
"virtual"
|
"virtual"
|
||||||
] @keyword.modifier
|
] @keyword.modifier
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"new"
|
"new"
|
||||||
"delete"
|
"delete"
|
||||||
@@ -590,13 +590,13 @@
|
|||||||
"or"
|
"or"
|
||||||
] @keyword.operator
|
] @keyword.operator
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
"<=>" @operator
|
"<=>" @operator
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
"::" @punctuation.delimiter
|
"::" @punctuation.delimiter
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
(template_argument_list
|
(template_argument_list
|
||||||
[
|
[
|
||||||
"<"
|
"<"
|
||||||
@@ -609,5 +609,5 @@
|
|||||||
">"
|
">"
|
||||||
] @punctuation.bracket)
|
] @punctuation.bracket)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
(literal_suffix) @operator
|
(literal_suffix) @operator
|
||||||
|
|||||||
309
grammar/ruby.scm
309
grammar/ruby.scm
@@ -1,24 +1,10 @@
|
|||||||
(heredoc_body
|
;; #FFFFFF #000000 0 0 0 1
|
||||||
;; !bash
|
|
||||||
(heredoc_content) @bash_injection
|
|
||||||
((heredoc_end) @lang
|
|
||||||
(#match? @lang "BASH"))
|
|
||||||
)
|
|
||||||
|
|
||||||
(heredoc_body
|
|
||||||
;; !ruby
|
|
||||||
(heredoc_content) @ruby_injection
|
|
||||||
((heredoc_end) @lang
|
|
||||||
(#match? @lang "RUBY"))
|
|
||||||
)
|
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
|
||||||
[
|
[
|
||||||
(identifier)
|
(identifier)
|
||||||
(global_variable)
|
(global_variable)
|
||||||
] @variable
|
] @variable
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"alias"
|
"alias"
|
||||||
"begin"
|
"begin"
|
||||||
@@ -30,17 +16,17 @@
|
|||||||
"then"
|
"then"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
"class" @keyword.type
|
"class" @keyword.type
|
||||||
|
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"return"
|
"return"
|
||||||
"yield"
|
"yield"
|
||||||
] @keyword.return
|
] @keyword.return
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"and"
|
"and"
|
||||||
"or"
|
"or"
|
||||||
@@ -48,7 +34,7 @@
|
|||||||
"not"
|
"not"
|
||||||
] @keyword.operator
|
] @keyword.operator
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"def"
|
"def"
|
||||||
"undef"
|
"undef"
|
||||||
@@ -58,7 +44,7 @@
|
|||||||
"end" @keyword.function)
|
"end" @keyword.function)
|
||||||
|
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"case"
|
"case"
|
||||||
"else"
|
"else"
|
||||||
@@ -72,7 +58,7 @@
|
|||||||
(if
|
(if
|
||||||
"end" @keyword.conditional)
|
"end" @keyword.conditional)
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"for"
|
"for"
|
||||||
"until"
|
"until"
|
||||||
@@ -83,27 +69,28 @@
|
|||||||
"next"
|
"next"
|
||||||
] @keyword.repeat
|
] @keyword.repeat
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(constant) @constant
|
(constant) @constant
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #FF8F40 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"rescue"
|
"rescue"
|
||||||
"ensure"
|
"ensure"
|
||||||
] @keyword.exception
|
] @keyword.exception
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
"defined?" @function
|
"defined?" @function
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
(call
|
(call
|
||||||
receiver: (constant)? @type
|
receiver: (constant)? @type
|
||||||
method: [
|
method: [
|
||||||
(identifier)
|
(identifier)
|
||||||
(constant)
|
(constant)
|
||||||
;; #ff5689 #000000 0 0 0 2
|
;; #FFB454 #000000 0 0 0 2
|
||||||
] @function.call)
|
] @function.call)
|
||||||
|
|
||||||
|
;; #FFB454 #000000 0 0 0 2
|
||||||
(alias
|
(alias
|
||||||
(identifier) @function)
|
(identifier) @function)
|
||||||
|
|
||||||
@@ -122,6 +109,7 @@
|
|||||||
(constant) @type
|
(constant) @type
|
||||||
])
|
])
|
||||||
|
|
||||||
|
;; #59C2FF #000000 0 0 0 2
|
||||||
(class
|
(class
|
||||||
name: (constant) @type)
|
name: (constant) @type)
|
||||||
|
|
||||||
@@ -131,26 +119,27 @@
|
|||||||
(superclass
|
(superclass
|
||||||
(constant) @type)
|
(constant) @type)
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(class_variable)
|
(class_variable)
|
||||||
(instance_variable)
|
(instance_variable)
|
||||||
] @variable.member
|
] @variable.member
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 2
|
||||||
((identifier) @keyword.modifier
|
((identifier) @keyword.modifier
|
||||||
(#match? @keyword.modifier "^(private|protected|public)$" ))
|
(#match? @keyword.modifier "^(private|protected|public)$" ))
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 3
|
;; #FF8F40 #000000 0 0 0 3
|
||||||
(program
|
(program
|
||||||
(call
|
(call
|
||||||
(identifier) @keyword.import)
|
(identifier) @keyword.import)
|
||||||
(#match? @keyword.import "^(require|require_relative|load)$"))
|
(#match? @keyword.import "^(require|require_relative|load)$"))
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 4
|
;; #D2A6FF #000000 0 0 0 4
|
||||||
((identifier) @constant.builtin
|
((identifier) @constant.builtin
|
||||||
(#match? @constant.builtin "^(__callee__|__dir__|__id__|__method__|__send__|__ENCODING__|__FILE__|__LINE__)$" ))
|
(#match? @constant.builtin "^(__callee__|__dir__|__id__|__method__|__send__|__ENCODING__|__FILE__|__LINE__)$" ))
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 3
|
;; #FFB454 #000000 0 0 0 3
|
||||||
((identifier) @function.builtin
|
((identifier) @function.builtin
|
||||||
(#match? @function.builtin "^(attr_reader|attr_writer|attr_accessor|module_function)$" ))
|
(#match? @function.builtin "^(attr_reader|attr_writer|attr_accessor|module_function)$" ))
|
||||||
|
|
||||||
@@ -159,16 +148,17 @@
|
|||||||
method: (identifier) @function.builtin)
|
method: (identifier) @function.builtin)
|
||||||
(#match? @function.builtin "^(include|extend|prepend|refine|using)$"))
|
(#match? @function.builtin "^(include|extend|prepend|refine|using)$"))
|
||||||
|
|
||||||
|
;; #FF8F40 #000000 0 0 0 3
|
||||||
((identifier) @keyword.exception
|
((identifier) @keyword.exception
|
||||||
(#match? @keyword.exception "^(raise|fail|catch|throw)$" ))
|
(#match? @keyword.exception "^(raise|fail|catch|throw)$" ))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F07178 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(self)
|
(self)
|
||||||
(super)
|
(super)
|
||||||
] @variable.builtin
|
] @variable.builtin
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(method_parameters
|
(method_parameters
|
||||||
(identifier) @variable.parameter)
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
@@ -196,7 +186,7 @@
|
|||||||
(keyword_parameter
|
(keyword_parameter
|
||||||
(identifier) @variable.parameter)
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
;; #aad84c #000000 0 0 0 1
|
;; #AAD94C #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(string_content)
|
(string_content)
|
||||||
(heredoc_content)
|
(heredoc_content)
|
||||||
@@ -204,13 +194,13 @@
|
|||||||
"`"
|
"`"
|
||||||
] @string
|
] @string
|
||||||
|
|
||||||
;; #fbb152 #000000 0 0 0 1
|
;; #E6C08A #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
(heredoc_beginning)
|
(heredoc_beginning)
|
||||||
(heredoc_end)
|
(heredoc_end)
|
||||||
] @label
|
] @label
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 2
|
;; #39BAE6 #000000 0 0 0 2
|
||||||
[
|
[
|
||||||
(bare_symbol)
|
(bare_symbol)
|
||||||
(simple_symbol)
|
(simple_symbol)
|
||||||
@@ -218,38 +208,38 @@
|
|||||||
(hash_key_symbol)
|
(hash_key_symbol)
|
||||||
] @string.special.symbol
|
] @string.special.symbol
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #95E6CB #000000 0 0 0 2
|
||||||
(regex
|
(regex
|
||||||
(string_content) @string.regexp)
|
(string_content) @string.regexp)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #95E6CB #000000 0 0 0 2
|
||||||
(escape_sequence) @string.escape
|
(escape_sequence) @string.escape
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(integer) @number
|
(integer) @number
|
||||||
|
|
||||||
;; #ebda8c #000000 0 0 0 2
|
;; #D2A6FF #000000 0 0 0 2
|
||||||
(float) @number.float
|
(float) @number.float
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(true) @boolean.true
|
(true) @boolean.true
|
||||||
|
|
||||||
;; #ee513a #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(false) @boolean.false
|
(false) @boolean.false
|
||||||
|
|
||||||
;; #ee8757 #000000 0 0 0 1
|
;; #D2A6FF #000000 0 0 0 1
|
||||||
(nil) @constant.nil
|
(nil) @constant.nil
|
||||||
|
|
||||||
;; #AAAAAA #000000 0 1 0 1
|
;; #99ADBF #000000 0 1 0 1
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
||||||
;; #51eeba #000000 0 0 0 3
|
;; #AAD94C #000000 0 0 0 3
|
||||||
((program
|
((program
|
||||||
.
|
.
|
||||||
(comment) @shebang @nospell)
|
(comment) @shebang @nospell)
|
||||||
(#match? @shebang "^#!/"))
|
(#match? @shebang "^#!/"))
|
||||||
|
|
||||||
;; #ffffff #000000 0 0 0 1
|
;; #F29668 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"!"
|
"!"
|
||||||
"="
|
"="
|
||||||
@@ -277,7 +267,7 @@
|
|||||||
":"
|
":"
|
||||||
] @operator
|
] @operator
|
||||||
|
|
||||||
;; #ffffff #000000 0 1 0 1
|
;; #F29668 #000000 0 1 0 1
|
||||||
[
|
[
|
||||||
"=="
|
"=="
|
||||||
"==="
|
"==="
|
||||||
@@ -295,7 +285,7 @@
|
|||||||
"..."
|
"..."
|
||||||
] @operator.ligature
|
] @operator.ligature
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
","
|
","
|
||||||
";"
|
";"
|
||||||
@@ -307,7 +297,7 @@
|
|||||||
(pair
|
(pair
|
||||||
":" @punctuation.delimiter)
|
":" @punctuation.delimiter)
|
||||||
|
|
||||||
;; #bd9ae6 #000000 0 0 0 1
|
;; #BFBDB6 #000000 0 0 0 1
|
||||||
[
|
[
|
||||||
"("
|
"("
|
||||||
")"
|
")"
|
||||||
@@ -325,7 +315,226 @@
|
|||||||
(block_parameters
|
(block_parameters
|
||||||
"|" @punctuation.bracket)
|
"|" @punctuation.bracket)
|
||||||
|
|
||||||
;; #e6a24c #000000 0 0 0 2
|
;; #7dcfff #000000 0 0 0 2
|
||||||
(interpolation
|
(interpolation
|
||||||
"#{" @punctuation.special
|
"#{" @punctuation.special
|
||||||
"}" @punctuation.special)
|
"}" @punctuation.special)
|
||||||
|
|
||||||
|
; Injections
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !bash
|
||||||
|
(heredoc_content) @bash_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "BASH"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !c
|
||||||
|
(heredoc_content) @c_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "C$"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !cpp
|
||||||
|
(heredoc_content) @cpp_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "CPP"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !css
|
||||||
|
(heredoc_content) @css_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "CSS"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !fish
|
||||||
|
(heredoc_content) @fish_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "FISH"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !go
|
||||||
|
(heredoc_content) @go_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GO"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !haskell
|
||||||
|
(heredoc_content) @haskell_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "HASKELL"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !html
|
||||||
|
(heredoc_content) @html_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "HTML"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !javascript
|
||||||
|
(heredoc_content) @javascript_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "JAVASCRIPT"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !json
|
||||||
|
(heredoc_content) @json_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "JSON"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !lua
|
||||||
|
(heredoc_content) @lua_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "LUA"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !make
|
||||||
|
(heredoc_content) @make_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "MAKE"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !python
|
||||||
|
(heredoc_content) @python_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "PYTHON"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !ruby
|
||||||
|
(heredoc_content) @ruby_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "RUBY"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !rust
|
||||||
|
(heredoc_content) @rust_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "RUST"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !diff
|
||||||
|
(heredoc_content) @diff_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "DIFF"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !embedded_template
|
||||||
|
(heredoc_content) @embedded_template_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "ERB"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !gdscript
|
||||||
|
(heredoc_content) @gdscript_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GDSCRIPT"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !gitattributes
|
||||||
|
(heredoc_content) @gitattributes_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GITATTRIBUTES"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !gitignore
|
||||||
|
(heredoc_content) @gitignore_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GITIGNORE"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !gomod
|
||||||
|
(heredoc_content) @gomod_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "GOMOD"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !ini
|
||||||
|
(heredoc_content) @ini_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "INI"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !markdown
|
||||||
|
(heredoc_content) @markdown_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "MARKDOWN"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !nginx
|
||||||
|
(heredoc_content) @nginx_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "NGINX"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !php
|
||||||
|
(heredoc_content) @php_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "PHP"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !query
|
||||||
|
(heredoc_content) @query_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "QUERY"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !regex
|
||||||
|
(heredoc_content) @regex_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "REGEX"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !sql
|
||||||
|
(heredoc_content) @sql_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "SQL"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !toml
|
||||||
|
(heredoc_content) @toml_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "TOML"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !yaml
|
||||||
|
(heredoc_content) @yaml_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "YAML"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(heredoc_body
|
||||||
|
;; !cabal
|
||||||
|
(heredoc_content) @cabal_injection
|
||||||
|
((heredoc_end) @lang
|
||||||
|
(#match? @lang "CABAL"))
|
||||||
|
)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ static const std::unordered_map<uint8_t, LSP> kLsps = {
|
|||||||
|
|
||||||
static const std::unordered_map<std::string, Language> kLanguages = {
|
static const std::unordered_map<std::string, Language> kLanguages = {
|
||||||
{"bash", {"bash", LANG(bash)}},
|
{"bash", {"bash", LANG(bash)}},
|
||||||
{"c", {"c", LANG(c), 1}},
|
{"c", {"c", LANG(cpp), 1}},
|
||||||
{"cpp", {"cpp", LANG(cpp), 1}},
|
{"cpp", {"cpp", LANG(cpp), 1}},
|
||||||
{"h", {"h", LANG(cpp), 1}},
|
{"h", {"h", LANG(cpp), 1}},
|
||||||
{"css", {"css", LANG(css)}},
|
{"css", {"css", LANG(css)}},
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ struct Language {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TS_DEF(bash);
|
TS_DEF(bash);
|
||||||
TS_DEF(c);
|
|
||||||
TS_DEF(cpp);
|
TS_DEF(cpp);
|
||||||
TS_DEF(css);
|
TS_DEF(css);
|
||||||
TS_DEF(fish);
|
TS_DEF(fish);
|
||||||
|
|||||||
Submodule libs/tree-sitter-c deleted from ae19b676b1
@@ -28,12 +28,13 @@ handle_error() {
|
|||||||
trap 'handle_error $LINENO' ERR
|
trap 'handle_error $LINENO' ERR
|
||||||
|
|
||||||
# Multiline string test
|
# Multiline string test
|
||||||
read -r -d '' MULTI <<'EOF'
|
read -r -d '' MULTI <<'CPP'
|
||||||
This is a multi-line
|
|
||||||
string used to test
|
int main() {
|
||||||
syntax highlighting for
|
|
||||||
here-documents.
|
}
|
||||||
EOF
|
|
||||||
|
CPP
|
||||||
|
|
||||||
log INFO "Multi-line string loaded"
|
log INFO "Multi-line string loaded"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user