feat(bash): improve highlights

This commit is contained in:
ObserverOfTime 2023-08-23 13:02:30 +03:00
parent 99eef501a3
commit 1ff7985a74
3 changed files with 50 additions and 38 deletions

View file

@ -15,7 +15,7 @@
"revision": "244426241376b08d9531616290d657106ec8f7ff" "revision": "244426241376b08d9531616290d657106ec8f7ff"
}, },
"bash": { "bash": {
"revision": "42ab5ca0e6bb7130c397c7ca10440fd5cfc2d564" "revision": "aaae047b927bcbd04ddbb07b32b555831c482c1a"
}, },
"bass": { "bass": {
"revision": "27f110dfe79620993f5493ffa0d0f2fe12d250ed" "revision": "27f110dfe79620993f5493ffa0d0f2fe12d250ed"

View file

@ -1,36 +1,21 @@
(simple_expansion) @none
(expansion
"${" @punctuation.special
"}" @punctuation.special) @none
[ [
"(" "(" ")"
")" "{" "}"
"((" "[" "]"
"))" "[[" "]]"
"{"
"}"
"["
"]"
"[["
"]]"
] @punctuation.bracket ] @punctuation.bracket
[ [
";" ";"
";;" ";;"
(heredoc_start) "&"
] @punctuation.delimiter ] @punctuation.delimiter
[
"$"
] @punctuation.special
[ [
">" ">"
">>" ">>"
"<" "<"
"<<" "<<"
"&"
"&&" "&&"
"|" "|"
"||" "||"
@ -48,8 +33,14 @@
(raw_string) (raw_string)
(ansi_c_string) (ansi_c_string)
(heredoc_body) (heredoc_body)
(simple_heredoc_body)
] @string ] @string
[
(heredoc_start)
(heredoc_end)
] @label
(variable_assignment (word) @string) (variable_assignment (word) @string)
[ [
@ -92,14 +83,23 @@
(#any-of? @boolean "true" "false")) (#any-of? @boolean "true" "false"))
(comment) @comment @spell (comment) @comment @spell
(test_operator) @string
(command_substitution (test_operator) @operator
[ "$(" ")" ] @punctuation.bracket)
(process_substitution (command_substitution "$(" @punctuation.bracket)
[ "<(" ")" ] @punctuation.bracket) (process_substitution "<(" @punctuation.bracket)
(arithmetic_expansion
[ "$((" "((" ] @punctuation.special
"))" @punctuation.special)
(arithmetic_expansion "," @punctuation.delimiter)
(ternary_expression [ "?" ":" ] @conditional.ternary)
(binary_expression operator: _ @operator)
(unary_expression operator: _ @operator)
(postfix_expression operator: _ @operator)
(function_definition (function_definition
name: (word) @function) name: (word) @function)
@ -124,6 +124,7 @@
(concatenation (word) @parameter) (concatenation (word) @parameter)
]) ])
(number) @number
((word) @number ((word) @number
(#lua-match? @number "^[0-9]+$")) (#lua-match? @number "^[0-9]+$"))
@ -131,8 +132,19 @@
descriptor: (file_descriptor) @operator descriptor: (file_descriptor) @operator
destination: (word) @parameter) destination: (word) @parameter)
(simple_expansion
"$" @punctuation.special) @none
(expansion (expansion
[ "${" "}" ] @punctuation.bracket) "${" @punctuation.special
"}" @punctuation.special) @none
(expansion operator: _ @punctuation.special)
(expansion "@" . operator: _ @character.special)
((expansion
(subscript
index: (word) @character.special))
(#any-of? @character.special "@" "*"))
(variable_name) @variable (variable_name) @variable

View file

@ -1,6 +1,6 @@
if (( $(tree-sitter parse test/Petalisp/**/*.lisp -q | wc -l) > 2 )); then if (( $(tree-sitter parse test/Petalisp/**/*.lisp -q | wc -l) > 2 )); then
# ^ punctuation.bracket # ^ punctuation.special
# ^ punctuation.bracket # ^ punctuation.special
# ^ punctuation.bracket # ^ punctuation.bracket
exit 1 exit 1
fi fi