2024-07-28 15:54:10 +02:00
|
|
|
; This file specifies how matched syntax patterns should be highlighted
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
[
|
|
|
|
"export"
|
|
|
|
"import"
|
|
|
|
] @keyword.control.import
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
"mod" @keyword.directive
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
[
|
|
|
|
"alias"
|
|
|
|
"set"
|
|
|
|
"shell"
|
|
|
|
] @keyword
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
[
|
|
|
|
"if"
|
|
|
|
"else"
|
|
|
|
] @keyword.control.conditional
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
; Variables
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
(value
|
|
|
|
(identifier) @variable)
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
(alias
|
2024-08-09 17:26:48 +02:00
|
|
|
name: (identifier) @variable)
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
(assignment
|
2024-08-09 17:26:48 +02:00
|
|
|
name: (identifier) @variable)
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
(shell_variable_name) @variable
|
2023-04-14 17:03:21 +02:00
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
; Functions
|
2024-07-28 15:54:10 +02:00
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
(recipe
|
2024-07-28 15:54:10 +02:00
|
|
|
name: (identifier) @function)
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
(recipe_dependency
|
|
|
|
name: (identifier) @function.call)
|
2024-07-28 15:54:10 +02:00
|
|
|
|
|
|
|
(function_call
|
2024-08-09 17:26:48 +02:00
|
|
|
name: (identifier) @function.builtin)
|
2024-07-28 15:54:10 +02:00
|
|
|
|
|
|
|
; Parameters
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
(recipe_parameter
|
2024-07-28 15:54:10 +02:00
|
|
|
name: (identifier) @variable.parameter)
|
|
|
|
|
|
|
|
; Namespaces
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
(mod
|
2024-07-28 15:54:10 +02:00
|
|
|
name: (identifier) @namespace)
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
; Paths
|
|
|
|
|
|
|
|
(mod
|
|
|
|
(path) @string.special.path)
|
|
|
|
|
|
|
|
(import
|
|
|
|
(path) @string.special.path)
|
|
|
|
|
|
|
|
; Shebangs
|
|
|
|
|
|
|
|
(shebang_line) @keyword.directive
|
|
|
|
(shebang_line
|
|
|
|
(shebang_shell) @string.special)
|
|
|
|
|
|
|
|
|
|
|
|
(shell_expanded_string
|
|
|
|
[
|
|
|
|
(expansion_short_start)
|
|
|
|
(expansion_long_start)
|
|
|
|
(expansion_long_middle)
|
|
|
|
(expansion_long_end)
|
|
|
|
] @punctuation.special)
|
|
|
|
|
2024-07-28 15:54:10 +02:00
|
|
|
; Operators
|
|
|
|
|
|
|
|
[
|
|
|
|
":="
|
|
|
|
"?"
|
|
|
|
"=="
|
|
|
|
"!="
|
|
|
|
"=~"
|
|
|
|
"@"
|
|
|
|
"="
|
|
|
|
"$"
|
|
|
|
"*"
|
|
|
|
"+"
|
|
|
|
"&&"
|
|
|
|
"@-"
|
|
|
|
"-@"
|
|
|
|
"-"
|
|
|
|
"/"
|
|
|
|
":"
|
|
|
|
] @operator
|
|
|
|
|
|
|
|
; Punctuation
|
|
|
|
|
|
|
|
"," @punctuation.delimiter
|
|
|
|
|
|
|
|
[
|
|
|
|
"{"
|
|
|
|
"}"
|
|
|
|
"["
|
|
|
|
"]"
|
|
|
|
"("
|
|
|
|
")"
|
|
|
|
"{{"
|
|
|
|
"}}"
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
[ "`" "```" ] @punctuation.special
|
|
|
|
|
|
|
|
; Literals
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
; Booleans are not allowed anywhere except in settings
|
|
|
|
(setting
|
|
|
|
(boolean) @constant.builtin.boolean)
|
2024-07-28 15:54:10 +02:00
|
|
|
|
|
|
|
[
|
|
|
|
(string)
|
|
|
|
(external_command)
|
|
|
|
] @string
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
[
|
|
|
|
(escape_sequence)
|
|
|
|
(escape_variable_end)
|
|
|
|
] @constant.character.escape
|
2024-07-28 15:54:10 +02:00
|
|
|
|
|
|
|
; Comments
|
|
|
|
|
|
|
|
(comment) @comment.line
|
|
|
|
|
2024-08-09 17:26:48 +02:00
|
|
|
; highlight known settings
|
2024-07-28 15:54:10 +02:00
|
|
|
(setting
|
2024-08-09 17:26:48 +02:00
|
|
|
name: (_) @keyword.function)
|
|
|
|
|
|
|
|
; highlight known attributes
|
2024-07-28 15:54:10 +02:00
|
|
|
(attribute
|
2024-08-09 17:26:48 +02:00
|
|
|
name: (identifier) @attribute)
|
2024-07-28 15:54:10 +02:00
|
|
|
|
|
|
|
; Numbers are part of the syntax tree, even if disallowed
|
|
|
|
(numeric_error) @error
|