-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ville Laurikari wrote:
> On Fri, Nov 06, 2009 at 04:20:32AM -0500, Daniel Colascione wrote:
>> Ville Laurikari wrote:
>>> I'm not sure how easy it is to remove tha one character lookaead, but
>>> the matcher should definitely stop eating the string if a match is not
>>> possible.
>> Here is a patch that removes the lookahead when using the parallel
>> matcher (which is the case I care about). With this patch, the matcher
>> will always read exactly as many characters as necessary to match the
>> pattern.
> 
> Fantastic, thank you!   I trust you did a "make check" ?

Continually. Is it possible to break that up somehow so failed cases can be 
re-run individually?

> 
>> The patch doesn't address the runaway failure problem, however.
> 
> That problem turns out to be a little bit more subtle than I
> originally though.  Still fixable.

Yeah. I looked into it myself. Because the strategy
used to start the matching is to just loop through the subject until one of the
initial states matches, the code winds its way through the whole string without
realizing that these patterns will *never* match. I tried adding some code
that would abort if a feasible match weren't found, but that ended up causing
test failures, so I have to poke at it some more.

By the way: why do you take that approach instead of matching the initial
states only at the beginning of the subject, and prefixing unanchored patterns
with the equivalent of ".*"?

>> Do you have a policy on C99 and GNU C extensions, by the way? Both can
>> make the code a lot cleaner.
> 
> The policy is to be Very Portable, whatever that means in practice.
> 
> This code is used on AIX, HP-UX, Solaris, Linux, Windows, *BSD, IRIX,
> OS X, the iPhone, various other embedded systems, and so on.  The code
> compiles with a dozen different C compilers.  I'd like to keep it that
> way.
> 
> So, GNU C extensions are out of the question.  Back when the code was
> originally written, C99 was too new to be realistic.  Today, it might
> be.

Last time I checked, MSVC doesn't support most C99 features either,
though inline functions apparently work.
I suppose C89 (plus inline functions) it is.

Of course, the other option is to compile as C++ and export an extern "C"
interface, but I suspect some users wouldn't be too keen on that idea.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkrz80oACgkQ17c2LVA10VuDyACgivIgkdrIqE1sUrwOezA8O0AV
COwAn347m+x3Xpz1Z0nm9NnumNZjxQ4u
=VpK5
-----END PGP SIGNATURE-----
_______________________________________________
TRE-general mailing list tre-general@laurikari.net
http://laurikari.net/mailman/listinfo/tre-general
http://laurikari.net/tre/

Reply via email to