[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sieve - definition of comments



Sieve.all,
 
I have a little problem with the comments in the sieve language as specified in draft 05.
 
1) firts of all, comments cannot have white spaces according to the rule
comment    = "#" *VCHAR CRLF
since VCHAR is defined in ABNF as
VCHAR         = %x21-7e ; visible (printing) characters
and it is not overruled in the sieve spec. This does not include spaces and \t. Until now, I defined it to be
comment       = "#" *(SP / HTAB / VCHAR) CRLF
(btw. WSP in the ABNF doc is defined to be (SP / HTAB) while in the sieve draft it is (SP / HTAB / CRLF) but this is not really a problem)
 
2) As I read it, a sieve script cannot start with a comment according to the definition:
start        = commands
commands     = *([WSP] command [WSP])
command      = identifier *(WSP argument) [WSP] (";" / block)
This tells that every script should start with an identifier. Maybe start could be more like
start        = *(commands / comments)
This is actually not correct but I do not understand where comments can be put. Especially the example script at 2.3
if size :over 100K { # this is a comment
    discard;
}
Comment is embedded in command in this specific example:
command  = identifier *(WSP argument) [WSP] ( ";" / block )
block    = "{" commands "}"
commands = *([WSP] command [WSP])
argument = string / string-list / number / tag / test
I cannot think about the best way to insert 'comments' somewhere right now but before I try to think of something, I will wait if these issues made sense.
 
Also, I think almost every [WSP} should be replaced with *[WSP], or even better, with LWSP.
 
- Wilbert