mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
lint: fix coding style
This commit is contained in:
parent
0a471e009a
commit
96e2c3945f
@ -1210,27 +1210,30 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
///
|
||||||
* Return TRUE if the back reference is legal. We must have seen the close
|
/// Return TRUE if the back reference is legal. We must have seen the close
|
||||||
* brace.
|
/// brace.
|
||||||
* TODO: Should also check that we don't refer to something that is repeated
|
/// TODO(billy4195): Should also check that we don't refer to something that is
|
||||||
* (+*=): what instance of the repetition should we match?
|
/// repeated
|
||||||
*/
|
/// (+*=): what instance of the repetition should we match?
|
||||||
|
///
|
||||||
static int seen_endbrace(int refnum)
|
static int seen_endbrace(int refnum)
|
||||||
{
|
{
|
||||||
if (!had_endbrace[refnum]) {
|
if (!had_endbrace[refnum]) {
|
||||||
char_u *p;
|
char_u *p;
|
||||||
|
|
||||||
/* Trick: check if "@<=" or "@<!" follows, in which case
|
// Trick: check if "@<=" or "@<!" follows, in which case
|
||||||
* the \1 can appear before the referenced match. */
|
// the \1 can appear before the referenced match.
|
||||||
for (p = regparse; *p != NUL; ++p)
|
for (p = regparse; *p != NUL; p++) {
|
||||||
if (p[0] == '@' && p[1] == '<' && (p[2] == '!' || p[2] == '='))
|
if (p[0] == '@' && p[1] == '<' && (p[2] == '!' || p[2] == '=')) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*p == NUL) {
|
if (*p == NUL) {
|
||||||
EMSG(_("E65: Illegal back reference"));
|
EMSG(_("E65: Illegal back reference"));
|
||||||
rc_did_emsg = TRUE;
|
rc_did_emsg = true;
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1953,8 +1956,9 @@ static char_u *regatom(int *flagp)
|
|||||||
int refnum;
|
int refnum;
|
||||||
|
|
||||||
refnum = c - Magic('0');
|
refnum = c - Magic('0');
|
||||||
if (!seen_endbrace(refnum))
|
if (!seen_endbrace(refnum)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
ret = regnode(BACKREF + refnum);
|
ret = regnode(BACKREF + refnum);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -3783,17 +3787,17 @@ regmatch(
|
|||||||
int c;
|
int c;
|
||||||
regitem_T *rp;
|
regitem_T *rp;
|
||||||
int no;
|
int no;
|
||||||
int status; /* one of the RA_ values: */
|
int status; // one of the RA_ values:
|
||||||
int tm_count; /* counter for checking timeout */
|
int tm_count; // counter for checking timeout
|
||||||
#define RA_FAIL 1 /* something failed, abort */
|
#define RA_FAIL 1 // something failed, abort
|
||||||
#define RA_CONT 2 /* continue in inner loop */
|
#define RA_CONT 2 // continue in inner loop
|
||||||
#define RA_BREAK 3 /* break inner loop */
|
#define RA_BREAK 3 // break inner loop
|
||||||
#define RA_MATCH 4 /* successful match */
|
#define RA_MATCH 4 // successful match
|
||||||
#define RA_NOMATCH 5 /* didn't match */
|
#define RA_NOMATCH 5 // didn't match
|
||||||
|
|
||||||
tm_count = 0;
|
tm_count = 0;
|
||||||
/* Make "regstack" and "backpos" empty. They are allocated and freed in
|
// Make "regstack" and "backpos" empty. They are allocated and freed in
|
||||||
* bt_regexec_both() to reduce malloc()/free() calls. */
|
// bt_regexec_both() to reduce malloc()/free() calls.
|
||||||
regstack.ga_len = 0;
|
regstack.ga_len = 0;
|
||||||
backpos.ga_len = 0;
|
backpos.ga_len = 0;
|
||||||
|
|
||||||
|
@ -1341,10 +1341,11 @@ static int nfa_regatom(void)
|
|||||||
{
|
{
|
||||||
int refnum = no_Magic(c) - '1';
|
int refnum = no_Magic(c) - '1';
|
||||||
|
|
||||||
if (!seen_endbrace(refnum + 1))
|
if (!seen_endbrace(refnum + 1)) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
EMIT(NFA_BACKREF1 + refnum);
|
EMIT(NFA_BACKREF1 + refnum);
|
||||||
nfa_has_backref = TRUE;
|
nfa_has_backref = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user