Mike Jonkmans <bash...@jonkmans.nl> writes:
> Some examples that work:
>       function x { :; } ## as expected
>       function x if :; then :; fi
>       function x (( 42 ))
>       function x [[ 42 ]]
>       function x for x do :; done
>       function x for (( ; 42 - 42 ; )); do :; done
>
> What does not work:
>       function x ( : )

Check your Bash version.  IIRC, recent versions (e.g. 5.1) have a minor
change in the Bison grammar (parse.y) for function definitions, IIRC
that I provided.  The purpose was to stop Bison from giving an annoying
"parse conflict" message when compiling the grammar, but looking at it,
it should allow your example to work, because it gets the parser to
handle all the cases as they are specified in the manual page.

Dale

Reply via email to