Failed parsing compound operator without brackets in function body.
cattokomo opened this issue · comments
In Bash, you can have anything listed in compound operators as function body, including [[ ... ]]
, ((...))
, if ...; then ...; fi
, etc. But the parser failed to parse those.
For example:
is_foo() [[ "$1" = foo ]] # The parser failed in here because there's no brackets.
assert()
if ! $1; then # Failed here because there's no brackets and the parser expected one.
echo "${2:-assertion failed}" >&2
return 1
fi