Skip to content

Commit

Permalink
Merge pull request #2573 from masatake/docs-about-anon-extra-tag
Browse files Browse the repository at this point in the history
docs(man): write about anonymous extra tag
  • Loading branch information
masatake authored Jun 13, 2020
2 parents 94d41de + c23089c commit 315c335
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/man/ctags.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,34 @@ are not listed here. They are experimental or for debugging purpose.

The meaning of major extras is as follows (one-letter flag/long-name flag):

/anonymous
Include an entry for the language object that has no name like lambda
function. This extra has no one-letter flag and is enabled by
default. The extra tag is useful as a placeholder to fill scope fields
for language objects defined in a language object with no name.

.. code-block:: C
struct {
double x, y;
} p = { .x = 0.0, .y = 0.0 };
"x" and "y" are the members of a structure. When filling the scope
fields for them, ctags has trouble because the struct
where "x" and "y" belong to has no name. For overcoming the trouble,
ctags generates an anonymous extra tag for the struct
and fills the scope fields with the name of the extra tag.

.. code-block::
__anon9f26d2460108 input.c /^struct {$/;" s
p input.c /^} p = { .x = 0.0, .y = 0.0 };$/;" v typeref:struct:__anon9f26d2460108
x input.c /^ double x, y;$/;" m struct:__anon9f26d2460108
y input.c /^ double x, y;$/;" m struct:__anon9f26d2460108
The above tag output has "__anon9f26d2460108" as an anonymous extra tag.
The typeref field of "p" also receives the benefit of it.

F/fileScope
Indicates whether tags scoped only for a single file (i.e. tags which
cannot be seen outside of the file in which they are defined, such as
Expand Down
28 changes: 28 additions & 0 deletions man/ctags.1.rst.in
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,34 @@ are not listed here. They are experimental or for debugging purpose.

The meaning of major extras is as follows (one-letter flag/long-name flag):

/anonymous
Include an entry for the language object that has no name like lambda
function. This extra has no one-letter flag and is enabled by
default. The extra tag is useful as a placeholder to fill scope fields
for language objects defined in a language object with no name.

.. code-block:: C

struct {
double x, y;
} p = { .x = 0.0, .y = 0.0 };

"x" and "y" are the members of a structure. When filling the scope
fields for them, @CTAGS_NAME_EXECUTABLE@ has trouble because the struct
where "x" and "y" belong to has no name. For overcoming the trouble,
@CTAGS_NAME_EXECUTABLE@ generates an anonymous extra tag for the struct
and fills the scope fields with the name of the extra tag.

.. code-block::

__anon9f26d2460108 input.c /^struct {$/;" s
p input.c /^} p = { .x = 0.0, .y = 0.0 };$/;" v typeref:struct:__anon9f26d2460108
x input.c /^ double x, y;$/;" m struct:__anon9f26d2460108
y input.c /^ double x, y;$/;" m struct:__anon9f26d2460108

The above tag output has "__anon9f26d2460108" as an anonymous extra tag.
The typeref field of "p" also receives the benefit of it.

F/fileScope
Indicates whether tags scoped only for a single file (i.e. tags which
cannot be seen outside of the file in which they are defined, such as
Expand Down

0 comments on commit 315c335

Please sign in to comment.