Bash: update highlights

Following some of our conventions and some bits from atom
https://github.com/atom/language-shellscript/blob/master/grammars/tree-sitter-bash.cson:

- Uppercase var are constants
- `$` is a special symbol, not part of the name
- Builtin constants and functions
This commit is contained in:
Santos Gallegos 2020-09-12 18:32:48 -05:00 committed by Stephan Seitz
parent 7e3c4f8089
commit 76c00934a6

View file

@ -63,13 +63,10 @@
"unset"
] @keyword
[
(special_variable_name)
("$" (special_variable_name))
] @constant
(special_variable_name) @constant
((word) @constant
(#vim-match? @constant "SIG(INT|TERM|QUIT|TIN|TOU|STP|HUP)"))
((word) @constant.builtin
(#vim-match? @constant.builtin "SIG(INT|TERM|QUIT|TIN|TOU|STP|HUP)"))
((word) @boolean
(#vim-match? @boolean "true|false"))
@ -87,7 +84,10 @@
(function_definition
name: (word) @function)
(command_name (word)) @function
(command_name (word) @function)
((command_name (word) @function.builtin)
(#match? @function.builtin "^(cd|echo|eval|exit|getopts|pushd|popd|return|set|shift)$"))
(command
argument: [
@ -106,6 +106,9 @@
(variable_name) @variable
((variable_name) @constant
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
(case_item
value: (word) @parameter)