mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Gnulib update via admin/merge-gnulib
This commit is contained in:
parent
7e9d364b66
commit
9007e10a0f
9 changed files with 48 additions and 11 deletions
|
|
@ -2038,15 +2038,25 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
|
|||
}
|
||||
switch (c)
|
||||
{
|
||||
case '-':
|
||||
token->type = OP_CHARSET_RANGE;
|
||||
break;
|
||||
case ']':
|
||||
token->type = OP_CLOSE_BRACKET;
|
||||
break;
|
||||
case '^':
|
||||
token->type = OP_NON_MATCH_LIST;
|
||||
break;
|
||||
case '-':
|
||||
/* In V7 Unix grep and Unix awk and mawk, [...---...]
|
||||
(3 adjacent minus signs) stands for a single minus sign.
|
||||
Support that without breaking anything else. */
|
||||
if (! (re_string_cur_idx (input) + 2 < re_string_length (input)
|
||||
&& re_string_peek_byte (input, 1) == '-'
|
||||
&& re_string_peek_byte (input, 2) == '-'))
|
||||
{
|
||||
token->type = OP_CHARSET_RANGE;
|
||||
break;
|
||||
}
|
||||
re_string_skip_bytes (input, 2);
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
token->type = CHARACTER;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue