[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 9a418e0 07/10: Remove dead opcodes in regex bytecod
From: |
Michal Nazarewicz |
Subject: |
[Emacs-diffs] master 9a418e0 07/10: Remove dead opcodes in regex bytecode |
Date: |
Tue, 2 Aug 2016 16:05:34 +0000 (UTC) |
branch: master
commit 9a418e0f98a6ee14d9984e597038168ebe0a7a03
Author: Michal Nazarewicz <address@hidden>
Commit: Michal Nazarewicz <address@hidden>
Remove dead opcodes in regex bytecode
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 3a25835..261d299 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++;
@@ -3440,8 +3430,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);
@@ -4018,9 +4006,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:
@@ -6148,24 +6134,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:
{
- [Emacs-diffs] master updated (5391761 -> 54a3c0c), Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 82a487d 03/10: Fix reading of regex-resources in regex-tests, Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 9a418e0 07/10: Remove dead opcodes in regex bytecode,
Michal Nazarewicz <=
- [Emacs-diffs] master da9c55d 09/10: Get rid of re_set_whitespace_regexp, Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 7496844 04/10: Don’t (require 'cl), Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 4538a5e 06/10: Refactor regex character class parsing in [:name:], Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 91d5309 02/10: Added driver for the regex tests, Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 04d96ec 08/10: Get rid of re_set_syntax, Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master e725706 05/10: Split regex glibc test cases into separet tests, Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 54a3c0c 10/10: Hardcode regex syntax to remove dead code handling different syntax, Michal Nazarewicz, 2016/08/02
- [Emacs-diffs] master 6db7277 01/10: New regex tests imported from glibc 2.21, Michal Nazarewicz, 2016/08/02