1
0
forked from aniani/vim

patch 8.1.1093: support for outdated tags format slows down tag parsing

Problem:    Support for outdated tags format slows down tag parsing.
Solution:   Remove FEAT_TAG_OLDSTATIC.
This commit is contained in:
Bram Moolenaar
2019-03-30 21:19:34 +01:00
parent 372674fca3
commit 96428dd4e9
4 changed files with 31 additions and 76 deletions

View File

@@ -1,4 +1,4 @@
*tagsrch.txt* For Vim version 8.1. Last change: 2019 Mar 23
*tagsrch.txt* For Vim version 8.1. Last change: 2019 Mar 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -529,28 +529,21 @@ gnatxref For Ada. See http://www.gnuada.org/. gnatxref is
part of the gnat package.
The lines in the tags file must have one of these three formats:
The lines in the tags file must have one of these two formats:
1. {tagname} {TAB} {tagfile} {TAB} {tagaddress}
2. {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}
3. {tagname} {TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..
2. {tagname} {TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..
The first is a normal tag, which is completely compatible with Vi. It is the
only format produced by traditional ctags implementations. This is often used
for functions that are global, also referenced in other files.
Previously an old format was supported, see |tag-old-static|.
The first format is a normal tag, which is completely compatible with Vi. It
is the only format produced by traditional ctags implementations. This is
often used for functions that are global, also referenced in other files.
The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR>
also works. The <CR> and <NL> characters can never appear inside a line.
*tag-old-static*
The second format is for a static tag only. It is obsolete now, replaced by
the third format. It is only supported by Elvis 1.x and Vim and a few
versions of ctags. A static tag is often used for functions that are local,
only referenced in the file {tagfile}. Note that for the static tag, the two
occurrences of {tagfile} must be exactly the same. Also see |tags-option|
below, for how static tags are used.
The third format is new. It includes additional information in optional
The second format is new. It includes additional information in optional
fields at the end of each line. It is backwards compatible with Vi. It is
only supported by new versions of ctags (such as Exuberant ctags).
@@ -598,6 +591,7 @@ only supported by new versions of ctags (such as Exuberant ctags).
The only other field currently recognized by Vim is "file:"
(with an empty value). It is used for a static tag.
The first lines in the tags file can contain lines that start with
!_TAG_
These are sorted to the first lines, only rare tags that start with "!" can
@@ -651,6 +645,21 @@ If the command is a normal search command (it starts and ends with "/" or
followed by white space and a '('. This will find macro names and function
names with a type prepended. {the extra searches are not in Vi}
*tag-old-static*
Until March 2019 (patch 8.1.1092) an outdated format was supported:
{tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}
This format is for a static tag only. It is obsolete now, replaced by
the second format. It is only supported by Elvis 1.x, older Vim versions and
a few versions of ctags. A static tag is often used for functions that are
local, only referenced in the file {tagfile}. Note that for the static tag,
the two occurrences of {tagfile} must be exactly the same. Also see
|tags-option| below, for how static tags are used.
The support was removed, since when you can update to the new Vim version you
should also be able to update ctags to one that supports the second format.
==============================================================================
6. Include file searches *include-search* *definition-search*
*E387* *E388* *E389*

View File

@@ -305,12 +305,9 @@
#endif
/*
* +tag_old_static Old style static tags: "file:tag file ..". Slows
* down tag searching a bit.
* +tag_old_static Old style static tags: "file:tag file ..".
* Support was removed in 8.1.1093.
*/
#ifdef FEAT_NORMAL
# define FEAT_TAG_OLDSTATIC
#endif
/*
* +cscope Unix only: Cscope support.

View File

@@ -1964,28 +1964,6 @@ parse_line:
break;
}
#ifdef FEAT_TAG_OLDSTATIC
/*
* Check for old style static tag: "file:tag file .."
*/
tagp.fname = NULL;
for (p = lbuf; p < tagp.tagname_end; ++p)
{
if (*p == ':')
{
if (tagp.fname == NULL)
tagp.fname = tagp.tagname_end + 1;
if (fnamencmp(lbuf, tagp.fname, p - lbuf) == 0
&& tagp.fname[p - lbuf] == TAB)
{
// found one
tagp.tagname = p + 1;
break;
}
}
}
#endif
/*
* Skip this line if the length of the tag is different and
* there is no regexp, or the tag is too short.
@@ -2098,9 +2076,6 @@ parse_line:
/*
* Can be a matching tag, isolate the file name and command.
*/
#ifdef FEAT_TAG_OLDSTATIC
if (tagp.fname == NULL)
#endif
tagp.fname = tagp.tagname_end + 1;
tagp.fname_end = vim_strchr(tagp.fname, TAB);
tagp.command = tagp.fname_end + 1;
@@ -2200,15 +2175,8 @@ parse_line:
#ifdef FEAT_EMACS_TAGS
is_static = FALSE;
if (!is_etag) /* emacs tags are never static */
#endif
{
#ifdef FEAT_TAG_OLDSTATIC
if (tagp.tagname != lbuf)
is_static = TRUE; /* detected static tag before */
else
#endif
is_static = test_for_static(&tagp);
}
/* decide in which of the sixteen tables to store this
* match */
@@ -2870,23 +2838,6 @@ test_for_static(tagptrs_T *tagp)
{
char_u *p;
#ifdef FEAT_TAG_OLDSTATIC
int len;
/*
* Check for old style static tag: "file:tag file .."
*/
len = (int)(tagp->fname_end - tagp->fname);
p = tagp->tagname + len;
if ( p < tagp->tagname_end
&& *p == ':'
&& fnamencmp(tagp->tagname, tagp->fname, len) == 0)
{
tagp->tagname = p + 1;
return TRUE;
}
#endif
/*
* Check for new style static tag ":...<Tab>file:[<Tab>...]"
*/

View File

@@ -605,11 +605,7 @@ static char *(features[]) =
#else
"-tag_binary",
#endif
#ifdef FEAT_TAG_OLDSTATIC
"+tag_old_static",
#else
"-tag_old_static",
#endif
"-tag_any_white",
#ifdef FEAT_TCL
# ifdef DYNAMIC_TCL
@@ -775,6 +771,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1093,
/**/
1092,
/**/