regex: Separate nodes for Unicode semantics \s \w
authorKarl Williamson <public@khwilliamson.com>
Mon, 27 Dec 2010 19:04:58 +0000 (12:04 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 17 Jan 2011 02:13:23 +0000 (19:13 -0700)
commit980866de2cf8ecdb4bb72b7f9294763057008f50
tree12181265f19e25cee56c0aedbcb7c2b800dac516
parente9a9c1bc8f07e26bc67469d06565175d89c127fa
regex: Separate nodes for Unicode semantics \s \w

This patch converts the \s, \w and complements Unicode semantics to
instead of using the flags field of their nodes to instead use separate
nodes.  This gains some efficiency, especially useful in tight loops and
backtracking of regexec.c, and prepares the way for easily adding other
semantic variations, such as /a.

It refactors the CCC_TRY... macros.  I tried to break this piece up into
smaller chunks, but found it much easier to get to this in one step.
Further patches will do some more refactoring of these.

As part of the CCC_TRY macro refactoring, the lines that include the
test if (! nextchr) are changed to just look for the end-of-string by
position instead of it being NUL.  In locales, it could be (however
unlikely), that NUL is a real alphabetic, digit, or space character.
regcomp.c
regexec.c