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
@@ -16,7 +16,8 @@
16
16
  #include "writer.h"
17
17
 
18
18
 
19
- static int writeXrefEntry (MIO * mio, const tagEntryInfo *const tag, void *data CTAGS_ATTR_UNUSED);
19
+ static int writeXrefEntry (tagWriter *writer CTAGS_ATTR_UNUSED,
20
+ MIO * mio, const tagEntryInfo *const tag);
20
21
 
21
22
  tagWriter xrefWriter = {
22
23
  .writeEntry = writeXrefEntry,
@@ -26,7 +27,8 @@ tagWriter xrefWriter = {
26
27
  .useStdoutByDefault = true,
27
28
  };
28
29
 
29
- static int writeXrefEntry (MIO * mio, const tagEntryInfo *const tag, void *data CTAGS_ATTR_UNUSED)
30
+ static int writeXrefEntry (tagWriter *writer CTAGS_ATTR_UNUSED,
31
+ MIO * mio, const tagEntryInfo *const tag)
30
32
  {
31
33
  int length;
32
34
  static fmtElement *fmt1;
@@ -8,21 +8,23 @@
8
8
  */
9
9
 
10
10
  #include "general.h"
11
+ #include "entry.h"
11
12
  #include "writer.h"
12
13
 
13
- extern tagWriter ctagsWriter;
14
+ extern tagWriter uCtagsWriter;
15
+ extern tagWriter eCtagsWriter;
14
16
  extern tagWriter etagsWriter;
15
17
  extern tagWriter xrefWriter;
16
18
  extern tagWriter jsonWriter;
17
19
 
18
20
  static tagWriter *writerTable [WRITER_COUNT] = {
19
- [WRITER_CTAGS] = &ctagsWriter,
21
+ [WRITER_U_CTAGS] = &uCtagsWriter,
22
+ [WRITER_E_CTAGS] = &eCtagsWriter,
20
23
  [WRITER_ETAGS] = &etagsWriter,
21
24
  [WRITER_XREF] = &xrefWriter,
22
25
  [WRITER_JSON] = &jsonWriter,
23
26
  };
24
27
 
25
- static void *writerData;
26
28
  static tagWriter *writer;
27
29
 
28
30
  extern void setTagWriter (writerType wtype)
@@ -39,23 +41,26 @@ extern bool outputFormatUsedStdoutByDefault (void)
39
41
  extern void writerSetup (MIO *mio)
40
42
  {
41
43
  if (writer->preWriteEntry)
42
- writerData = writer->preWriteEntry (mio);
44
+ writer->private = writer->preWriteEntry (writer, mio);
43
45
  else
44
- writerData = NULL;
46
+ writer->private = NULL;
45
47
  }
46
48
 
47
- extern void writerTeardown (MIO *mio, const char *filename)
49
+ extern bool writerTeardown (MIO *mio, const char *filename)
48
50
  {
49
51
  if (writer->postWriteEntry)
50
52
  {
51
- writer->postWriteEntry (mio, filename, writerData);
52
- writerData = NULL;
53
+ bool r;
54
+ r = writer->postWriteEntry (writer, mio, filename);
55
+ writer->private = NULL;
56
+ return r;
53
57
  }
58
+ return false;
54
59
  }
55
60
 
56
61
  extern int writerWriteTag (MIO * mio, const tagEntryInfo *const tag)
57
62
  {
58
- return writer->writeEntry (mio, tag, writerData);
63
+ return writer->writeEntry (writer, mio, tag);
59
64
  }
60
65
 
61
66
  extern int writerWritePtag (MIO * mio,
@@ -67,7 +72,29 @@ extern int writerWritePtag (MIO * mio,
67
72
  if (writer->writePtagEntry == NULL)
68
73
  return -1;
69
74
 
70
- return writer->writePtagEntry (mio, desc, fileName,
71
- pattern, parserName, writerData);
75
+ return writer->writePtagEntry (writer, mio, desc, fileName,
76
+ pattern, parserName);
72
77
 
73
78
  }
79
+
80
+ extern void writerBuildFqTagCache (tagEntryInfo *const tag)
81
+ {
82
+ if (writer->buildFqTagCache)
83
+ writer->buildFqTagCache (writer, tag);
84
+ }
85
+
86
+
87
+ extern bool ptagMakeCtagsOutputMode (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED)
88
+ {
89
+ const char *mode ="";
90
+
91
+ if (&uCtagsWriter == writer)
92
+ mode = "u-ctags";
93
+ else if (&eCtagsWriter == writer)
94
+ mode = "e-ctags";
95
+
96
+ return writePseudoTag (desc,
97
+ mode,
98
+ "u-ctags or e-ctags",
99
+ NULL);
100
+ }
@@ -20,7 +20,8 @@
20
20
 
21
21
  typedef enum eWriterType {
22
22
  WRITER_DEFAULT,
23
- WRITER_CTAGS = WRITER_DEFAULT,
23
+ WRITER_U_CTAGS = WRITER_DEFAULT,
24
+ WRITER_E_CTAGS,
24
25
  WRITER_ETAGS,
25
26
  WRITER_XREF,
26
27
  WRITER_JSON,
@@ -30,21 +31,29 @@ typedef enum eWriterType {
30
31
  struct sTagWriter;
31
32
  typedef struct sTagWriter tagWriter;
32
33
  struct sTagWriter {
33
- int (* writeEntry) (MIO * mio, const tagEntryInfo *const tag, void *data);
34
- int (* writePtagEntry) (MIO * mio, const ptagDesc *desc,
34
+ int (* writeEntry) (tagWriter *writer, MIO * mio, const tagEntryInfo *const tag);
35
+ int (* writePtagEntry) (tagWriter *writer, MIO * mio, const ptagDesc *desc,
35
36
  const char *const fileName,
36
37
  const char *const pattern,
37
- const char *const parserName, void *data);
38
- void * (* preWriteEntry) (MIO * mio);
39
- void (* postWriteEntry) (MIO * mio, const char* filename, void *data);
38
+ const char *const parserName);
39
+ void * (* preWriteEntry) (tagWriter *writer, MIO * mio);
40
+
41
+ /* Returning TRUE means the output file may be shrunk.
42
+ In such case the callee may do truncate output file. */
43
+ bool (* postWriteEntry) (tagWriter *writer, MIO * mio, const char* filename);
44
+ void (* buildFqTagCache) (tagWriter *writer, tagEntryInfo *const tag);
40
45
  bool useStdoutByDefault;
41
46
 
47
+ /* The value returned from preWriteEntry is stored `private' field.
48
+ The value must be released in postWriteEntry. */
49
+ void *private;
42
50
  writerType type;
51
+
43
52
  };
44
53
 
45
54
  extern void setTagWriter (writerType otype);
46
55
  extern void writerSetup (MIO *mio);
47
- extern void writerTeardown (MIO *mio, const char *filename);
56
+ extern bool writerTeardown (MIO *mio, const char *filename);
48
57
 
49
58
  int writerWriteTag (MIO * mio, const tagEntryInfo *const tag);
50
59
  int writerWritePtag (MIO * mio,
@@ -53,6 +62,8 @@ int writerWritePtag (MIO * mio,
53
62
  const char *const pattern,
54
63
  const char *const parserName);
55
64
 
65
+ extern void writerBuildFqTagCache (tagEntryInfo *const tag);
66
+
56
67
  extern bool outputFormatUsedStdoutByDefault (void);
57
68
 
58
69
  extern int makePatternStringCommon (const tagEntryInfo *const tag,
@@ -64,5 +75,6 @@ extern void truncateTagLine (char *const line, const char *const token,
64
75
  extern void abort_if_ferror(MIO *const fp);
65
76
 
66
77
  extern bool ptagMakeJsonOutputVersion (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED);
78
+ extern bool ptagMakeCtagsOutputMode (ptagDesc *desc, void *data CTAGS_ATTR_UNUSED);
67
79
 
68
80
  #endif
@@ -14,7 +14,7 @@ module Ctags
14
14
  args = [
15
15
  '--options=NONE',
16
16
  "--options=#{CONFIG}",
17
- '--fields=+KlnzsStimfa',
17
+ '--fields=*',
18
18
  '--interactive'
19
19
  ]
20
20
 
@@ -1,3 +1,3 @@
1
1
  module Ctags
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ctags.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-29 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: posix-spawn
@@ -175,6 +175,7 @@ files:
175
175
  - ext/vendor/ctags/Tmain/invalid-encoding-option.d/stderr-expected.txt
176
176
  - ext/vendor/ctags/Tmain/invalid-encoding-option.d/stdout-expected.txt
177
177
  - ext/vendor/ctags/Tmain/json-output-format.d/input.c
178
+ - ext/vendor/ctags/Tmain/json-output-format.d/input.go
178
179
  - ext/vendor/ctags/Tmain/json-output-format.d/input.py
179
180
  - ext/vendor/ctags/Tmain/json-output-format.d/run.sh
180
181
  - ext/vendor/ctags/Tmain/json-output-format.d/stdout-expected.txt
@@ -372,6 +373,8 @@ files:
372
373
  - ext/vendor/ctags/Tmain/output-format-option.d/input.c
373
374
  - ext/vendor/ctags/Tmain/output-format-option.d/run.sh
374
375
  - ext/vendor/ctags/Tmain/output-format-option.d/stdout-expected.txt
376
+ - ext/vendor/ctags/Tmain/output-input-field-with-no-escape.d/run.sh
377
+ - ext/vendor/ctags/Tmain/output-input-field-with-no-escape.d/stdout-expected.txt
375
378
  - ext/vendor/ctags/Tmain/pattern-length-limit.d/input.java
376
379
  - ext/vendor/ctags/Tmain/pattern-length-limit.d/run.sh
377
380
  - ext/vendor/ctags/Tmain/pattern-length-limit.d/stdout-expected.txt
@@ -1486,6 +1489,9 @@ files:
1486
1489
  - ext/vendor/ctags/Units/parser-php.r/php-classes.d/args.ctags
1487
1490
  - ext/vendor/ctags/Units/parser-php.r/php-classes.d/expected.tags
1488
1491
  - ext/vendor/ctags/Units/parser-php.r/php-classes.d/input.php
1492
+ - ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags-no-esc.d/args.ctags
1493
+ - ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags-no-esc.d/expected.tags
1494
+ - ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags-no-esc.d/input.php
1489
1495
  - ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags.d/args.ctags
1490
1496
  - ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags.d/expected.tags
1491
1497
  - ext/vendor/ctags/Units/parser-php.r/php-full-qualified-tags.d/input.php
@@ -2224,6 +2230,7 @@ files:
2224
2230
  - ext/vendor/ctags/docs/guessing.rst
2225
2231
  - ext/vendor/ctags/docs/index.rst
2226
2232
  - ext/vendor/ctags/docs/input-text-stream.svg
2233
+ - ext/vendor/ctags/docs/interactive-mode.rst
2227
2234
  - ext/vendor/ctags/docs/internal.rst
2228
2235
  - ext/vendor/ctags/docs/news.rst
2229
2236
  - ext/vendor/ctags/docs/noise.rst
@@ -2233,6 +2240,7 @@ files:
2233
2240
  - ext/vendor/ctags/docs/output-format.rst
2234
2241
  - ext/vendor/ctags/docs/output-json.rst
2235
2242
  - ext/vendor/ctags/docs/output-tag-stream.svg
2243
+ - ext/vendor/ctags/docs/output-xref.rst
2236
2244
  - ext/vendor/ctags/docs/parser-asm.rst
2237
2245
  - ext/vendor/ctags/docs/parser-cxx.rst
2238
2246
  - ext/vendor/ctags/docs/parser-html.rst