Skip to content

Commit 1a9f953

Browse files
authored
Merge pull request #3591 from masatake/parser-versioning-prep
*: parser versioning preparations
2 parents 0b050ca + 63fffd8 commit 1a9f953

File tree

3 files changed

+40
-22
lines changed

3 files changed

+40
-22
lines changed

docs/man/ctags-client-tools.7.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ An example of a pseudo tag::
4343

4444
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
4545

46-
The value, "2", associated with the pseudo tag "TAG_PROGRAM_NAME", is
46+
The value, "Universal Ctags", associated with the pseudo tag ``TAG_PROGRAM_NAME``, is
4747
used in the field for input file. The description, "Derived from
4848
Exuberant Ctags", is used in the field for pattern.
4949

@@ -63,7 +63,7 @@ This pseudo-tag says "the function kind of C language is enabled
6363
when generating this tags file." ``--pseudo-tags`` is the option for
6464
enabling/disabling individual pseudo-tags. When enabling/disabling a
6565
pseudo tag with the option, specify the tag name only
66-
"TAG_KIND_DESCRIPTION", without the prefix ("!_") or the suffix ("!C").
66+
``TAG_KIND_DESCRIPTION``, without the prefix ("!_") or the suffix ("!C").
6767

6868

6969
Options for Pseudo-tags
@@ -245,7 +245,10 @@ for using notable ones.
245245
``TAG_PROC_CWD`` gives the tool a hint; "input.c" may be at "/tmp".
246246

247247
``TAG_PROGRAM_NAME``
248-
TBW
248+
Indicates the name of program generating this tags file.
249+
250+
``TAG_PROGRAM_VERSION``
251+
Indicates the version of program generating this tags file.
249252

250253
``TAG_ROLE_DESCRIPTION`` (new in Universal Ctags)
251254
Indicates the names and descriptions of enabled roles::
@@ -367,11 +370,11 @@ Client tools could split the line using the following steps:
367370
* If a ``?`` follows, then the pattern delimiter is ``?``.
368371
* If a number follows, then:
369372

370-
* If a ``;/`` follows the number, then the delimiter is ``/``.
371-
* If a ``;?`` follows the number, then the delimiter is ``?``.
372-
* If a ``;"`` follows the number, then the field uses only line number, and
373-
there's no pattern delimiter (since there's no regex pattern). In this
374-
case the pattern field ends at the 3rd tab.
373+
* If a ``;/`` follows the number, then the delimiter is ``/``.
374+
* If a ``;?`` follows the number, then the delimiter is ``?``.
375+
* If a ``;"`` follows the number, then the field uses only line number, and
376+
there's no pattern delimiter (since there's no regex pattern). In this
377+
case the pattern field ends at the 3rd tab.
375378

376379
* After the opening delimiter, find the next unescaped pattern delimiter, and
377380
that's the closing delimiter. It will be followed by ``;"`` and then a tab.
@@ -477,7 +480,8 @@ CHANGES
477480

478481
Version 6.0
479482
~~~~~~~~~~~
480-
* ctags enables TAG_{KIND,EXTRA,FIELD,ROLE}_DESCRIPTION pseudo tags by default.
483+
* ctags enables ``TAG_KIND_DESCRIPTION``, ``TAG_ROLE_DESCRIPTION``,
484+
``TAG_FIELD_DESCRIPTION``, and ``TAG_EXTRA_DESCRIPTION`` pseudo tags by default.
481485

482486
SEE ALSO
483487
--------

main/writer-json.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@
2525
#ifdef HAVE_JANSSON
2626
#include <jansson.h>
2727

28-
#define JSON_WRITER_MAJOR 0
29-
#define JSON_WRITER_MINOR 0
28+
/* The concept of CURRENT and AGE is taken from libtool.
29+
* However, we delete REVISION.
30+
* We will update more CURRENT frequently than the assumption
31+
* in libtool.
32+
*
33+
* If KEYS have been added, removed or changed since last release,
34+
* increment CURRENT.
35+
* If they have been added since last release, increment AGE.
36+
* If they have been removed since last release, set AGE to 0
37+
*/
38+
#define JSON_WRITER_CURRENT 0
39+
#define JSON_WRITER_AGE 0
3040

3141
#ifndef json_boolean /* compat with jansson < 2.4 */
3242
#define json_boolean(val) ((val) ? json_true() : json_false())
@@ -243,7 +253,7 @@ static int writeJsonPtagEntry (tagWriter *writer CTAGS_ATTR_UNUSED,
243253
json_t *response;
244254
char *parserName0 = NULL;
245255

246-
const char *rest = ((JSON_WRITER_MAJOR > 0) && parserName && desc->jsonObjectKey)
256+
const char *rest = ((JSON_WRITER_CURRENT > 0) && parserName && desc->jsonObjectKey)
247257
? strchr(parserName, '!')
248258
: NULL;
249259
if (rest)
@@ -290,7 +300,7 @@ extern bool ptagMakeJsonOutputVersion (ptagDesc *desc, langType language CTAGS_A
290300
const void *data CTAGS_ATTR_UNUSED)
291301
{
292302
return writePseudoTag (desc,
293-
STRINGIFY(JSON_WRITER_MAJOR) "." STRINGIFY(JSON_WRITER_MINOR),
303+
STRINGIFY(JSON_WRITER_CURRENT) "." STRINGIFY(JSON_WRITER_AGE),
294304
"in development",
295305
NULL);
296306
}

man/ctags-client-tools.7.rst.in

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ An example of a pseudo tag::
4343

4444
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
4545

46-
The value, "2", associated with the pseudo tag "TAG_PROGRAM_NAME", is
46+
The value, "Universal Ctags", associated with the pseudo tag ``TAG_PROGRAM_NAME``, is
4747
used in the field for input file. The description, "Derived from
4848
Exuberant Ctags", is used in the field for pattern.
4949

@@ -63,7 +63,7 @@ This pseudo-tag says "the function kind of C language is enabled
6363
when generating this tags file." ``--pseudo-tags`` is the option for
6464
enabling/disabling individual pseudo-tags. When enabling/disabling a
6565
pseudo tag with the option, specify the tag name only
66-
"TAG_KIND_DESCRIPTION", without the prefix ("!_") or the suffix ("!C").
66+
``TAG_KIND_DESCRIPTION``, without the prefix ("!_") or the suffix ("!C").
6767

6868

6969
Options for Pseudo-tags
@@ -245,7 +245,10 @@ for using notable ones.
245245
``TAG_PROC_CWD`` gives the tool a hint; "input.c" may be at "/tmp".
246246

247247
``TAG_PROGRAM_NAME``
248-
TBW
248+
Indicates the name of program generating this tags file.
249+
250+
``TAG_PROGRAM_VERSION``
251+
Indicates the version of program generating this tags file.
249252

250253
``TAG_ROLE_DESCRIPTION`` (new in Universal Ctags)
251254
Indicates the names and descriptions of enabled roles::
@@ -367,11 +370,11 @@ Client tools could split the line using the following steps:
367370
* If a ``?`` follows, then the pattern delimiter is ``?``.
368371
* If a number follows, then:
369372

370-
* If a ``;/`` follows the number, then the delimiter is ``/``.
371-
* If a ``;?`` follows the number, then the delimiter is ``?``.
372-
* If a ``;"`` follows the number, then the field uses only line number, and
373-
there's no pattern delimiter (since there's no regex pattern). In this
374-
case the pattern field ends at the 3rd tab.
373+
* If a ``;/`` follows the number, then the delimiter is ``/``.
374+
* If a ``;?`` follows the number, then the delimiter is ``?``.
375+
* If a ``;"`` follows the number, then the field uses only line number, and
376+
there's no pattern delimiter (since there's no regex pattern). In this
377+
case the pattern field ends at the 3rd tab.
375378

376379
* After the opening delimiter, find the next unescaped pattern delimiter, and
377380
that's the closing delimiter. It will be followed by ``;"`` and then a tab.
@@ -477,7 +480,8 @@ CHANGES
477480

478481
Version 6.0
479482
~~~~~~~~~~~
480-
* ctags enables TAG_{KIND,EXTRA,FIELD,ROLE}_DESCRIPTION pseudo tags by default.
483+
* ctags enables ``TAG_KIND_DESCRIPTION``, ``TAG_ROLE_DESCRIPTION``,
484+
``TAG_FIELD_DESCRIPTION``, and ``TAG_EXTRA_DESCRIPTION`` pseudo tags by default.
481485

482486
SEE ALSO
483487
--------

0 commit comments

Comments
 (0)