On Sat, Jan 19, 2002 at 12:28:15AM +0200, Jarkko Hietaniemi wrote: > On Fri, Jan 18, 2002 at 02:22:49PM -0800, Steve Fink wrote: > > On Sat, Jan 19, 2002 at 12:11:06AM +0200, Jarkko Hietaniemi wrote: > > > Complement of an inversion list is neat: insert 0 at the beginning > > > (and append max+1), unless there already is one, in which case delete > > > the 0 (and shift the list and delete the max+1). Again, O(N). > > > (One could of course have a bit for a 'negative character class', > > > but that would in turn complicate the computations.) > > > > If we have hybrid notation, we'll be stuck with not only a bit for > > that, but also a complete expression tree for character classes. > > (Which is necessary if we use a Unicode library that only exposes > > property test functions, not numeric ranges.) > > > > We *do* want to have (with some notation) > > [[:digit:]\p{FunkyLooking}aeiou except 7], right? > > Of course. But that is all resolvable in regex compile time. > No expression tree needed.
My point was that if inversion lists are insufficient for describing all the character classes we might be interested in, then we'll need the tree. And an example of why inversion lists would be insufficient is if we have a character API that only allows queries of the sort "is this character FunkyLooking or not?", rather than "what ranges of characters are FunkyLooking?" (Unless you want to do "is 0 FunkyLooking? is 1 FunkyLooking? ... is 4294967295 FunkyLooking?" at compile time.) > compile time. (Don't say "locales" or I'll ha've have to hurt you, > for your own good. :-) Was the ' in ha've unintentional, or is that an acute accent mark? :-)