mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.3.1019
Problem: These do not work with the new regexp engine: \%o123, \%x123, \%d123, \%u123 and \%U123. Solution: Implement these items.
This commit is contained in:
parent
aae4883e01
commit
47196581b8
@ -604,7 +604,6 @@ nfa_regatom()
|
|||||||
char_u *endp;
|
char_u *endp;
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
char_u *old_regparse = regparse;
|
char_u *old_regparse = regparse;
|
||||||
int clen;
|
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
int extra = 0;
|
int extra = 0;
|
||||||
@ -623,15 +622,12 @@ nfa_regatom()
|
|||||||
cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL;
|
cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL;
|
||||||
|
|
||||||
c = getchr();
|
c = getchr();
|
||||||
|
|
||||||
#ifdef FEAT_MBYTE
|
|
||||||
/* clen has the length of the current char, without composing chars */
|
|
||||||
clen = (*mb_char2len)(c);
|
|
||||||
if (has_mbyte && clen > 1)
|
|
||||||
goto nfa_do_multibyte;
|
|
||||||
#endif
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
|
case NUL:
|
||||||
|
syntax_error = TRUE;
|
||||||
|
EMSG_RET_FAIL(_("E865: (NFA) Regexp end encountered prematurely"));
|
||||||
|
|
||||||
case Magic('^'):
|
case Magic('^'):
|
||||||
EMIT(NFA_BOL);
|
EMIT(NFA_BOL);
|
||||||
break;
|
break;
|
||||||
@ -747,10 +743,6 @@ nfa_regatom()
|
|||||||
return FAIL; /* cascaded error */
|
return FAIL; /* cascaded error */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NUL:
|
|
||||||
syntax_error = TRUE;
|
|
||||||
EMSG_RET_FAIL(_("E865: (NFA) Regexp end encountered prematurely"));
|
|
||||||
|
|
||||||
case Magic('|'):
|
case Magic('|'):
|
||||||
case Magic('&'):
|
case Magic('&'):
|
||||||
case Magic(')'):
|
case Magic(')'):
|
||||||
@ -834,11 +826,26 @@ nfa_regatom()
|
|||||||
case 'x': /* %xab hex 2 */
|
case 'x': /* %xab hex 2 */
|
||||||
case 'u': /* %uabcd hex 4 */
|
case 'u': /* %uabcd hex 4 */
|
||||||
case 'U': /* %U1234abcd hex 8 */
|
case 'U': /* %U1234abcd hex 8 */
|
||||||
/* Not yet supported */
|
{
|
||||||
return FAIL;
|
int i;
|
||||||
|
|
||||||
c = coll_get_char();
|
switch (c)
|
||||||
EMIT(c);
|
{
|
||||||
|
case 'd': i = getdecchrs(); break;
|
||||||
|
case 'o': i = getoctchrs(); break;
|
||||||
|
case 'x': i = gethexchrs(2); break;
|
||||||
|
case 'u': i = gethexchrs(4); break;
|
||||||
|
case 'U': i = gethexchrs(8); break;
|
||||||
|
default: i = -1; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i < 0)
|
||||||
|
EMSG2_RET_FAIL(
|
||||||
|
_("E678: Invalid character after %s%%[dxouU]"),
|
||||||
|
reg_magic == MAGIC_ALL);
|
||||||
|
/* TODO: what if a composing character follows? */
|
||||||
|
EMIT(i);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Catch \%^ and \%$ regardless of where they appear in the
|
/* Catch \%^ and \%$ regardless of where they appear in the
|
||||||
@ -1217,8 +1224,9 @@ collection:
|
|||||||
int plen;
|
int plen;
|
||||||
|
|
||||||
nfa_do_multibyte:
|
nfa_do_multibyte:
|
||||||
/* Length of current char with composing chars. */
|
/* plen is length of current char with composing chars */
|
||||||
if (enc_utf8 && (clen != (plen = (*mb_ptr2len)(old_regparse))
|
if (enc_utf8 && ((*mb_char2len)(c)
|
||||||
|
!= (plen = (*mb_ptr2len)(old_regparse))
|
||||||
|| utf_iscomposing(c)))
|
|| utf_iscomposing(c)))
|
||||||
{
|
{
|
||||||
/* A base character plus composing characters, or just one
|
/* A base character plus composing characters, or just one
|
||||||
|
@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1019,
|
||||||
/**/
|
/**/
|
||||||
1018,
|
1018,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user