Re: draft-ietf-httpbis-p1-messaging-16 1.2.1 ABNF Extension: #rule - Invalid example?

Hi Håkan,

Sending an e-mail to the list is fine. Our resident ABNF experts will have a look and get back to you as soon as possible. Thanks for taking the time to send feedback.

Cheers,


On 26/10/2011, at 7:19 AM, Håkan wrote:

> Hi.
> 
> I'm new to all this, so I'm sorry if I'm not following protocol (not sure if I should open an Issue Ticket or start by mailing the group first)
> 
> 
> I've found examples that do not add up in p1-messaging 1.2.1.  ABNF Extension: #rule
> 
> >   For compatibility with legacy list rules, recipients SHOULD accept
> >   empty list elements.  In other words, consumers would follow the list
> >   productions:
> >
> >     #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
> >
> >     1#element => *( "," OWS ) element *( OWS "," [ OWS element ] )
> ...
> >  For example, given these ABNF productions:
> >
> >     example-list      = 1#example-list-elmt
> >     example-list-elmt = token ; see Section 3.2.3
> >
> >   Then these are valid values for example-list (not including the
> >   double quotes, which are present for delimitation only):
> >
> >     "foo,bar"
> >     " foo ,bar,"
> >     "  foo , ,bar,charlie   "
> >     "foo ,bar,   charlie "
> 
> token is defined as 1*tchar and tchar is one character from a set of visible character. Since space is not a tchar, token cannot contain a space.
> 
> In the second example " foo, bar,", since token cannot contain spaces, I cant see how a space can be the first character. Given that I've read the ABNF correctly, the only allowable first character is "," or a tchar. The only way a space can come before token is if it's following a comma ",". So this would be valid: ", foo ,bar,"
> The same problem exists in example 3 as well,
> 
> If we look at example 3 and example 4 they end with spaces. That's not allowed. According to the rules they may only end on a tchar or ",".
> 
> I'm guessing the rules are correct, so the first and last spaces in example 2-4 should be removed.
>      "foo,bar"
>      "foo ,bar,"
>      "foo , ,bar,charlie"
>      "foo ,bar,   charlie"
> 
> 
> I hope I didn't get this completely wrong.
> 
> Håkan Canberger
> 

--
Mark Nottingham   http://www.mnot.net/

Received on Tuesday, 25 October 2011 22:51:44 UTC