mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
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:
parent
7e3c4f8089
commit
76c00934a6
1 changed files with 10 additions and 7 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue