feat(bash): add additional queries

* function definition and function body
* array
* subscript (array index)
* arithmetic expression
This commit is contained in:
Hoang Nguyen 2023-12-10 00:00:00 +07:00
parent 47404636a3
commit 84fc4babdc
No known key found for this signature in database
GPG key ID: B0567C20730E9B11
2 changed files with 30 additions and 0 deletions

View file

@ -15,3 +15,23 @@
(subshell
"(" @delimiter
")" @delimiter @sentinel) @container
(array
"(" @delimiter
")" @delimiter @sentinel) @container
(function_definition
"(" @delimiter
")" @delimiter @sentinel) @container
(arithmetic_expansion
"$((" @delimiter
"))" @delimiter @sentinel) @container
(compound_statement
"{" @delimiter
"}" @delimiter @sentinel) @container
(subscript
"[" @delimiter
"]" @delimiter @sentinel) @container

View file

@ -18,3 +18,13 @@ fi
# Sub-shells
(true; false; (true; true; (false; true)))
person() {
array=(
[Alice]="$((2 ^ 10))"
[Bob]=2048
)
echo "${array[$1]}"
}
person "Alice"