Re: [RFC] Tokenizer API

From: Kinkie <gkinkie_at_gmail.com>
Date: Wed, 11 Dec 2013 19:15:28 +0100

>> CharacterSet(const char * const c, size_t len)
>
> You do not want the len argument. These character sets will be nearly
> always initialized once, from constant hard-coded c-strings.
> For esoteric cases, I would add an add(const char c) method to add a
> single character to the set (and use the merge operation to produce more
> elaborate sets as needed, see below for a sketch).

Yes, but without it it's not possible to specify \0 as a valid
character in the set.
Possible solution: make len optional. If 0, default to strlen().
That would allow to cover one possible esoteric case without impacting
the common case. What do you think?

Kinkie
Received on Wed Dec 11 2013 - 18:15:41 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 11 2013 - 12:00:11 MST