[Bug] Shorthand assignment operator `+=` is not supported by Bash 2
We could add a flag --out-version=X in scope of this issue to determine which bash version output should be produced to keep outputted Bash be the most readable possible. By default we'd support Bash 2.
--out-version=3
arr+=("value")
--out-version=2
arr=("${arr[@]}" "value")
Also we could replace seq in range generation for Bash 3 with {a..b} syntax. Example syntax:
--out-version=3
{0..10}
--out-version=2
seq 0 10
wouldn't that mean that we'd have to reimplement translator for each bash version? kinda seems like overkill for me
Nope. We could get the version in the syntax module
I can create a draft to better visualize this. Bash version 3 isn’t a different language. We could just determine if translating one syntax formula can lead to a bit different representation in resulting Bash.
Wondering if it is better a CLI parameter or a comment in the amber file that specify the bash version to support.