help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: will we ever have zero width assertions in regexps?


From: Ilya Zakharevich
Subject: Re: will we ever have zero width assertions in regexps?
Date: Wed, 2 Feb 2011 15:09:21 +0000 (UTC)
User-agent: slrn/0.9.8.1pl1 (Linux)

On 2011-01-31, Stefan Monnier <address@hidden> wrote:
>> So you have a REx which is matched against a line, but you want (in
>> addition to the usual effects of matching) to know whether it "wanted"
>> the match to overflow into the following line?
>
>> If so, it looks like "reusing the continuation state" would not be a
>> serious optimization - it would add just a small multiplicative
>> constant to the "use only the hypothetical bit" scenario...
>
> We could probably make it work with just that extra bit, indeed.
> But with the full intermediate state, we get to just "start the search
> with last line's state" instead of having to "start the search from the
> previous N lines since they all ended with the <wantmore> bit set", so
> it will happily work with many-lines cases without having to reparse
> those many lines N times.

Hmm, I thought about a different scenario: if the bit is set, then one
switches to a DIFFERENT REx designed for a multi-line case.  Otherwise
why not just run it against the rest of the buffer, instead of
one-line?

Ilya


reply via email to

[Prev in Thread] Current Thread [Next in Thread]