[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `looking-back' strange warning
From: |
Stefan Monnier |
Subject: |
Re: `looking-back' strange warning |
Date: |
Sat, 03 Oct 2015 14:11:08 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>> It could be made faster
> Oh yes.
BTW, one easyish way to make a "fast looking-back" would be the
following:
- take GNU ELPA's "lex" package.
- add function that reverses a lex regexp (these are rx.el style sexps,
so such a reversal should be very easy to do).
- copy "lex-match-buffer" into a new "lex-match-buffer-backward"
reversing the operations to go backward (we're talking about 30 lines
of code only).
- put it all together "lex-parse-re -> mylex-reverse ->
lex-compile -> lex-match-buffer-backward".
The result should be reasonably fast, assuming all the steps until
lex-compile can be done at compile-time (in my tests lex-match-buffer
was reasonably competitive with the regexp.c engine, even tho it's
written in Elisp).
Of course it won't be 100% compatible with looking-back. E.g. lex.el
doesn't support backreferences and you can't extract the submatches.
Stefan
- RE: `looking-back' strange warning, (continued)
- RE: `looking-back' strange warning, Drew Adams, 2015/10/08
- Re: `looking-back' strange warning, Andreas Röhler, 2015/10/08
- Re: `looking-back' strange warning, Michael Heerdegen, 2015/10/08
- Re: `looking-back' strange warning, Stefan Monnier, 2015/10/08
- RE: `looking-back' strange warning, Drew Adams, 2015/10/08
- Re: `looking-back' strange warning, Tom Tromey, 2015/10/08
- Re: `looking-back' strange warning, Stefan Monnier, 2015/10/08
- Re: `looking-back' strange warning,
Stefan Monnier <=
- Re: `looking-back' strange warning, Dmitry Gutov, 2015/10/08
Re: `looking-back' strange warning, Andreas Röhler, 2015/10/08
Re: `looking-back' strange warning, Stefan Monnier, 2015/10/08
Re: `looking-back' strange warning, Tassilo Horn, 2015/10/08
Re: `looking-back' strange warning, Artur Malabarba, 2015/10/08
Re: `looking-back' strange warning, Tassilo Horn, 2015/10/08