mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.3.978
Problem: Regexp debug logs don't have a good name. Solution: Use clear names and make it possible to write logs for the old and new engines separately. (Taro Muraoka)
This commit is contained in:
parent
ca12d7c004
commit
7fcff1f781
@ -51,6 +51,8 @@
|
|||||||
# define BT_REGEXP_DUMP
|
# define BT_REGEXP_DUMP
|
||||||
/* save the debugging data to a file instead of displaying it */
|
/* save the debugging data to a file instead of displaying it */
|
||||||
# define BT_REGEXP_LOG
|
# define BT_REGEXP_LOG
|
||||||
|
# define BT_REGEXP_DEBUG_LOG
|
||||||
|
# define BT_REGEXP_DEBUG_LOG_NAME "bt_regexp_debug.log"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -7828,11 +7830,11 @@ vim_regcomp(expr_arg, re_flags)
|
|||||||
|
|
||||||
if (prog == NULL) /* error compiling regexp with initial engine */
|
if (prog == NULL) /* error compiling regexp with initial engine */
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef BT_REGEXP_DEBUG_LOG
|
||||||
if (regexp_engine != BACKTRACKING_ENGINE) /* debugging log for NFA */
|
if (regexp_engine != BACKTRACKING_ENGINE) /* debugging log for NFA */
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
f = fopen("debug.log", "a");
|
f = fopen(BT_REGEXP_DEBUG_LOG_NAME, "a");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
if (!syntax_error)
|
if (!syntax_error)
|
||||||
@ -7842,7 +7844,8 @@ vim_regcomp(expr_arg, re_flags)
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
EMSG("(NFA) Could not open \"debug.log\" to write !!!");
|
EMSG2("(NFA) Could not open \"%s\" to write !!!",
|
||||||
|
BT_REGEXP_DEBUG_LOG_NAME);
|
||||||
/*
|
/*
|
||||||
if (syntax_error)
|
if (syntax_error)
|
||||||
EMSG("NFA Regexp: Syntax Error !");
|
EMSG("NFA Regexp: Syntax Error !");
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
/* Comment this out to disable log files. They can get pretty big */
|
/* Comment this out to disable log files. They can get pretty big */
|
||||||
# define ENABLE_LOG
|
# define ENABLE_LOG
|
||||||
# define LOG_NAME "log_nfarun.log"
|
# define LOG_NAME "log_nfarun.log"
|
||||||
|
# define NFA_REGEXP_DEBUG_LOG
|
||||||
|
# define NFA_REGEXP_DEBUG_LOG_NAME "nfa_regexp_debug.log"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Upper limit allowed for {m,n} repetitions handled by NFA */
|
/* Upper limit allowed for {m,n} repetitions handled by NFA */
|
||||||
@ -2849,12 +2851,12 @@ nfa_regmatch(start, submatch, m)
|
|||||||
int *listids = NULL;
|
int *listids = NULL;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
#ifdef DEBUG
|
#ifdef NFA_REGEXP_DEBUG_LOG
|
||||||
FILE *debug = fopen("list.log", "a");
|
FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG_NAME, "a");
|
||||||
|
|
||||||
if (debug == NULL)
|
if (debug == NULL)
|
||||||
{
|
{
|
||||||
EMSG(_("(NFA) COULD NOT OPEN list.log !"));
|
EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG_NAME);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2950,7 +2952,7 @@ again:
|
|||||||
fprintf(log_fd, "\n");
|
fprintf(log_fd, "\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef NFA_REGEXP_DEBUG_LOG
|
||||||
fprintf(debug, "\n-------------------\n");
|
fprintf(debug, "\n-------------------\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2966,7 +2968,7 @@ again:
|
|||||||
else
|
else
|
||||||
t = &thislist->t[i];
|
t = &thislist->t[i];
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef NFA_REGEXP_DEBUG_LOG
|
||||||
nfa_set_code(t->state->c);
|
nfa_set_code(t->state->c);
|
||||||
fprintf(debug, "%s, ", code);
|
fprintf(debug, "%s, ", code);
|
||||||
#endif
|
#endif
|
||||||
@ -3436,7 +3438,7 @@ theend:
|
|||||||
if (listids != NULL)
|
if (listids != NULL)
|
||||||
vim_free(listids);
|
vim_free(listids);
|
||||||
#undef ADD_POS_NEG_STATE
|
#undef ADD_POS_NEG_STATE
|
||||||
#ifdef DEBUG
|
#ifdef NFA_REGEXP_DEBUG_LOG
|
||||||
fclose(debug);
|
fclose(debug);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
978,
|
||||||
/**/
|
/**/
|
||||||
977,
|
977,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user