unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: emacs-devel@gnu.org
Cc: Daniel Colascione <dancol@dancol.org>
Subject: Re: [Emacs-diffs] master 938d252 4/4: Make regex matching reentrant; update syntax during match
Date: Sun, 17 Jun 2018 14:42:25 -0400	[thread overview]
Message-ID: <jwvy3fdgt0v.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <20180616204653.86AFC203CB@vcs0.savannah.gnu.org> (Daniel Colascione's message of "Sat, 16 Jun 2018 16:46:53 -0400 (EDT)")

>     (unfreeze_pattern, freeze_pattern): New functions.
>     (compile_pattern): Return a regexp_cache pointer instead of the
>     re_pattern_buffer, allowing callers to use `freeze_pattern' if
>     needed.  Do not consider busy patterns as cache hit candidates;
>     error if we run out of non-busy cache entries.

IIRC the main/only reason why you can't use a compiled pattern in
a reentrant way is because the \{N,M\} repetitions use a counter that's
stored directly within the compiled pattern.

But these are fairly rare.

So we could easily change the code to add a boolean stating whether there
is such a repetition-counter in the pattern, and if there isn't then
"freeze" can just do nothing because we can freely use that pattern
multiple times at the same time.


        Stefan



       reply	other threads:[~2018-06-17 18:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180616204650.8423.73499@vcs0.savannah.gnu.org>
     [not found] ` <20180616204653.86AFC203CB@vcs0.savannah.gnu.org>
2018-06-17 18:42   ` Stefan Monnier [this message]
2018-06-17 18:51     ` [Emacs-diffs] master 938d252 4/4: Make regex matching reentrant; update syntax during match Daniel Colascione
2018-06-17 19:18       ` Daniel Colascione
2018-06-17 19:34         ` Stefan Monnier
2018-06-17 19:50           ` Daniel Colascione
2018-06-17 19:30       ` Stefan Monnier
2018-06-18 15:59       ` Perry E. Metzger
2018-06-18 17:49         ` Daniel Colascione
2018-06-19 13:40           ` Perry E. Metzger
2018-06-19 13:44             ` Perry E. Metzger
2018-06-19 13:49               ` Daniel Colascione
2018-06-19 14:30                 ` Perry E. Metzger
2018-06-19 14:33                   ` Perry E. Metzger
2018-06-19 14:48                     ` Daniel Colascione
2018-06-19 15:37                       ` Perry E. Metzger
2018-06-19 16:20                         ` Paul Eggert
2018-06-19 16:27                           ` Perry E. Metzger
2018-06-19 17:46                             ` Stefan Monnier
2018-06-19 18:18                               ` Daniel Colascione
2018-06-19 18:26                               ` Perry E. Metzger
2018-06-19 16:54                           ` John Wiegley
2018-06-19 17:04                             ` Perry E. Metzger
2018-06-19 18:20                               ` John Wiegley
2018-06-19 18:04                             ` Paul Eggert
2018-06-19 18:16                               ` Daniel Colascione
2018-06-19 18:26                                 ` Paul Eggert
2018-06-19 18:03                           ` Andreas Schwab
2018-06-19 18:48                             ` Paul Eggert
2018-06-19 14:46                   ` Daniel Colascione
2018-06-19 14:58                     ` Andreas Schwab
2018-06-19 15:32                       ` Perry E. Metzger
2018-06-18 23:25         ` Richard Stallman
2018-06-19  1:30           ` Perry E. Metzger
2018-06-19 22:54             ` Richard Stallman
2018-06-20  1:17               ` Perry E. Metzger
2018-06-20 23:26                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy3fdgt0v.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).