ietf-nntp Wildmats

Russ Allbery rra at stanford.edu
Sun Nov 19 01:52:35 PST 2000


Clive D W Feather <clive at demon.net> writes:

> Based on the comments here, I've done a new version of section 5 and also
> noted wording changes for all command using wildmat except PAT.

> It can be seen at <http://www.davros.org/nntp-texts/section-5.txt>.

This section:

  - Where a wildmat-set-body contains one or more "-"s, they shall be
    examined from left to right; each shall be the centre of a
    wildmat-set-1-range or wildmat-set-2-range if the whole wildmat-set-body
    can be thus parsed.

implies that there's some backtrack and rescanning needed for some types
of ranges.  It turns out, unless I missed something when writing an
implementation, that there actually aren't any.  If you take any
non-initial "-" to be a range separator as soon as you encounter it and
consider the character before and after it in that light, unless it's the
last character of the range, you'll always find a valid parse and there's
never any need to backtrack.  (You can get ranges where the final
character is less than the initial character, but that's not a syntax
error, just an undefined range.)

You need either a single character of lookahead or prior knowledge of
where the range ends so that you know if the "-" is the final character of
the set, but that's all the complexity that's needed.

Also, I think we should drop \s to match spaces if we're going to use \u.
And do we really need to rule out all control characters in the wildmat
grammar?  We need to rule out nul, CR, LF, tab, and space, but the rest
should be okay, and some of them (ESC in particular) are useful.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the ietf-nntp mailing list