ctags.rb 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/ext/extconf.rb +1 -1
  4. data/ext/vendor/ctags/Tmain/input-encoding-option.d/tags-expected.txt +1 -0
  5. data/ext/vendor/ctags/Tmain/interactive-mode.d/run.sh +4 -1
  6. data/ext/vendor/ctags/Tmain/json-output-format.d/input.go +4 -0
  7. data/ext/vendor/ctags/Tmain/json-output-format.d/stdout-expected.txt +10 -2
  8. data/ext/vendor/ctags/Tmain/list-pseudo-tags.d/stdout-expected.txt +1 -0
  9. data/ext/vendor/ctags/Tmain/output-encoding-option.d/tags-expected.txt +1 -0
  10. data/ext/vendor/ctags/Tmain/output-format-option.d/run.sh +1 -1
  11. data/ext/vendor/ctags/Tmain/output-format-option.d/stdout-expected.txt +1 -1
  12. data/ext/vendor/ctags/Tmain/output-input-field-with-no-escape.d/run.sh +20 -0
  13. data/ext/vendor/ctags/Tmain/output-input-field-with-no-escape.d/stdout-expected.txt +6 -0
  14. data/ext/vendor/ctags/Tmain/ptag-kind-desc.d/stdout-expected.txt +2 -0
  15. data/ext/vendor/ctags/Tmain/tags-pseudo-tags.d/stdout-expected.txt +1 -0
  16. data/ext/vendor/ctags/Tmain/utils.sh +12 -2
  17. data/ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags-no-esc.d/args.ctags +4 -0
  18. data/ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags-no-esc.d/expected.tags +6 -0
  19. data/ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags-no-esc.d/input.php +10 -0
  20. data/ext/vendor/ctags/docs/contributions.rst +1 -0
  21. data/ext/vendor/ctags/docs/format.rst +13 -0
  22. data/ext/vendor/ctags/docs/interactive-mode.rst +61 -0
  23. data/ext/vendor/ctags/docs/news.rst +16 -1
  24. data/ext/vendor/ctags/docs/output-format.rst +1 -0
  25. data/ext/vendor/ctags/docs/output-xref.rst +10 -0
  26. data/ext/vendor/ctags/main/entry.c +6 -10
  27. data/ext/vendor/ctags/main/entry.h +1 -1
  28. data/ext/vendor/ctags/main/field.c +163 -72
  29. data/ext/vendor/ctags/main/field.h +4 -2
  30. data/ext/vendor/ctags/main/fmt.c +2 -2
  31. data/ext/vendor/ctags/main/main.c +5 -5
  32. data/ext/vendor/ctags/main/options.c +6 -3
  33. data/ext/vendor/ctags/main/parse.c +1 -1
  34. data/ext/vendor/ctags/main/ptag.c +4 -0
  35. data/ext/vendor/ctags/main/ptag.h +1 -0
  36. data/ext/vendor/ctags/main/writer-ctags.c +110 -34
  37. data/ext/vendor/ctags/main/writer-etags.c +11 -8
  38. data/ext/vendor/ctags/main/writer-json.c +18 -8
  39. data/ext/vendor/ctags/main/writer-xref.c +4 -2
  40. data/ext/vendor/ctags/main/writer.c +38 -11
  41. data/ext/vendor/ctags/main/writer.h +19 -7
  42. data/lib/ctags/universal.rb +1 -1
  43. data/lib/ctags/version.rb +1 -1
  44. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfbac3daba802b08417f169179cad4065c970508
4
- data.tar.gz: 2d857ac04dbdf3d888cf5d15ec5603d3209d2f64
3
+ metadata.gz: 8b821271b05b1a17a231a6f4a082836b0cec4e26
4
+ data.tar.gz: 12ac7ea29a1741618a50f0405a6ba478e0d81717
5
5
  SHA512:
6
- metadata.gz: c59dc1ea1a051d3fad425ed522570db502d3d5494601d709fffab79f4915f47a2e0d496358734e0fc2aac5738f59c4a5e5c96333f964d8c411b6277b286836dc
7
- data.tar.gz: 8d0a10102b4f6436443cca2f61797d1952423c956c18f724834155cb808f7f4e6966a379583ed99678d28c02275e46fa2cedc2b8ca7ee5082d723c1e3ce44295
6
+ metadata.gz: bd09d22aba9136f883c26c2525530f6d430c471bbd62cbfcde7d910b6291135f58acaa74f5873d49ad7eecf64bb83360bac6200f9f2c98e932ec9c35743c38e4
7
+ data.tar.gz: fbd5e1366c696c39aafcc0451f6227813145427cbdca1b2dde776477dd2cf907af4bbf8a36f15dd0e6ac26e1fddef4fea4865289fadb505bd7add88fce41f218
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ctags.rb (1.1.3)
4
+ ctags.rb (1.1.4)
5
5
  posix-spawn (~> 0.3.6)
6
6
  ripper-tags (~> 0.1.3)
7
7
  yajl-ruby
@@ -17,7 +17,7 @@ xsystem('pwd') # to create mkmf.log before the chdir
17
17
 
18
18
  Dir.chdir("#{CWD}/vendor/jansson-2.9") do
19
19
  sys "./configure --prefix=#{CWD}/dst --disable-shared" unless File.exists?('config.h')
20
- sys "touch *"
20
+ sys "touch configure aclocal.m4 Makefile.am Makefile.in"
21
21
  sys "make install"
22
22
  end
23
23
 
@@ -1,6 +1,7 @@
1
1
  !_TAG_FILE_ENCODING UTF-8 //
2
2
  !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
3
3
  !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
4
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
4
5
  !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
5
6
  !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
6
7
  !_TAG_PROGRAM_URL https://ctags.io/ /official site/
@@ -2,6 +2,9 @@
2
2
  # License: GPL-2
3
3
 
4
4
  CTAGS=$1
5
+ . ../utils.sh
6
+
7
+ is_feature_available ${CTAGS} interactive
5
8
 
6
9
  echo identification message on startup
7
10
  echo =======================================
@@ -38,7 +41,7 @@ echo =======================================
38
41
  echo
39
42
  echo generate tags from data
40
43
  echo =======================================
41
- size=$(stat -f %z test.rb)
44
+ size=$(filesize test.rb)
42
45
  (
43
46
  echo '{"command":"generate-tags", "filename":"test.rb", "size":'$size'}'
44
47
  cat test.rb
@@ -0,0 +1,4 @@
1
+ package main
2
+
3
+ func main() {
4
+ }
@@ -2,10 +2,14 @@
2
2
  {"_type": "tag", "name": "Foo", "path": "input.py", "pattern": "/^class Foo:$/", "kind": "class"}
3
3
  {"_type": "tag", "name": "doIt", "path": "input.py", "pattern": "/^ def doIt():$/", "kind": "member", "scope": "Foo", "scopeKind": "class"}
4
4
  {"_type": "tag", "name": "main", "path": "input.c", "pattern": "/^main(void)$/", "typeref": "int", "kind": "function"}
5
+ {"_type": "tag", "name": "main", "path": "input.go", "pattern": "/^func main() {$/", "kind": "func"}
6
+ {"_type": "tag", "name": "main", "path": "input.go", "pattern": "/^package main$/", "kind": "package"}
5
7
  # json --fields=*
6
8
  {"_type": "tag", "name": "Foo", "path": "input.py", "pattern": "/^class Foo:$/", "access": "public", "inherits": "", "language": "Python", "line": 1, "kind": "class", "end": "3"}
7
9
  {"_type": "tag", "name": "doIt", "path": "input.py", "pattern": "/^ def doIt():$/", "access": "public", "language": "Python", "line": 2, "signature": "()", "kind": "member", "scope": "Foo", "scopeKind": "class", "end": "3"}
8
10
  {"_type": "tag", "name": "main", "path": "input.c", "pattern": "/^main(void)$/", "language": "C", "line": 4, "signature": "(void)", "typeref": "int", "kind": "function", "end": "7"}
11
+ {"_type": "tag", "name": "main", "path": "input.go", "pattern": "/^func main() {$/", "language": "Go", "line": 3, "signature": "()", "kind": "func"}
12
+ {"_type": "tag", "name": "main", "path": "input.go", "pattern": "/^package main$/", "language": "Go", "line": 1, "kind": "package"}
9
13
  # json --fields=* --extra=*
10
14
  {"_type": "ptag", "name": "JSON_OUTPUT_VERSION", "path": "0.0", "pattern": "in development"}
11
15
  {"_type": "ptag", "name": "TAG_FILE_FORMAT", "path": "2", "pattern": "extended format; --format=1 will not append ;\" to lines"}
@@ -16,7 +20,11 @@
16
20
  {"_type": "tag", "name": "Foo", "path": "input.py", "pattern": "/^class Foo:$/", "access": "public", "inherits": "", "language": "Python", "line": 1, "kind": "class", "end": "3"}
17
21
  {"_type": "tag", "name": "Foo.doIt", "path": "input.py", "pattern": "/^ def doIt():$/", "access": "public", "language": "Python", "line": 2, "signature": "()", "kind": "member", "scope": "Foo", "extra": "qualified", "scopeKind": "class", "end": "3"}
18
22
  {"_type": "tag", "name": "doIt", "path": "input.py", "pattern": "/^ def doIt():$/", "access": "public", "language": "Python", "line": 2, "signature": "()", "kind": "member", "scope": "Foo", "scopeKind": "class", "end": "3"}
19
- {"_type": "tag", "name": "input.c", "path": "input.c", "pattern": "", "language": "C", "line": 1, "kind": "file", "extra": "inputFile", "end": "7"}
20
- {"_type": "tag", "name": "input.py", "path": "input.py", "pattern": "", "language": "Python", "line": 1, "kind": "file", "extra": "inputFile", "end": "3"}
23
+ {"_type": "tag", "name": "input.c", "path": "input.c", "pattern": "/^}$/", "language": "C", "line": 1, "kind": "file", "extra": "inputFile", "end": "7"}
24
+ {"_type": "tag", "name": "input.go", "path": "input.go", "pattern": "/^}$/", "language": "Go", "line": 1, "kind": "file", "extra": "inputFile", "end": "4"}
25
+ {"_type": "tag", "name": "input.py", "path": "input.py", "pattern": "/^ pass$/", "language": "Python", "line": 1, "kind": "file", "extra": "inputFile", "end": "3"}
21
26
  {"_type": "tag", "name": "main", "path": "input.c", "pattern": "/^main(void)$/", "language": "C", "line": 4, "signature": "(void)", "typeref": "int", "kind": "function", "end": "7"}
27
+ {"_type": "tag", "name": "main", "path": "input.go", "pattern": "/^func main() {$/", "language": "Go", "line": 3, "signature": "()", "kind": "func"}
28
+ {"_type": "tag", "name": "main", "path": "input.go", "pattern": "/^package main$/", "language": "Go", "line": 1, "kind": "package"}
29
+ {"_type": "tag", "name": "main.main", "path": "input.go", "pattern": "/^func main() {$/", "language": "Go", "line": 3, "signature": "()", "kind": "func", "extra": "qualified"}
22
30
  {"_type": "tag", "name": "stdio.h", "path": "input.c", "pattern": "/^#include <stdio.h>/", "language": "C", "line": 1, "kind": "header", "role": "system", "extra": "reference"}
@@ -7,3 +7,4 @@ TAG_PROGRAM_URL the official site URL of this ctags implementation on
7
7
  TAG_PROGRAM_VERSION the version of this ctags implementation on
8
8
  TAG_KIND_SEPARATOR the separators used in kinds off
9
9
  TAG_KIND_DESCRIPTION the letters, names and descriptions of kinds in a parser off
10
+ TAG_OUTPUT_MODE the output mode: u-ctags or e-ctags on
@@ -1,6 +1,7 @@
1
1
  !_TAG_FILE_ENCODING cp932 //
2
2
  !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
3
3
  !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
4
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
4
5
  !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
5
6
  !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
6
7
  !_TAG_PROGRAM_URL https://ctags.io/ /official site/
@@ -5,6 +5,6 @@ CTAGS=$1
5
5
 
6
6
  . ../utils.sh
7
7
 
8
- run_with_format ctags
8
+ run_with_format u-ctags
9
9
  run_with_format etags
10
10
  run_with_format xref
@@ -1,4 +1,4 @@
1
- # ctags
1
+ # u-ctags
2
2
  main input.c /^main(void)$/;" f typeref:typename:int
3
3
  # etags
4
4
 
@@ -0,0 +1,20 @@
1
+ # Copyright: 2016 Masatake YAMATO
2
+ # License: GPL-2
3
+
4
+ . ../utils.sh
5
+
6
+ CTAGS=$1
7
+
8
+
9
+
10
+ if ! ( echo '#define foo' > 'a\b.c' ) 2> /dev/null; then
11
+ skip "unsuitable platform to run this test"
12
+ fi
13
+
14
+ echo '# u-ctags'
15
+ ${CTAGS} --pseudo-tags=TAG_OUTPUT_MODE --extra=+p --output-format=u-ctags -o - 'a\b.c'
16
+
17
+ echo '# e-ctags'
18
+ ${CTAGS} --pseudo-tags=TAG_OUTPUT_MODE --extra=+p --output-format=e-ctags -o - 'a\b.c'
19
+
20
+ rm 'a\b.c'
@@ -0,0 +1,6 @@
1
+ # u-ctags
2
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
3
+ foo a\\b.c /^#define foo$/;" d file:
4
+ # e-ctags
5
+ !_TAG_OUTPUT_MODE e-ctags /u-ctags or e-ctags/
6
+ foo a\b.c /^#define foo$/;" d file:
@@ -4,6 +4,7 @@
4
4
  !_TAG_KIND_DESCRIPTION!Sh a,alias /aliases/
5
5
  !_TAG_KIND_DESCRIPTION!Sh f,function /functions/
6
6
  !_TAG_KIND_DESCRIPTION!Sh s,script /script files/
7
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
7
8
  !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
8
9
  !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
9
10
  !_TAG_PROGRAM_URL https://ctags.io/ /official site/
@@ -11,6 +12,7 @@
11
12
  !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
12
13
  !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
13
14
  !_TAG_KIND_DESCRIPTION!foo k,kind /kinds/
15
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
14
16
  !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
15
17
  !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
16
18
  !_TAG_PROGRAM_URL https://ctags.io/ /official site/
@@ -19,6 +19,7 @@
19
19
  !_TAG_KIND_SEPARATOR!PHP \\ /nn/
20
20
  !_TAG_KIND_SEPARATOR!PHP \\ /nt/
21
21
  !_TAG_KIND_SEPARATOR!PHP \\ /nv/
22
+ !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/
22
23
  !_TAG_PROGRAM_AUTHOR Universal Ctags Team //
23
24
  !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
24
25
  !_TAG_PROGRAM_URL https://ctags.io/ /official site/
@@ -1,19 +1,29 @@
1
1
  __SKIP__=77
2
2
 
3
+ skip()
4
+ {
5
+ echo "$@"
6
+ exit ${__SKIP__}
7
+ }
8
+
3
9
  remove_commit_id()
4
10
  {
5
11
  # Remove a commit id embedded in tags file
6
12
  sed -i -e '/!_TAG_PROGRAM_VERSION.*/s#/[^/]*/#//#' $1
7
13
  }
8
14
 
15
+ filesize()
16
+ {
17
+ wc -c "$1" | awk '{ print $1 }'
18
+ }
19
+
9
20
  is_feature_available()
10
21
  {
11
22
  local ctags=$1
12
23
  local feat=$2
13
24
 
14
25
  if ! ${ctags} --list-features | grep -q "$feat"; then
15
- echo "feature \"$feat\" is not available in $ctags"
16
- exit ${__SKIP__}
26
+ skip "feature \"$feat\" is not available in $ctags"
17
27
  fi
18
28
  }
19
29
 
@@ -0,0 +1,4 @@
1
+ --extra=+qp
2
+ --output-format=e-ctags
3
+ --pseudo-tags=TAG_OUTPUT_MODE
4
+
@@ -0,0 +1,6 @@
1
+ !_TAG_OUTPUT_MODE e-ctags /u-ctags or e-ctags/
2
+ __construct input.php /^ public function __construct() {$/;" f class:foo\bar
3
+ bar input.php /^class bar {$/;" c namespace:foo
4
+ foo input.php /^namespace foo;$/;" n
5
+ foo\bar input.php /^class bar {$/;" c namespace:foo
6
+ foo\bar::__construct input.php /^ public function __construct() {$/;" f class:foo\bar
@@ -0,0 +1,10 @@
1
+ Taken from an issue report (#787) by @sserbin
2
+
3
+ <?php
4
+ namespace foo;
5
+
6
+ class bar {
7
+ public function __construct() {
8
+ }
9
+ }
10
+ >
@@ -141,6 +141,7 @@ GNU style:
141
141
  ...
142
142
 
143
143
  non-GNU style:
144
+
144
145
  .. code-block:: C
145
146
 
146
147
  if (...)
@@ -472,3 +472,16 @@ Exceptions
472
472
  this exceptions. See {tagname} of Proposal section for more detail
473
473
  about the conversion.
474
474
 
475
+ .. _compat-output:
476
+ Compatible output and weakness
477
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
478
+
479
+ .. NOT REVIEWED YET
480
+
481
+ Default behavior (``--output-format=u-ctags`` option) has the
482
+ exceptions. In ther hand, with ``--output-format=e-ctags`` option
483
+ ctags has no exception; Universal-ctags command may use the same file
484
+ format as Exuberant-ctags. However, ``--output-format=e-ctags`` throws
485
+ away a tag entry which name includes a space or a tab
486
+ character. ``TAG_OUTPUT_MODE`` psuedo tag tells which format is
487
+ used when ctags generating tags file.
@@ -0,0 +1,61 @@
1
+ .. _interactive-mode:
2
+
3
+ ======================================================================
4
+ ``--interactive`` Mode
5
+ ======================================================================
6
+
7
+ Universtal ctags can be run with ``--interactive``, which enters a REPL that
8
+ can be used programatically to control ctags generation. In this mode, json
9
+ commands are received over stdin, and corresponding responses are emitted over
10
+ stdout.
11
+
12
+ Communication with Universal ctags over stdio uses the `json lines`_ format, where each
13
+ json object appears on a single line and is terminated with a newline.
14
+
15
+ When ``ctags --interactive`` is invoked, it will emit a single json object to stdout announcing
16
+ its name and version. This signals the start of the interactive loop, and the user can begin sending
17
+ commands over stdin.
18
+
19
+ .. code-block:: console
20
+
21
+ $ ctags --interactive
22
+ {"name": "Universal Ctags", "version": "0.0.0"}
23
+
24
+ The following commands are currently supported in interactive mode:
25
+
26
+ - generate-tags_
27
+
28
+ generate-tags
29
+ -------------
30
+
31
+ The ``generate-tags`` command takes two arguments:
32
+
33
+ - ``filename``: name of the file to generate tags for (required)
34
+ - ``size``: size in bytes of the file, if the contents will be received over stdin (optional)
35
+
36
+ The simplest way to generate tags for a file is by passing its path on disk. The response will include
37
+ one json object per line representing each tag, followed by a single json object with the ``completed``
38
+ field emitted once the file has been fully processed.
39
+
40
+ .. code-block:: console
41
+
42
+ $ echo '{"command":"generate-tags", "filename":"test.rb"}' | ctags --interactive
43
+ {"name": "Universal Ctags", "version": "0.0.0"}
44
+ {"_type": "tag", "name": "foobar", "path": "test.rb", "pattern": "/^ def foobar$/", "kind": "method", "scope": "Test", "scopeKind": "class"}
45
+ {"completed": "generate-tags"}
46
+
47
+ The ``generate-tags`` command can also be used to generate tags for code which is not present on disk. For example,
48
+ an IDE might want to generate ctags for an unsaved buffer while the user is editing code. When ``size`` is specified,
49
+ the corresponding number of bytes are read over stdin after the json object and newline.
50
+
51
+ .. code-block:: console
52
+
53
+ $ (
54
+ echo '{"command":"generate-tags", "filename":"test.rb", "size": 17}'
55
+ echo 'def foobaz() end'
56
+ ) | ctags --interactive
57
+ {"name": "Universal Ctags", "version": "0.0.0"}
58
+ {"_type": "tag", "name": "foobaz", "path": "test.rb", "pattern": "/^def foobaz() end$/", "kind": "method"}
59
+ {"completed": "generate-tags"}
60
+
61
+ .. _json lines: http://jsonlines.org/
@@ -284,7 +284,7 @@ header is easy because it starts with a `#` character.
284
284
  ``--with-list-header=no`` suppresses output of the column header.
285
285
 
286
286
  Kinds synchronization
287
- ----------------------------------------------------------------------
287
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288
288
 
289
289
  In Universal-ctags, as in Exuberant-ctags, most kinds are parser
290
290
  local; enabling (or disabling) a kind in a parser has no effect on
@@ -589,6 +589,13 @@ will be processed as
589
589
 
590
590
  int x(int a,int b);
591
591
 
592
+ ``--interactive`` Mode
593
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
594
+
595
+ A new ``--interactive`` option launches a JSON based command REPL which
596
+ can be used to control ctags generation programatically.
597
+
598
+ See :ref:`--interactive Mode <interactive-mode>` for more details.
592
599
 
593
600
  Changes to the tags file format
594
601
  ---------------------------------------------------------------------
@@ -873,6 +880,14 @@ The third line means `\\` is used when for combining a namespace item
873
880
  Of course, ctags uses the more specific line when choosing a
874
881
  separator; the third line has higher priority than the first.
875
882
 
883
+ ``TAG_OUTPUT_MODE``
884
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
885
+
886
+ .. NOT REVIEWED YET
887
+
888
+ This pseudo tag represents output mode: u-ctags or e-ctags.
889
+
890
+ See also :ref:`Compatible output and weakness <compat-output>`.
876
891
 
877
892
  Parser own fields
878
893
  ---------------------------------------------------------------------
@@ -17,3 +17,4 @@ This section deals with individual output-format topics.
17
17
  :maxdepth: 2
18
18
 
19
19
  output-json.rst
20
+ output-xref.rst
@@ -0,0 +1,10 @@
1
+ .. _output-xref:
2
+
3
+ .. NOT REVIEWED YET
4
+
5
+ ======================================================================
6
+ Xref output
7
+ ======================================================================
8
+
9
+ * Priting `z`{kind} field in xref format doesn't include `kind:` prefix.
10
+ * Priting `Z`{scope} field in xref format doesn't include `scope:` prefix.
@@ -1040,21 +1040,14 @@ static unsigned int queueTagEntry(const tagEntryInfo *const tag)
1040
1040
  }
1041
1041
 
1042
1042
 
1043
- static void buildFqTagCache (const tagEntryInfo *const tag)
1044
- {
1045
- /* TODO: WRITER_DEFAULT should not be used here.*/
1046
- renderFieldEscaped (WRITER_DEFAULT, FIELD_SCOPE_KIND_LONG, tag, NO_PARSER_FIELD);
1047
- renderFieldEscaped (WRITER_DEFAULT, FIELD_SCOPE, tag, NO_PARSER_FIELD);
1048
- }
1049
-
1050
1043
  extern void setupWriter (void)
1051
1044
  {
1052
1045
  writerSetup (TagFile.mio);
1053
1046
  }
1054
1047
 
1055
- extern void teardownWriter (const char *filename)
1048
+ extern bool teardownWriter (const char *filename)
1056
1049
  {
1057
- writerTeardown (TagFile.mio, filename);
1050
+ return writerTeardown (TagFile.mio, filename);
1058
1051
  }
1059
1052
 
1060
1053
  static void writeTagEntry (const tagEntryInfo *const tag)
@@ -1074,7 +1067,10 @@ static void writeTagEntry (const tagEntryInfo *const tag)
1074
1067
  if (includeExtensionFlags ()
1075
1068
  && isXtagEnabled (XTAG_QUALIFIED_TAGS)
1076
1069
  && doesInputLanguageRequestAutomaticFQTag ())
1077
- buildFqTagCache (tag);
1070
+ {
1071
+ /* const is discarded to update the cache field of TAG. */
1072
+ writerBuildFqTagCache ( (tagEntryInfo *const)tag);
1073
+ }
1078
1074
 
1079
1075
  length = writerWriteTag (TagFile.mio, tag);
1080
1076
 
@@ -113,7 +113,7 @@ extern const char *tagFileName (void);
113
113
  extern void openTagFile (void);
114
114
  extern void closeTagFile (const bool resize);
115
115
  extern void setupWriter (void);
116
- extern void teardownWriter (const char *inputFilename);
116
+ extern bool teardownWriter (const char *inputFilename);
117
117
  extern int makeTagEntry (const tagEntryInfo *const tag);
118
118
  extern void initTagEntry (tagEntryInfo *const e, const char *const name,
119
119
  const kindOption *kind);
@@ -35,27 +35,33 @@ struct sFieldDesc {
35
35
  fieldType sibling;
36
36
  };
37
37
 
38
- static const char *renderFieldName (const tagEntryInfo *const tag, const char *value, vString* b);
39
- static const char *renderFieldInput (const tagEntryInfo *const tag, const char *value, vString* b);
40
- static const char *renderFieldCompactInputLine (const tagEntryInfo *const tag, const char *value, vString* b);
41
- static const char *renderFieldSignature (const tagEntryInfo *const tag, const char *value, vString* b);
42
- static const char *renderFieldScope (const tagEntryInfo *const tag, const char *value, vString* b);
43
- static const char *renderFieldTyperef (const tagEntryInfo *const tag, const char *value, vString* b);
44
- static const char *renderFieldInherits (const tagEntryInfo *const tag, const char *value, vString* b);
45
- static const char *renderFieldKindName (const tagEntryInfo *const tag, const char *value, vString* b);
46
- static const char *renderFieldLineNumber (const tagEntryInfo *const tag, const char *value, vString* b);
47
- static const char *renderFieldLanguage (const tagEntryInfo *const tag, const char *value, vString* b);
48
- static const char *renderFieldAccess (const tagEntryInfo *const tag, const char *value, vString* b);
49
- static const char *renderFieldKindLetter (const tagEntryInfo *const tag, const char *value, vString* b);
50
- static const char *renderFieldImplementation (const tagEntryInfo *const tag, const char *value, vString* b);
51
- static const char *renderFieldFile (const tagEntryInfo *const tag, const char *value, vString* b);
52
- static const char *renderFieldPattern (const tagEntryInfo *const tag, const char *value, vString* b);
53
- static const char *renderFieldRole (const tagEntryInfo *const tag, const char *value, vString* b);
54
- static const char *renderFieldRefMarker (const tagEntryInfo *const tag, const char *value, vString* b);
55
- static const char *renderFieldExtra (const tagEntryInfo *const tag, const char *value, vString* b);
56
- static const char *renderFieldXpath (const tagEntryInfo *const tag, const char *value, vString* b);
57
- static const char *renderFieldScopeKindName(const tagEntryInfo *const tag, const char *value, vString* b);
58
- static const char *renderFieldEnd (const tagEntryInfo *const tag, const char *value, vString* b);
38
+ static const char *renderFieldName (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
39
+ static const char *renderFieldNameNoEscape (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
40
+ bool *rejected);
41
+ static const char *renderFieldInput (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
42
+ static const char *renderFieldInputNoEscape (const tagEntryInfo *const tag, const char *value, vString* b,
43
+ bool *rejected);
44
+ static const char *renderFieldCompactInputLine (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
45
+ static const char *renderFieldSignature (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
46
+ static const char *renderFieldScope (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
47
+ static const char *renderFieldScopeNoEscape (const tagEntryInfo *const tag, const char *value, vString* b,
48
+ bool *rejected);
49
+ static const char *renderFieldTyperef (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
50
+ static const char *renderFieldInherits (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
51
+ static const char *renderFieldKindName (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
52
+ static const char *renderFieldLineNumber (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
53
+ static const char *renderFieldLanguage (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
54
+ static const char *renderFieldAccess (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
55
+ static const char *renderFieldKindLetter (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
56
+ static const char *renderFieldImplementation (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
57
+ static const char *renderFieldFile (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
58
+ static const char *renderFieldPattern (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
59
+ static const char *renderFieldRole (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
60
+ static const char *renderFieldRefMarker (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
61
+ static const char *renderFieldExtra (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
62
+ static const char *renderFieldXpath (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
63
+ static const char *renderFieldScopeKindName(const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
64
+ static const char *renderFieldEnd (const tagEntryInfo *const tag, const char *value, vString* b, bool *rejected);
59
65
 
60
66
  static bool isLanguageFieldAvailable (const tagEntryInfo *const tag);
61
67
  static bool isTyperefFieldAvailable (const tagEntryInfo *const tag);
@@ -70,15 +76,15 @@ static bool isXpathFieldAvailable (const tagEntryInfo *const tag);
70
76
  static bool isEndFieldAvailable (const tagEntryInfo *const tag);
71
77
 
72
78
 
73
- #define DEFINE_FIELD_SPEC(L, N, V, H, F) \
74
- DEFINE_FIELD_SPEC_FULL (L, N, V, H, F, NULL)
75
- #define DEFINE_FIELD_SPEC_FULL(L, N, V, H, F, A)\
79
+ #define DEFINE_FIELD_SPEC(L, N, V, H, ...) \
80
+ DEFINE_FIELD_SPEC_FULL (L, N, V, H, NULL, __VA_ARGS__)
81
+ #define DEFINE_FIELD_SPEC_FULL(L, N, V, H, A, ...) \
76
82
  { \
77
83
  .letter = L, \
78
84
  .name = N, \
79
85
  .description = H, \
80
86
  .enabled = V, \
81
- .renderEscaped = F, \
87
+ .renderEscaped = { __VA_ARGS__ }, \
82
88
  .isValueAvailable = A, \
83
89
  }
84
90
 
@@ -88,85 +94,100 @@ static fieldSpec fieldSpecsFixed [] = {
88
94
  /* FIXED FIELDS */
89
95
  DEFINE_FIELD_SPEC ('N', "name", true,
90
96
  "tag name (fixed field)",
91
- {[WRITER_CTAGS] = renderFieldName}),
97
+ [WRITER_U_CTAGS] = renderFieldName,
98
+ [WRITER_E_CTAGS] = renderFieldNameNoEscape),
92
99
  DEFINE_FIELD_SPEC ('F', "input", true,
93
100
  "input file (fixed field)",
94
- {[WRITER_CTAGS] = renderFieldInput}),
101
+ [WRITER_U_CTAGS] = renderFieldInput,
102
+ [WRITER_E_CTAGS] = renderFieldInputNoEscape),
95
103
  DEFINE_FIELD_SPEC ('P', "pattern", true,
96
104
  "pattern (fixed field)",
97
- {[WRITER_CTAGS] = renderFieldPattern}),
105
+ [WRITER_U_CTAGS] = renderFieldPattern),
98
106
  };
99
107
 
100
108
  static fieldSpec fieldSpecsExuberant [] = {
101
109
  DEFINE_FIELD_SPEC ('C', "compact", false,
102
110
  "compact input line (fixed field, only used in -x option)",
103
- {[WRITER_CTAGS] = renderFieldCompactInputLine}),
111
+ [WRITER_U_CTAGS] = renderFieldCompactInputLine),
104
112
 
105
113
  /* EXTENSION FIELDS */
106
114
  DEFINE_FIELD_SPEC_FULL ('a', "access", false,
107
115
  "Access (or export) of class members",
108
- {[WRITER_CTAGS] = renderFieldAccess}, isAccessFieldAvailable),
116
+ isAccessFieldAvailable,
117
+ [WRITER_U_CTAGS] = renderFieldAccess),
109
118
  DEFINE_FIELD_SPEC_FULL ('f', "file", true,
110
119
  "File-restricted scoping",
111
- {[WRITER_CTAGS] = renderFieldFile}, isFileFieldAvailable),
120
+ isFileFieldAvailable,
121
+ [WRITER_U_CTAGS] = renderFieldFile),
112
122
  DEFINE_FIELD_SPEC_FULL ('i', "inherits", false,
113
123
  "Inheritance information",
114
- {[WRITER_CTAGS] = renderFieldInherits}, isInheritsFieldAvailable),
124
+ isInheritsFieldAvailable,
125
+ [WRITER_U_CTAGS] = renderFieldInherits),
115
126
  DEFINE_FIELD_SPEC ('K', NULL, false,
116
127
  "Kind of tag as full name",
117
- {[WRITER_CTAGS] = renderFieldKindName}),
128
+ [WRITER_U_CTAGS] = renderFieldKindName),
118
129
  DEFINE_FIELD_SPEC ('k', NULL, true,
119
130
  "Kind of tag as a single letter",
120
- {[WRITER_CTAGS] = renderFieldKindLetter}),
131
+ [WRITER_U_CTAGS] = renderFieldKindLetter),
121
132
  DEFINE_FIELD_SPEC_FULL ('l', "language", false,
122
133
  "Language of input file containing tag",
123
- {[WRITER_CTAGS] = renderFieldLanguage}, isLanguageFieldAvailable),
134
+ isLanguageFieldAvailable,
135
+ [WRITER_U_CTAGS] = renderFieldLanguage),
124
136
  DEFINE_FIELD_SPEC_FULL ('m', "implementation", false,
125
137
  "Implementation information",
126
- {[WRITER_CTAGS] = renderFieldImplementation}, isImplementationFieldAvailable),
138
+ isImplementationFieldAvailable,
139
+ [WRITER_U_CTAGS] = renderFieldImplementation),
127
140
  DEFINE_FIELD_SPEC ('n', "line", false,
128
141
  "Line number of tag definition",
129
- {[WRITER_CTAGS] = renderFieldLineNumber}),
142
+ [WRITER_U_CTAGS] = renderFieldLineNumber),
130
143
  DEFINE_FIELD_SPEC_FULL ('S', "signature", false,
131
144
  "Signature of routine (e.g. prototype or parameter list)",
132
- {[WRITER_CTAGS] = renderFieldSignature}, isSignatureFieldAvailable),
145
+ isSignatureFieldAvailable,
146
+ [WRITER_U_CTAGS] = renderFieldSignature),
133
147
  DEFINE_FIELD_SPEC ('s', NULL, true,
134
148
  "Scope of tag definition (`p' can be used for printing its kind)",
135
- {[WRITER_CTAGS] = renderFieldScope}),
149
+ [WRITER_U_CTAGS] = renderFieldScope,
150
+ [WRITER_E_CTAGS] = renderFieldScopeNoEscape),
136
151
  DEFINE_FIELD_SPEC_FULL ('t', "typeref", true,
137
152
  "Type and name of a variable or typedef",
138
- {[WRITER_CTAGS] = renderFieldTyperef}, isTyperefFieldAvailable),
153
+ isTyperefFieldAvailable,
154
+ [WRITER_U_CTAGS] = renderFieldTyperef),
139
155
  DEFINE_FIELD_SPEC ('z', "kind", false,
140
156
  "Include the \"kind:\" key in kind field (use k or K) in tags output, kind full name in xref output",
141
157
  /* Following renderer is for handling --_xformat=%{kind};
142
158
  and is not for tags output. */
143
- {[WRITER_CTAGS] = renderFieldKindName}),
159
+ [WRITER_U_CTAGS] = renderFieldKindName),
144
160
  };
145
161
 
146
162
  static fieldSpec fieldSpecsUniversal [] = {
147
163
  DEFINE_FIELD_SPEC_FULL ('r', "role", false,
148
164
  "Role",
149
- {[WRITER_CTAGS] = renderFieldRole}, isRoleFieldAvailable),
165
+ isRoleFieldAvailable,
166
+ [WRITER_U_CTAGS] = renderFieldRole),
150
167
  DEFINE_FIELD_SPEC ('R', NULL, false,
151
168
  "Marker (R or D) representing whether tag is definition or reference",
152
- {[WRITER_CTAGS] = renderFieldRefMarker}),
169
+ [WRITER_U_CTAGS] = renderFieldRefMarker),
153
170
  DEFINE_FIELD_SPEC ('Z', "scope", false,
154
171
  "Include the \"scope:\" key in scope field (use s) in tags output, scope name in xref output",
155
172
  /* Following renderer is for handling --_xformat=%{scope};
156
173
  and is not for tags output. */
157
- {[WRITER_CTAGS] = renderFieldScope}),
174
+ [WRITER_U_CTAGS] = renderFieldScope,
175
+ [WRITER_E_CTAGS] = renderFieldScopeNoEscape),
158
176
  DEFINE_FIELD_SPEC_FULL ('E', "extra", false,
159
177
  "Extra tag type information",
160
- {[WRITER_CTAGS] = renderFieldExtra}, isExtraFieldAvailable),
178
+ isExtraFieldAvailable,
179
+ [WRITER_U_CTAGS] = renderFieldExtra),
161
180
  DEFINE_FIELD_SPEC_FULL ('x', "xpath", false,
162
181
  "xpath for the tag",
163
- {[WRITER_CTAGS] = renderFieldXpath}, isXpathFieldAvailable),
182
+ isXpathFieldAvailable,
183
+ [WRITER_U_CTAGS] = renderFieldXpath),
164
184
  DEFINE_FIELD_SPEC ('p', "scopeKind", false,
165
185
  "Kind of scope as full name",
166
- {[WRITER_CTAGS] = renderFieldScopeKindName}),
186
+ [WRITER_U_CTAGS] = renderFieldScopeKindName),
167
187
  DEFINE_FIELD_SPEC_FULL ('e', "end", false,
168
188
  "end lines of various items",
169
- {[WRITER_CTAGS] = renderFieldEnd}, isEndFieldAvailable),
189
+ isEndFieldAvailable,
190
+ [WRITER_U_CTAGS] = renderFieldEnd),
170
191
  };
171
192
 
172
193
 
@@ -421,12 +442,25 @@ static const char *renderEscapedName (const char* s,
421
442
  return renderEscapedString (s, tag, b);
422
443
  }
423
444
 
424
- static const char *renderFieldName (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
445
+ static const char *renderFieldName (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
446
+ bool *rejected)
425
447
  {
426
448
  return renderEscapedName (tag->name, tag, b);
427
449
  }
428
450
 
429
- static const char *renderFieldInput (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
451
+ static const char *renderFieldNameNoEscape (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
452
+ bool *rejected)
453
+ {
454
+ if (strpbrk (tag->name, " \t"))
455
+ {
456
+ *rejected = true;
457
+ return NULL;
458
+ }
459
+ return renderAsIs (b, tag->name);
460
+ }
461
+
462
+ static const char *renderFieldInput (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
463
+ bool *rejected)
430
464
  {
431
465
  const char *f = tag->inputFileName;
432
466
 
@@ -435,13 +469,32 @@ static const char *renderFieldInput (const tagEntryInfo *const tag, const char *
435
469
  return renderEscapedString (f, tag, b);
436
470
  }
437
471
 
438
- static const char *renderFieldSignature (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
472
+ static const char *renderFieldInputNoEscape (const tagEntryInfo *const tag, const char *value, vString* b,
473
+ bool *rejected)
474
+ {
475
+ const char *f = tag->inputFileName;
476
+
477
+ if (Option.lineDirectives && tag->sourceFileName)
478
+ f = tag->sourceFileName;
479
+
480
+ if (strpbrk (f, " \t"))
481
+ {
482
+ *rejected = true;
483
+ return NULL;
484
+ }
485
+
486
+ return renderAsIs (b, f);
487
+ }
488
+
489
+ static const char *renderFieldSignature (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
490
+ bool *rejected)
439
491
  {
440
492
  return renderEscapedString (WITH_DEFUALT_VALUE (tag->extensionFields.signature),
441
493
  tag, b);
442
494
  }
443
495
 
444
- static const char *renderFieldScope (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
496
+ static const char *renderFieldScope (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
497
+ bool *rejected)
445
498
  {
446
499
  const char* scope;
447
500
 
@@ -449,13 +502,30 @@ static const char *renderFieldScope (const tagEntryInfo *const tag, const char *
449
502
  return scope? renderEscapedName (scope, tag, b): NULL;
450
503
  }
451
504
 
452
- static const char *renderFieldInherits (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
505
+ static const char *renderFieldScopeNoEscape (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
506
+ bool *rejected)
507
+ {
508
+ const char* scope;
509
+
510
+ getTagScopeInformation ((tagEntryInfo *const)tag, NULL, &scope);
511
+ if (scope && strpbrk (scope, " \t"))
512
+ {
513
+ *rejected = true;
514
+ return NULL;
515
+ }
516
+
517
+ return scope? renderAsIs (b, scope): NULL;
518
+ }
519
+
520
+ static const char *renderFieldInherits (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
521
+ bool *rejected)
453
522
  {
454
523
  return renderEscapedString (WITH_DEFUALT_VALUE (tag->extensionFields.inheritance),
455
524
  tag, b);
456
525
  }
457
526
 
458
- static const char *renderFieldTyperef (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
527
+ static const char *renderFieldTyperef (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
528
+ bool *rejected)
459
529
  {
460
530
  return renderEscapedName (WITH_DEFUALT_VALUE (tag->extensionFields.typeRef [1]), tag, b);
461
531
  }
@@ -464,11 +534,13 @@ static const char *renderFieldTyperef (const tagEntryInfo *const tag, const char
464
534
  extern const char* renderFieldEscaped (writerType writer,
465
535
  fieldType type,
466
536
  const tagEntryInfo *tag,
467
- int index)
537
+ int index,
538
+ bool *rejected)
468
539
  {
469
540
  fieldDesc *fdesc = fieldDescs + type;
470
541
  const char *value;
471
542
  renderEscaped rfn;
543
+ bool stub;
472
544
 
473
545
  Assert (tag);
474
546
  Assert (fdesc->spec->renderEscaped);
@@ -486,7 +558,10 @@ extern const char* renderFieldEscaped (writerType writer,
486
558
  rfn = fdesc->spec->renderEscaped [writer];
487
559
  if (rfn == NULL)
488
560
  rfn = fdesc->spec->renderEscaped [WRITER_DEFAULT];
489
- return rfn (tag, value, fdesc->buffer);
561
+
562
+ if (!rejected)
563
+ rejected = &stub;
564
+ return rfn (tag, value, fdesc->buffer, rejected);
490
565
  }
491
566
 
492
567
  /* Writes "line", stripping leading and duplicate white space.
@@ -521,14 +596,16 @@ static const char* renderCompactInputLine (vString *b, const char *const line)
521
596
  return vStringValue (b);
522
597
  }
523
598
 
524
- static const char *renderFieldKindName (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b)
599
+ static const char *renderFieldKindName (const tagEntryInfo *const tag, const char *value CTAGS_ATTR_UNUSED, vString* b,
600
+ bool *rejected)
525
601
  {
526
602
  return renderAsIs (b, tag->kind->name);
527
603
  }
528
604
 
529
605
  static const char *renderFieldCompactInputLine (const tagEntryInfo *const tag,
530
606
  const char *value CTAGS_ATTR_UNUSED,
531
- vString* b)
607
+ vString* b,
608
+ bool *rejected)
532
609
  {
533
610
  const char *line;
534
611
  static vString *tmp;
@@ -552,7 +629,8 @@ static const char *renderFieldCompactInputLine (const tagEntryInfo *const tag,
552
629
 
553
630
  static const char *renderFieldLineNumber (const tagEntryInfo *const tag,
554
631
  const char *value CTAGS_ATTR_UNUSED,
555
- vString* b)
632
+ vString* b,
633
+ bool *rejected)
556
634
  {
557
635
  long ln = tag->lineNumber;
558
636
  char buf[32] = {[0] = '\0'};
@@ -566,7 +644,8 @@ static const char *renderFieldLineNumber (const tagEntryInfo *const tag,
566
644
 
567
645
  static const char *renderFieldRole (const tagEntryInfo *const tag,
568
646
  const char *value CTAGS_ATTR_UNUSED,
569
- vString* b)
647
+ vString* b,
648
+ bool *rejected)
570
649
  {
571
650
  int rindex = tag->extensionFields.roleIndex;
572
651
  const roleDesc * role;
@@ -585,7 +664,8 @@ static const char *renderFieldRole (const tagEntryInfo *const tag,
585
664
 
586
665
  static const char *renderFieldLanguage (const tagEntryInfo *const tag,
587
666
  const char *value CTAGS_ATTR_UNUSED,
588
- vString* b)
667
+ vString* b,
668
+ bool *rejected)
589
669
  {
590
670
  const char *l = tag->language;
591
671
 
@@ -597,14 +677,16 @@ static const char *renderFieldLanguage (const tagEntryInfo *const tag,
597
677
 
598
678
  static const char *renderFieldAccess (const tagEntryInfo *const tag,
599
679
  const char *value,
600
- vString* b)
680
+ vString* b,
681
+ bool *rejected)
601
682
  {
602
683
  return renderAsIs (b, WITH_DEFUALT_VALUE (tag->extensionFields.access));
603
684
  }
604
685
 
605
686
  static const char *renderFieldKindLetter (const tagEntryInfo *const tag,
606
687
  const char *value CTAGS_ATTR_UNUSED,
607
- vString* b)
688
+ vString* b,
689
+ bool *rejected)
608
690
  {
609
691
  static char c[2] = { [1] = '\0' };
610
692
 
@@ -615,21 +697,24 @@ static const char *renderFieldKindLetter (const tagEntryInfo *const tag,
615
697
 
616
698
  static const char *renderFieldImplementation (const tagEntryInfo *const tag,
617
699
  const char *value CTAGS_ATTR_UNUSED,
618
- vString* b)
700
+ vString* b,
701
+ bool *rejected)
619
702
  {
620
703
  return renderAsIs (b, WITH_DEFUALT_VALUE (tag->extensionFields.implementation));
621
704
  }
622
705
 
623
706
  static const char *renderFieldFile (const tagEntryInfo *const tag,
624
707
  const char *value CTAGS_ATTR_UNUSED,
625
- vString* b)
708
+ vString* b,
709
+ bool *rejected)
626
710
  {
627
711
  return renderAsIs (b, tag->isFileScope? "file": "-");
628
712
  }
629
713
 
630
714
  static const char *renderFieldPattern (const tagEntryInfo *const tag,
631
715
  const char *value CTAGS_ATTR_UNUSED,
632
- vString* b)
716
+ vString* b,
717
+ bool *rejected)
633
718
  {
634
719
  char* tmp = makePatternString (tag);
635
720
  vStringCatS (b, tmp);
@@ -639,7 +724,8 @@ static const char *renderFieldPattern (const tagEntryInfo *const tag,
639
724
 
640
725
  static const char *renderFieldRefMarker (const tagEntryInfo *const tag,
641
726
  const char *value CTAGS_ATTR_UNUSED,
642
- vString* b)
727
+ vString* b,
728
+ bool *rejected)
643
729
  {
644
730
  static char c[2] = { [1] = '\0' };
645
731
 
@@ -650,7 +736,8 @@ static const char *renderFieldRefMarker (const tagEntryInfo *const tag,
650
736
 
651
737
  static const char *renderFieldExtra (const tagEntryInfo *const tag,
652
738
  const char *value CTAGS_ATTR_UNUSED,
653
- vString* b)
739
+ vString* b,
740
+ bool *rejected)
654
741
  {
655
742
  int i;
656
743
  bool hasExtra = false;
@@ -680,7 +767,8 @@ static const char *renderFieldExtra (const tagEntryInfo *const tag,
680
767
 
681
768
  static const char *renderFieldXpath (const tagEntryInfo *const tag,
682
769
  const char *value,
683
- vString* b)
770
+ vString* b,
771
+ bool *rejected)
684
772
  {
685
773
  #ifdef HAVE_LIBXML
686
774
  if (tag->extensionFields.xpath)
@@ -692,7 +780,8 @@ static const char *renderFieldXpath (const tagEntryInfo *const tag,
692
780
 
693
781
  static const char *renderFieldScopeKindName(const tagEntryInfo *const tag,
694
782
  const char *value,
695
- vString* b)
783
+ vString* b,
784
+ bool *rejected)
696
785
  {
697
786
  const char* kind;
698
787
 
@@ -702,7 +791,8 @@ static const char *renderFieldScopeKindName(const tagEntryInfo *const tag,
702
791
 
703
792
  static const char *renderFieldEnd (const tagEntryInfo *const tag,
704
793
  const char *value,
705
- vString* b)
794
+ vString* b,
795
+ bool *rejected)
706
796
  {
707
797
  static char buf[16];
708
798
 
@@ -877,7 +967,8 @@ static void updateSiblingField (fieldType type, const char* name)
877
967
 
878
968
  static const char* defaultRenderer (const tagEntryInfo *const tag,
879
969
  const char *value,
880
- vString * buffer)
970
+ vString * buffer,
971
+ bool *rejected)
881
972
  {
882
973
  return value;
883
974
  }