EMIT(NFA_CONCAT);
}
return OK;
- } /* if exists closing ] */
- else if (reg_strict)
+ } /* if exists closing ] */
+
+ if (reg_strict)
{
syntax_error = TRUE;
EMSG_RET_FAIL(_(e_missingbracket));
}
+ /* FALLTHROUGH */
- /* FALLTHROUGH */
default:
{
#ifdef FEAT_MBYTE
EMIT(c);
if (i > 0)
EMIT(NFA_CONCAT);
- if (i += utf_char2len(c) >= plen)
+ if ((i += utf_char2len(c)) >= plen)
break;
c = utf_ptr2char(old_regparse + i);
}
/* TODO */
if (regflags & RF_ICOMBINE)
{
- goto normalchar;
+ /* use the base character only */
}
#endif
/* FALLTHROUGH */
result = OK;
sta = t->state->out;
len = 0;
- while (sta->c != NFA_END_COMPOSING && len < n)
+ if (ireg_icombine)
{
- if (len > 0)
- mc = mb_ptr2char(reginput + len);
- if (mc != sta->c)
- break;
- len += mb_char2len(mc);
- sta = sta->out;
+ /* If \Z was present, then ignore composing characters. */
+ /* TODO: How about negated? */
+ if (sta->c != c)
+ result = FAIL;
+ len = n;
+ while (sta->c != NFA_END_COMPOSING)
+ sta = sta->out;
}
+ else
+ while (sta->c != NFA_END_COMPOSING && len < n)
+ {
+ if (len > 0)
+ mc = mb_ptr2char(reginput + len);
+ if (mc != sta->c)
+ break;
+ len += mb_char2len(mc);
+ sta = sta->out;
+ }
/* if input char length doesn't match regexp char length */
if (len < n || sta->c != NFA_END_COMPOSING)
result = FAIL;
end = t->state->out1; /* NFA_END_COMPOSING */
- /* If \Z was present, then ignore composing characters */
- if (ireg_icombine)
- result = 1 ^ sta->negated;
ADD_POS_NEG_STATE(end);
break;
}
:"""" Test \Z
:call add(tl, ['ú\Z', 'x'])
+:call add(tl, ['יהוה\Z', 'יהוה', 'יהוה'])
+:call add(tl, ['יְהוָה\Z', 'יהוה', 'יהוה'])
+:call add(tl, ['יהוה\Z', 'יְהוָה', 'יְהוָה'])
+:call add(tl, ['יְהוָה\Z', 'יְהוָה', 'יְהוָה'])
+:call add(tl, ['יְ\Z', 'וְיַ', 'יַ'])
+:call add(tl, ["ק\u200d\u05b9x\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"])
+:call add(tl, ["ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"])
+:call add(tl, ["ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"])
+:call add(tl, ["ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"])
:"""" Combining different tests and features
:call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd'])