From: Michal Nazarewicz <mina86@mina86.com>
To: 24071@debbugs.gnu.org
Subject: bug#24071: [PATCH 6/7] Remove dead opcodes in regex bytecode
Date: Wed, 27 Jul 2016 18:50:46 +0200 [thread overview]
Message-ID: <1469638247-20131-6-git-send-email-mina86@mina86.com> (raw)
In-Reply-To: <1469638247-20131-1-git-send-email-mina86@mina86.com>
There is no way to specify before_dot and after_dot opcodes in a regex
so code handling those ends up being dead. Remove it.
* src/regex.c (print_partial_compiled_pattern, regex_compile,
analyze_first, re_match_2_internal): Remove handling and references to
before_dot and after_dot opcodes.
---
src/regex.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/src/regex.c b/src/regex.c
index 1f2a1f08..cca00e9 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -669,9 +669,7 @@ typedef enum
notsyntaxspec
#ifdef emacs
- ,before_dot, /* Succeeds if before point. */
- at_dot, /* Succeeds if at point. */
- after_dot, /* Succeeds if after point. */
+ , at_dot, /* Succeeds if at point. */
/* Matches any character whose category-set contains the specified
category. The operator is followed by a byte which contains a
@@ -1053,18 +1051,10 @@ print_partial_compiled_pattern (re_char *start, re_char *end)
break;
# ifdef emacs
- case before_dot:
- fprintf (stderr, "/before_dot");
- break;
-
case at_dot:
fprintf (stderr, "/at_dot");
break;
- case after_dot:
- fprintf (stderr, "/after_dot");
- break;
-
case categoryspec:
fprintf (stderr, "/categoryspec");
mcnt = *p++;
@@ -3422,8 +3412,6 @@ regex_compile (const_re_char *pattern, size_t size, reg_syntax_t syntax,
goto normal_char;
#ifdef emacs
- /* There is no way to specify the before_dot and after_dot
- operators. rms says this is ok. --karl */
case '=':
laststart = b;
BUF_PUSH (at_dot);
@@ -4000,9 +3988,7 @@ analyze_first (const_re_char *p, const_re_char *pend, char *fastmap,
/* All cases after this match the empty string. These end with
`continue'. */
- case before_dot:
case at_dot:
- case after_dot:
#endif /* !emacs */
case no_op:
case begline:
@@ -6150,24 +6136,12 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const_re_char *string1,
break;
#ifdef emacs
- case before_dot:
- DEBUG_PRINT ("EXECUTING before_dot.\n");
- if (PTR_BYTE_POS (d) >= PT_BYTE)
- goto fail;
- break;
-
case at_dot:
DEBUG_PRINT ("EXECUTING at_dot.\n");
if (PTR_BYTE_POS (d) != PT_BYTE)
goto fail;
break;
- case after_dot:
- DEBUG_PRINT ("EXECUTING after_dot.\n");
- if (PTR_BYTE_POS (d) <= PT_BYTE)
- goto fail;
- break;
-
case categoryspec:
case notcategoryspec:
{
--
2.8.0.rc3.226.g39d4020
next prev parent reply other threads:[~2016-07-27 16:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-25 22:54 bug#24071: [PATCH] Refactor regex character class parsing in [:name:] Michal Nazarewicz
2016-07-26 14:46 ` Eli Zaretskii
2016-07-27 15:29 ` Michal Nazarewicz
2016-07-27 16:28 ` Eli Zaretskii
2016-07-27 18:30 ` Michal Nazarewicz
2016-07-27 16:50 ` bug#24071: [PATCH 1/7] New regex tests imported from glibc 2.21 Michal Nazarewicz
2016-07-27 16:50 ` bug#24071: [PATCH 2/7] Added driver for the regex tests Michal Nazarewicz
2016-07-27 16:50 ` bug#24071: [PATCH 3/7] Fix reading of regex-resources in regex-tests Michal Nazarewicz
2016-07-27 16:50 ` bug#24071: [PATCH 4/7] Don’t (require 'cl) Michal Nazarewicz
2016-07-27 16:50 ` bug#24071: [PATCH 5/7] Split regex glibc test cases into separet tests Michal Nazarewicz
2016-07-27 16:50 ` Michal Nazarewicz [this message]
2016-07-27 16:50 ` bug#24071: [PATCH 7/7] Refactor regex character class parsing in [:name:] Michal Nazarewicz
2016-07-29 5:31 ` bug#24071: [PATCH] " Dima Kogan
2016-07-29 5:53 ` Eli Zaretskii
2016-07-29 13:07 ` Michal Nazarewicz
2016-08-02 16:06 ` Michal Nazarewicz
2016-08-02 16:46 ` Eli Zaretskii
2016-08-02 17:54 ` Michal Nazarewicz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469638247-20131-6-git-send-email-mina86@mina86.com \
--to=mina86@mina86.com \
--cc=24071@debbugs.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.