[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sieve bugs
On 26 Dec 1998, Larry Greenfield wrote:
> Rob Earhart suggested the following fix for the grammar:
> I'd solve this by removing "test" as a possible "argument", and putting
> an optional "test" into the rule for "command", just before the block /
> ";". I think this still fits with all the existing commands, and makes
> the system as a whole cleaner. [...]
>
> Unfortunately, this doesn't work. A "not" takes a test as an
> argument, and this would prevent that.
Oops--missed that. Yeah, you really need the optional test at the end
of the "test" rule as well. How 'bout something like
test = identifier arguments
command = identifier arguments [WSP] ( ";" / block )
arguments = *(WSP argument) [WSP (test / test-list)]
? (It's also possible to just make test-list an argument, but the
optional test really needs to be there with both test and command; this
isn't ambiguous, because there's still only one optional test at the end
of a test or command, so the parser can always shift when it sees a test
without the parens.)
)Rob