[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    BUG: grammar handler needs to be fixed to recognize Bash syntax.... (was Re: function grammar)
From:       Linda Walsh <bash () tlinx ! org>
Date:       2010-07-20 21:09:45
Message-ID: 4C461099.2050502 () tlinx ! org
[Download RAW message or body]

The following function is legal syntax, but yields an error:

function good_dir [[ -n $1 && -d $1 && -r $1  && -x $1 ]]

bash: syntax error near unexpected token `[['
----

To which Andreas comments that it's a grammar bug:


Andreas Schwab wrote:
> Bernd Eggink <monoped@sudrala.de> writes:
> 
>> "If the function reserved word is supplied,  the  parentheses  are
>> optional."
> 
> While the grammer has the right rules for this the handling inside of
> special_case_tokens isn't right up to it, it only recognizes '{'
> following 'function WORD'.
> 
> Andreas.
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic