conch-parser icon indicating copy to clipboard operation
conch-parser copied to clipboard

Bash Compatibility: Subscripts

Open eth-p opened this issue 4 years ago • 0 comments

conch-parser is currently unable to parse subscripts in variable substitutions.

echo "${BASH_SOURCE[0]}"
#                  ^^^ -- BadSubst(SquareOpen, ...)

It also doesn't correctly parse variable assignments with subscripts, using redirects_or_cmd_words instead of redirect_or_env_vars:

arr[0]="value"
arr["key"]="value"

Reference: https://www.gnu.org/software/bash/manual/html_node/Arrays.html

eth-p avatar Mar 31 '21 23:03 eth-p