0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.0502: Vim9: some code is not tested

Problem:    Vim9: some code is not tested.
Solution:   Add more tests.  Fix uncovered problems.
This commit is contained in:
Bram Moolenaar
2020-04-02 21:13:25 +02:00
parent 2c869deeb7
commit e8c4abbbd7
16 changed files with 106 additions and 34 deletions

View File

@@ -537,16 +537,30 @@ skip_anyof(char_u *p)
* Stop at end of "startp" or where "dirc" is found ('/', '?', etc).
* Take care of characters with a backslash in front of it.
* Skip strings inside [ and ].
* When "newp" is not NULL and "dirc" is '?', make an allocated copy of the
* expression and change "\?" to "?". If "*newp" is not NULL the expression
* is changed in-place.
*/
char_u *
skip_regexp(
char_u *startp,
int dirc,
int magic)
{
return skip_regexp_ex(startp, dirc, magic, NULL, NULL);
}
/*
* skip_regexp() with extra arguments:
* When "newp" is not NULL and "dirc" is '?', make an allocated copy of the
* expression and change "\?" to "?". If "*newp" is not NULL the expression
* is changed in-place.
* If a "\?" is changed to "?" then "dropped" is incremented, unless NULL.
*/
char_u *
skip_regexp_ex(
char_u *startp,
int dirc,
int magic,
char_u **newp)
char_u **newp,
int *dropped)
{
int mymagic;
char_u *p = startp;
@@ -579,6 +593,8 @@ skip_regexp(
if (*newp != NULL)
p = *newp + (p - startp);
}
if (dropped != NULL)
++*dropped;
if (*newp != NULL)
STRMOVE(p, p + 1);
else