GNU bug report logs -
#24071
[PATCH] Refactor regex character class parsing in [:name:]
Previous Next
Reported by: Michal Nazarewicz <mina86 <at> mina86.com>
Date: Mon, 25 Jul 2016 22:55:02 UTC
Severity: wishlist
Tags: patch
Done: Michal Nazarewicz <mina86 <at> mina86.com>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 24071 <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 8 years and 350 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.