aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-26 00:21:09 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-26 00:39:55 -0400
commita7061359b741b5716bddbefdc024f38405f758b0 (patch)
tree1d8663a2bdae23fc5a86c6a104a15743456ea44d /src/nvim/regexp.c
parent7e0d50b16e5b8d5c8ac5048fa49486171aabd359 (diff)
downloadrneovim-a7061359b741b5716bddbefdc024f38405f758b0.tar.gz
rneovim-a7061359b741b5716bddbefdc024f38405f758b0.tar.bz2
rneovim-a7061359b741b5716bddbefdc024f38405f758b0.zip
vim-patch:8.2.2278: falling back to old regexp engine can some patterns
Problem: Falling back to old regexp engine can some patterns. Solution: Do not fall back once [[:lower:]] or [[:upper:]] is used. (Christian Brabandt, closes vim/vim#7572) https://github.com/vim/vim/commit/66c50c565321d4d49d8d5620912e5e8fe4825644
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 1f025b24a4..accf9b0bb5 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -692,6 +692,7 @@ static char_u *regparse; ///< Input-scan pointer.
static int prevchr_len; ///< byte length of previous char
static int num_complex_braces; ///< Complex \{...} count
static int regnpar; ///< () count.
+static bool wants_nfa; ///< regex should use NFA engine
static int regnzpar; ///< \z() count.
static int re_has_z; ///< \z item detected
static char_u *regcode; ///< Code-emit pointer, or JUST_CALC_SIZE
@@ -7248,7 +7249,7 @@ regprog_T *vim_regcomp(char_u *expr_arg, int re_flags)
// Check for error compiling regexp with initial engine.
if (prog == NULL) {
#ifdef BT_REGEXP_DEBUG_LOG
- // Debugging log for NFA.
+ // Debugging log for BT engine.
if (regexp_engine != BACKTRACKING_ENGINE) {
FILE *f = fopen(BT_REGEXP_DEBUG_LOG_NAME, "a");
if (f) {
@@ -7265,6 +7266,7 @@ regprog_T *vim_regcomp(char_u *expr_arg, int re_flags)
// But don't try if an error message was given.
if (regexp_engine == AUTOMATIC_ENGINE && !called_emsg) {
regexp_engine = BACKTRACKING_ENGINE;
+ report_re_switch(expr);
prog = bt_regengine.regcomp(expr, re_flags);
}
}