ctags.rb 1.0.0 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (323) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +2 -1
  3. data/README.md +49 -0
  4. data/Rakefile +19 -0
  5. data/bench.rb +28 -0
  6. data/ctags.rb.gemspec +1 -1
  7. data/ext/.gitignore +1 -1
  8. data/ext/extconf.rb +30 -6
  9. data/ext/vendor/exuberant-ctags/entry.c +70 -1
  10. data/ext/vendor/exuberant-ctags/main.c +68 -7
  11. data/ext/vendor/exuberant-ctags/options.c +12 -12
  12. data/ext/vendor/exuberant-ctags/options.h +1 -1
  13. data/ext/vendor/exuberant-ctags/parse.c +2 -2
  14. data/ext/vendor/exuberant-ctags/read.c +8 -3
  15. data/ext/vendor/exuberant-ctags/read.h +4 -1
  16. data/ext/vendor/exuberant-ctags/routines.c +31 -8
  17. data/ext/vendor/exuberant-ctags/ruby.c +62 -7
  18. data/ext/vendor/fmemopen/README.md +49 -0
  19. data/ext/vendor/fmemopen/fmemopen.c +92 -0
  20. data/ext/vendor/fmemopen/fmemopen.h +52 -0
  21. data/ext/vendor/jansson-2.5/CHANGES +554 -0
  22. data/ext/vendor/jansson-2.5/LICENSE +19 -0
  23. data/ext/vendor/jansson-2.5/Makefile.am +15 -0
  24. data/ext/vendor/jansson-2.5/Makefile.in +825 -0
  25. data/ext/vendor/jansson-2.5/README.rst +63 -0
  26. data/ext/vendor/jansson-2.5/aclocal.m4 +9674 -0
  27. data/ext/vendor/jansson-2.5/config.guess +1530 -0
  28. data/ext/vendor/jansson-2.5/config.h.in +84 -0
  29. data/ext/vendor/jansson-2.5/config.sub +1782 -0
  30. data/ext/vendor/jansson-2.5/configure +13931 -0
  31. data/ext/vendor/jansson-2.5/configure.ac +57 -0
  32. data/ext/vendor/jansson-2.5/depcomp +708 -0
  33. data/ext/vendor/jansson-2.5/doc/Makefile.am +20 -0
  34. data/ext/vendor/jansson-2.5/doc/Makefile.in +401 -0
  35. data/ext/vendor/jansson-2.5/doc/README +5 -0
  36. data/ext/vendor/jansson-2.5/doc/apiref.rst +1487 -0
  37. data/ext/vendor/jansson-2.5/doc/changes.rst +5 -0
  38. data/ext/vendor/jansson-2.5/doc/conf.py +217 -0
  39. data/ext/vendor/jansson-2.5/doc/conformance.rst +114 -0
  40. data/ext/vendor/jansson-2.5/doc/ext/refcounting.py +59 -0
  41. data/ext/vendor/jansson-2.5/doc/gettingstarted.rst +237 -0
  42. data/ext/vendor/jansson-2.5/doc/github_commits.c +192 -0
  43. data/ext/vendor/jansson-2.5/doc/index.rst +53 -0
  44. data/ext/vendor/jansson-2.5/doc/portability.rst +52 -0
  45. data/ext/vendor/jansson-2.5/doc/tutorial.rst +286 -0
  46. data/ext/vendor/jansson-2.5/doc/upgrading.rst +76 -0
  47. data/ext/vendor/jansson-2.5/install-sh +527 -0
  48. data/ext/vendor/jansson-2.5/jansson.pc.in +10 -0
  49. data/ext/vendor/jansson-2.5/ltmain.sh +9661 -0
  50. data/ext/vendor/jansson-2.5/missing +331 -0
  51. data/ext/vendor/jansson-2.5/src/Makefile.am +24 -0
  52. data/ext/vendor/jansson-2.5/src/Makefile.in +613 -0
  53. data/ext/vendor/jansson-2.5/src/dump.c +456 -0
  54. data/ext/vendor/jansson-2.5/src/error.c +63 -0
  55. data/ext/vendor/jansson-2.5/src/hashtable.c +360 -0
  56. data/ext/vendor/jansson-2.5/src/hashtable.h +180 -0
  57. data/ext/vendor/jansson-2.5/src/jansson.def +63 -0
  58. data/ext/vendor/jansson-2.5/src/jansson.h +281 -0
  59. data/ext/vendor/jansson-2.5/src/jansson_config.h +39 -0
  60. data/ext/vendor/jansson-2.5/src/jansson_config.h.in +39 -0
  61. data/ext/vendor/jansson-2.5/src/jansson_private.h +93 -0
  62. data/ext/vendor/jansson-2.5/src/load.c +1077 -0
  63. data/ext/vendor/jansson-2.5/src/memory.c +56 -0
  64. data/ext/vendor/jansson-2.5/src/pack_unpack.c +762 -0
  65. data/ext/vendor/jansson-2.5/src/strbuffer.c +116 -0
  66. data/ext/vendor/jansson-2.5/src/strbuffer.h +33 -0
  67. data/ext/vendor/jansson-2.5/src/strconv.c +134 -0
  68. data/ext/vendor/jansson-2.5/src/utf.c +190 -0
  69. data/ext/vendor/jansson-2.5/src/utf.h +39 -0
  70. data/ext/vendor/jansson-2.5/src/value.c +950 -0
  71. data/ext/vendor/jansson-2.5/test/Makefile.am +10 -0
  72. data/ext/vendor/jansson-2.5/test/Makefile.in +684 -0
  73. data/ext/vendor/jansson-2.5/test/bin/Makefile.am +5 -0
  74. data/ext/vendor/jansson-2.5/test/bin/Makefile.in +498 -0
  75. data/ext/vendor/jansson-2.5/test/bin/json_process.c +349 -0
  76. data/ext/vendor/jansson-2.5/test/run-suites +50 -0
  77. data/ext/vendor/jansson-2.5/test/scripts/run-tests.sh +100 -0
  78. data/ext/vendor/jansson-2.5/test/scripts/valgrind.sh +35 -0
  79. data/ext/vendor/jansson-2.5/test/suites/Makefile.am +2 -0
  80. data/ext/vendor/jansson-2.5/test/suites/Makefile.in +580 -0
  81. data/ext/vendor/jansson-2.5/test/suites/api/Makefile.am +34 -0
  82. data/ext/vendor/jansson-2.5/test/suites/api/Makefile.in +632 -0
  83. data/ext/vendor/jansson-2.5/test/suites/api/check-exports +23 -0
  84. data/ext/vendor/jansson-2.5/test/suites/api/run +36 -0
  85. data/ext/vendor/jansson-2.5/test/suites/api/test_array.c +432 -0
  86. data/ext/vendor/jansson-2.5/test/suites/api/test_copy.c +318 -0
  87. data/ext/vendor/jansson-2.5/test/suites/api/test_dump.c +190 -0
  88. data/ext/vendor/jansson-2.5/test/suites/api/test_dump_callback.c +81 -0
  89. data/ext/vendor/jansson-2.5/test/suites/api/test_equal.c +189 -0
  90. data/ext/vendor/jansson-2.5/test/suites/api/test_load.c +166 -0
  91. data/ext/vendor/jansson-2.5/test/suites/api/test_load_callback.c +75 -0
  92. data/ext/vendor/jansson-2.5/test/suites/api/test_loadb.c +36 -0
  93. data/ext/vendor/jansson-2.5/test/suites/api/test_memory_funcs.c +82 -0
  94. data/ext/vendor/jansson-2.5/test/suites/api/test_number.c +73 -0
  95. data/ext/vendor/jansson-2.5/test/suites/api/test_object.c +511 -0
  96. data/ext/vendor/jansson-2.5/test/suites/api/test_pack.c +283 -0
  97. data/ext/vendor/jansson-2.5/test/suites/api/test_simple.c +199 -0
  98. data/ext/vendor/jansson-2.5/test/suites/api/test_unpack.c +373 -0
  99. data/ext/vendor/jansson-2.5/test/suites/api/util.h +74 -0
  100. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/encoded-surrogate-half/error +2 -0
  101. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/encoded-surrogate-half/input +1 -0
  102. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error +2 -0
  103. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input +1 -0
  104. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-array/error +2 -0
  105. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-array/input +1 -0
  106. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error +2 -0
  107. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input +1 -0
  108. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-escape/error +2 -0
  109. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-escape/input +1 -0
  110. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error +2 -0
  111. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input +1 -0
  112. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error +2 -0
  113. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input +1 -0
  114. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-int/error +2 -0
  115. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-int/input +1 -0
  116. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error +2 -0
  117. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input +1 -0
  118. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-string/error +2 -0
  119. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/invalid-utf-8-in-string/input +1 -0
  120. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-invalid-utf-8/error +2 -0
  121. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-invalid-utf-8/input +1 -0
  122. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error +2 -0
  123. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input +1 -0
  124. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/not-in-unicode-range/error +2 -0
  125. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/not-in-unicode-range/input +1 -0
  126. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-3-byte-encoding/error +2 -0
  127. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-3-byte-encoding/input +1 -0
  128. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-4-byte-encoding/error +2 -0
  129. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-4-byte-encoding/input +1 -0
  130. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-ascii-encoding/error +2 -0
  131. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/overlong-ascii-encoding/input +1 -0
  132. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/restricted-utf-8/error +2 -0
  133. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/restricted-utf-8/input +1 -0
  134. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/run +27 -0
  135. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/truncated-utf-8/error +2 -0
  136. data/ext/vendor/jansson-2.5/test/suites/invalid-unicode/truncated-utf-8/input +1 -0
  137. data/ext/vendor/jansson-2.5/test/suites/invalid/apostrophe/error +2 -0
  138. data/ext/vendor/jansson-2.5/test/suites/invalid/apostrophe/input +1 -0
  139. data/ext/vendor/jansson-2.5/test/suites/invalid/ascii-unicode-identifier/error +2 -0
  140. data/ext/vendor/jansson-2.5/test/suites/invalid/ascii-unicode-identifier/input +1 -0
  141. data/ext/vendor/jansson-2.5/test/suites/invalid/brace-comma/error +2 -0
  142. data/ext/vendor/jansson-2.5/test/suites/invalid/brace-comma/input +1 -0
  143. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-comma/error +2 -0
  144. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-comma/input +1 -0
  145. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-one-comma/error.normal +2 -0
  146. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-one-comma/error.strip +2 -0
  147. data/ext/vendor/jansson-2.5/test/suites/invalid/bracket-one-comma/input +1 -0
  148. data/ext/vendor/jansson-2.5/test/suites/invalid/empty/error +2 -0
  149. data/ext/vendor/jansson-2.5/test/suites/invalid/empty/input +0 -0
  150. data/ext/vendor/jansson-2.5/test/suites/invalid/escaped-null-byte-in-string/error +2 -0
  151. data/ext/vendor/jansson-2.5/test/suites/invalid/escaped-null-byte-in-string/input +1 -0
  152. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-array/error +2 -0
  153. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-array/input +1 -0
  154. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-multiline-array/error +2 -0
  155. data/ext/vendor/jansson-2.5/test/suites/invalid/extra-comma-in-multiline-array/input +6 -0
  156. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-after-newline/error +2 -0
  157. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-after-newline/input +2 -0
  158. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-at-the-end/error +2 -0
  159. data/ext/vendor/jansson-2.5/test/suites/invalid/garbage-at-the-end/input +1 -0
  160. data/ext/vendor/jansson-2.5/test/suites/invalid/integer-starting-with-zero/error +2 -0
  161. data/ext/vendor/jansson-2.5/test/suites/invalid/integer-starting-with-zero/input +1 -0
  162. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-escape/error +2 -0
  163. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-escape/input +1 -0
  164. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-identifier/error +2 -0
  165. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-identifier/input +1 -0
  166. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-integer/error +2 -0
  167. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-integer/input +1 -0
  168. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-real/error +2 -0
  169. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-negative-real/input +1 -0
  170. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-second-surrogate/error +2 -0
  171. data/ext/vendor/jansson-2.5/test/suites/invalid/invalid-second-surrogate/input +1 -0
  172. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-brace/error.normal +2 -0
  173. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-brace/error.strip +2 -0
  174. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-brace/input +1 -0
  175. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-bracket/error.normal +2 -0
  176. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-bracket/error.strip +2 -0
  177. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-open-bracket/input +1 -0
  178. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-second-surrogate/error +2 -0
  179. data/ext/vendor/jansson-2.5/test/suites/invalid/lone-second-surrogate/input +1 -0
  180. data/ext/vendor/jansson-2.5/test/suites/invalid/minus-sign-without-number/error +2 -0
  181. data/ext/vendor/jansson-2.5/test/suites/invalid/minus-sign-without-number/input +1 -0
  182. data/ext/vendor/jansson-2.5/test/suites/invalid/negative-integer-starting-with-zero/error +2 -0
  183. data/ext/vendor/jansson-2.5/test/suites/invalid/negative-integer-starting-with-zero/input +1 -0
  184. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-in-string/error +2 -0
  185. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-in-string/input +0 -0
  186. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-in-string/nostrip +2 -0
  187. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-outside-string/error +2 -0
  188. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-outside-string/input +0 -0
  189. data/ext/vendor/jansson-2.5/test/suites/invalid/null-byte-outside-string/nostrip +2 -0
  190. data/ext/vendor/jansson-2.5/test/suites/invalid/null/error +2 -0
  191. data/ext/vendor/jansson-2.5/test/suites/invalid/null/input +1 -0
  192. data/ext/vendor/jansson-2.5/test/suites/invalid/object-apostrophes/error +2 -0
  193. data/ext/vendor/jansson-2.5/test/suites/invalid/object-apostrophes/input +1 -0
  194. data/ext/vendor/jansson-2.5/test/suites/invalid/object-garbage-at-end/error +2 -0
  195. data/ext/vendor/jansson-2.5/test/suites/invalid/object-garbage-at-end/input +1 -0
  196. data/ext/vendor/jansson-2.5/test/suites/invalid/object-in-unterminated-array/error.normal +2 -0
  197. data/ext/vendor/jansson-2.5/test/suites/invalid/object-in-unterminated-array/error.strip +2 -0
  198. data/ext/vendor/jansson-2.5/test/suites/invalid/object-in-unterminated-array/input +1 -0
  199. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-colon/error.normal +2 -0
  200. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-colon/error.strip +2 -0
  201. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-colon/input +1 -0
  202. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-value/error.normal +2 -0
  203. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-value/error.strip +2 -0
  204. data/ext/vendor/jansson-2.5/test/suites/invalid/object-no-value/input +1 -0
  205. data/ext/vendor/jansson-2.5/test/suites/invalid/object-unterminated-value/error.normal +2 -0
  206. data/ext/vendor/jansson-2.5/test/suites/invalid/object-unterminated-value/error.strip +2 -0
  207. data/ext/vendor/jansson-2.5/test/suites/invalid/object-unterminated-value/input +1 -0
  208. data/ext/vendor/jansson-2.5/test/suites/invalid/real-garbage-after-e/error +2 -0
  209. data/ext/vendor/jansson-2.5/test/suites/invalid/real-garbage-after-e/input +1 -0
  210. data/ext/vendor/jansson-2.5/test/suites/invalid/real-negative-overflow/error +2 -0
  211. data/ext/vendor/jansson-2.5/test/suites/invalid/real-negative-overflow/input +1 -0
  212. data/ext/vendor/jansson-2.5/test/suites/invalid/real-positive-overflow/error +2 -0
  213. data/ext/vendor/jansson-2.5/test/suites/invalid/real-positive-overflow/input +1 -0
  214. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-e/error +2 -0
  215. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-e/input +1 -0
  216. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-point/error +2 -0
  217. data/ext/vendor/jansson-2.5/test/suites/invalid/real-truncated-at-point/input +1 -0
  218. data/ext/vendor/jansson-2.5/test/suites/invalid/run +57 -0
  219. data/ext/vendor/jansson-2.5/test/suites/invalid/tab-character-in-string/error +2 -0
  220. data/ext/vendor/jansson-2.5/test/suites/invalid/tab-character-in-string/input +1 -0
  221. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-negative-integer/error +2 -0
  222. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-negative-integer/input +1 -0
  223. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-positive-integer/error +2 -0
  224. data/ext/vendor/jansson-2.5/test/suites/invalid/too-big-positive-integer/input +1 -0
  225. data/ext/vendor/jansson-2.5/test/suites/invalid/truncated-unicode-surrogate/error +2 -0
  226. data/ext/vendor/jansson-2.5/test/suites/invalid/truncated-unicode-surrogate/input +1 -0
  227. data/ext/vendor/jansson-2.5/test/suites/invalid/unicode-identifier/error +2 -0
  228. data/ext/vendor/jansson-2.5/test/suites/invalid/unicode-identifier/input +1 -0
  229. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array-and-object/error.normal +2 -0
  230. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array-and-object/error.strip +2 -0
  231. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array-and-object/input +1 -0
  232. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array/error.normal +2 -0
  233. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array/error.strip +2 -0
  234. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-array/input +1 -0
  235. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-empty-key/error.normal +2 -0
  236. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-empty-key/error.strip +2 -0
  237. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-empty-key/input +1 -0
  238. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-key/error.normal +2 -0
  239. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-key/error.strip +2 -0
  240. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-key/input +1 -0
  241. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-object-and-array/error +2 -0
  242. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-object-and-array/input +1 -0
  243. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-string/error.normal +2 -0
  244. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-string/error.strip +2 -0
  245. data/ext/vendor/jansson-2.5/test/suites/invalid/unterminated-string/input +1 -0
  246. data/ext/vendor/jansson-2.5/test/suites/valid/complex-array/env +1 -0
  247. data/ext/vendor/jansson-2.5/test/suites/valid/complex-array/input +5 -0
  248. data/ext/vendor/jansson-2.5/test/suites/valid/complex-array/output +1 -0
  249. data/ext/vendor/jansson-2.5/test/suites/valid/empty-array/input +1 -0
  250. data/ext/vendor/jansson-2.5/test/suites/valid/empty-array/output +1 -0
  251. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object-in-array/input +1 -0
  252. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object-in-array/output +1 -0
  253. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object/input +1 -0
  254. data/ext/vendor/jansson-2.5/test/suites/valid/empty-object/output +1 -0
  255. data/ext/vendor/jansson-2.5/test/suites/valid/empty-string/input +1 -0
  256. data/ext/vendor/jansson-2.5/test/suites/valid/empty-string/output +1 -0
  257. data/ext/vendor/jansson-2.5/test/suites/valid/escaped-utf-control-char/input +1 -0
  258. data/ext/vendor/jansson-2.5/test/suites/valid/escaped-utf-control-char/output +1 -0
  259. data/ext/vendor/jansson-2.5/test/suites/valid/false/input +1 -0
  260. data/ext/vendor/jansson-2.5/test/suites/valid/false/output +1 -0
  261. data/ext/vendor/jansson-2.5/test/suites/valid/negative-int/input +1 -0
  262. data/ext/vendor/jansson-2.5/test/suites/valid/negative-int/output +1 -0
  263. data/ext/vendor/jansson-2.5/test/suites/valid/negative-one/input +1 -0
  264. data/ext/vendor/jansson-2.5/test/suites/valid/negative-one/output +1 -0
  265. data/ext/vendor/jansson-2.5/test/suites/valid/negative-zero/input +1 -0
  266. data/ext/vendor/jansson-2.5/test/suites/valid/negative-zero/output +1 -0
  267. data/ext/vendor/jansson-2.5/test/suites/valid/null/input +1 -0
  268. data/ext/vendor/jansson-2.5/test/suites/valid/null/output +1 -0
  269. data/ext/vendor/jansson-2.5/test/suites/valid/one-byte-utf-8/input +1 -0
  270. data/ext/vendor/jansson-2.5/test/suites/valid/one-byte-utf-8/output +1 -0
  271. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-negative-exponent/input +1 -0
  272. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-negative-exponent/output +1 -0
  273. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-positive-exponent/input +1 -0
  274. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e-positive-exponent/output +1 -0
  275. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e/input +1 -0
  276. data/ext/vendor/jansson-2.5/test/suites/valid/real-capital-e/output +1 -0
  277. data/ext/vendor/jansson-2.5/test/suites/valid/real-exponent/input +1 -0
  278. data/ext/vendor/jansson-2.5/test/suites/valid/real-exponent/output +1 -0
  279. data/ext/vendor/jansson-2.5/test/suites/valid/real-fraction-exponent/input +1 -0
  280. data/ext/vendor/jansson-2.5/test/suites/valid/real-fraction-exponent/output +1 -0
  281. data/ext/vendor/jansson-2.5/test/suites/valid/real-negative-exponent/input +1 -0
  282. data/ext/vendor/jansson-2.5/test/suites/valid/real-negative-exponent/output +1 -0
  283. data/ext/vendor/jansson-2.5/test/suites/valid/real-positive-exponent/input +1 -0
  284. data/ext/vendor/jansson-2.5/test/suites/valid/real-positive-exponent/output +1 -0
  285. data/ext/vendor/jansson-2.5/test/suites/valid/real-underflow/input +1 -0
  286. data/ext/vendor/jansson-2.5/test/suites/valid/real-underflow/output +1 -0
  287. data/ext/vendor/jansson-2.5/test/suites/valid/run +56 -0
  288. data/ext/vendor/jansson-2.5/test/suites/valid/short-string/input +1 -0
  289. data/ext/vendor/jansson-2.5/test/suites/valid/short-string/output +1 -0
  290. data/ext/vendor/jansson-2.5/test/suites/valid/simple-ascii-string/input +1 -0
  291. data/ext/vendor/jansson-2.5/test/suites/valid/simple-ascii-string/output +1 -0
  292. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-0/input +1 -0
  293. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-0/output +1 -0
  294. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-1/input +1 -0
  295. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-1/output +1 -0
  296. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-123/input +1 -0
  297. data/ext/vendor/jansson-2.5/test/suites/valid/simple-int-123/output +1 -0
  298. data/ext/vendor/jansson-2.5/test/suites/valid/simple-object/input +1 -0
  299. data/ext/vendor/jansson-2.5/test/suites/valid/simple-object/output +1 -0
  300. data/ext/vendor/jansson-2.5/test/suites/valid/simple-real/input +1 -0
  301. data/ext/vendor/jansson-2.5/test/suites/valid/simple-real/output +1 -0
  302. data/ext/vendor/jansson-2.5/test/suites/valid/string-escapes/input +1 -0
  303. data/ext/vendor/jansson-2.5/test/suites/valid/string-escapes/output +1 -0
  304. data/ext/vendor/jansson-2.5/test/suites/valid/three-byte-utf-8/input +1 -0
  305. data/ext/vendor/jansson-2.5/test/suites/valid/three-byte-utf-8/output +1 -0
  306. data/ext/vendor/jansson-2.5/test/suites/valid/true/input +1 -0
  307. data/ext/vendor/jansson-2.5/test/suites/valid/true/output +1 -0
  308. data/ext/vendor/jansson-2.5/test/suites/valid/two-byte-utf-8/input +1 -0
  309. data/ext/vendor/jansson-2.5/test/suites/valid/two-byte-utf-8/output +1 -0
  310. data/ext/vendor/jansson-2.5/test/suites/valid/utf-8-string/input +1 -0
  311. data/ext/vendor/jansson-2.5/test/suites/valid/utf-8-string/output +1 -0
  312. data/ext/vendor/jansson-2.5/test/suites/valid/utf-surrogate-four-byte-encoding/input +1 -0
  313. data/ext/vendor/jansson-2.5/test/suites/valid/utf-surrogate-four-byte-encoding/output +1 -0
  314. data/ext/vendor/jansson-2.5/win32/jansson_config.h +39 -0
  315. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.sln +20 -0
  316. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.vcxproj +108 -0
  317. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.vcxproj.filters +69 -0
  318. data/ext/vendor/jansson-2.5/win32/vs2010/jansson.vcxproj.user +3 -0
  319. data/lib/ctags.cnf +2 -0
  320. data/lib/ctags/exuberant.rb +129 -17
  321. data/lib/ctags/version.rb +1 -1
  322. data/test/test_ctags.rb +14 -7
  323. metadata +350 -69
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjY3ODkyNTBlOWM4ZjMwOTY5ZmQyMmViNTY0NDYyZWJhNDQxYTI1OQ==
5
+ data.tar.gz: !binary |-
6
+ YTk4OGZiZWU2NzY5MDdjOWQ5YWY4YzljM2M4MTc5ZmIwNzBlOTAzNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YzliMGVjZjIyNmY4YzBhZDVmY2I4ZDIzMmRmMmM5YTdlZjlkNDM2NzNmMGYx
10
+ Nzk3MTFlYWM5MmVkYTI3MmZlYmUzOTZlNzQ4ZjYxYzgzY2FiMDYwYTllYzI0
11
+ MjZmOTg3ZTZiZjFmNWY5ODI3M2U1MDU1YTAwNjRlZjA0OGM5Njk=
12
+ data.tar.gz: !binary |-
13
+ NmU4ZjBjZTUzODhiZGM0MDM0MjU5ZTQ2ODBjYTM4YmIxNWVlNjhjM2Q4OTg2
14
+ Y2E1N2I5MGJlY2QzZDM4MzkwMmVhZDUxNGI2Y2M0MGFhZjE0OWM5OThjNzZh
15
+ OWJmMzE3ZGM0MzM5ZTNkNjdiMWM3YzlhNDlmMzc4MmQzNGQ5YTI=
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
  gemspec
3
+ gem 'rake'
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ ## ctags.rb
2
+
3
+ simple ruby wrapper for exuberant-ctags
4
+
5
+ ### usage
6
+
7
+ ``` ruby
8
+ >> pp Ctags.tags_for_file('/usr/lib/ruby/1.8/timeout.rb')
9
+ [
10
+ {:path=>
11
+ "/usr/lib/ruby/1.8/timeout.rb",
12
+ :kind=>"module",
13
+ :language=>"Ruby",
14
+ :pattern=>"module Timeout",
15
+ :name=>"Timeout",
16
+ :line=>30},
17
+ {:path=>
18
+ "/usr/lib/ruby/1.8/timeout.rb",
19
+ :kind=>"class",
20
+ :class=>"Timeout",
21
+ :language=>"Ruby",
22
+ :pattern=>"class Error < Interrupt",
23
+ :name=>"Error",
24
+ :line=>35},
25
+ {:path=>
26
+ "/usr/lib/ruby/1.8/timeout.rb",
27
+ :kind=>"class",
28
+ :class=>"Timeout",
29
+ :language=>"Ruby",
30
+ :pattern=>"class ExitException < ::Exception # :nodoc:",
31
+ :name=>"ExitException",
32
+ :line=>37},
33
+ {:path=>
34
+ "/usr/lib/ruby/1.8/timeout.rb",
35
+ :kind=>"method",
36
+ :class=>"Timeout",
37
+ :language=>"Ruby",
38
+ :pattern=>"def timeout(sec, klass = nil)",
39
+ :name=>"timeout",
40
+ :line=>52},
41
+ {:path=>
42
+ "/usr/lib/ruby/1.8/timeout.rb",
43
+ :kind=>"method",
44
+ :language=>"Ruby",
45
+ :pattern=>"def timeout(n, e = nil, &block) # :nodoc:",
46
+ :name=>"timeout",
47
+ :line=>100}
48
+ ]
49
+ ```
data/Rakefile CHANGED
@@ -12,6 +12,16 @@ require 'rubygems/package_task'
12
12
  Gem::PackageTask.new(GEMSPEC) do |pkg|
13
13
  end
14
14
 
15
+ # ==========================================================
16
+ # Compiling
17
+ # ==========================================================
18
+
19
+ task :build do
20
+ Dir.chdir('ext') do
21
+ ruby 'extconf.rb'
22
+ end
23
+ end
24
+
15
25
  # ==========================================================
16
26
  # Testing
17
27
  # ==========================================================
@@ -21,3 +31,12 @@ Rake::TestTask.new 'test' do |t|
21
31
  t.test_files = FileList['test/test_*.rb']
22
32
  t.ruby_opts = ['-rubygems']
23
33
  end
34
+ task :test => :build
35
+
36
+ # ==========================================================
37
+ # Benchmarks
38
+ # ==========================================================
39
+
40
+ task :bench => :build do
41
+ ruby 'bench.rb'
42
+ end
data/bench.rb ADDED
@@ -0,0 +1,28 @@
1
+ require 'benchmark'
2
+ require 'rubygems'
3
+ $:.unshift File.expand_path('../lib', __FILE__)
4
+ require 'ctags'
5
+
6
+ Benchmark.bmbm(30) do |b|
7
+ [
8
+ ['small', __FILE__],
9
+ ['medium', Gem.find_files('mkmf.rb')[0]],
10
+ ['big', Gem.find_files('tk.rb')[0]]
11
+ ].each do |type, file|
12
+ b.report("tags for #{type} file") do
13
+ Ctags.tags_for_file(file)
14
+ end
15
+
16
+ b.report("tags for #{type} file x500") do
17
+ 500.times{ Ctags.tags_for_file(file) }
18
+ end
19
+
20
+ b.report("tags for #{type} blob") do
21
+ Ctags.tags_for_file(file, File.read(file))
22
+ end
23
+
24
+ b.report("tags for #{type} blob x500") do
25
+ 500.times{ Ctags.tags_for_file(file, File.read(file)) }
26
+ end
27
+ end
28
+ end
data/ctags.rb.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.email = ['aman@tmm1.net']
15
15
 
16
16
  s.add_dependency 'posix-spawn', '~> 0.3.6'
17
- s.add_development_dependency 'rake-compiler', '~> 0.7.6'
17
+ s.add_dependency 'yajl-ruby'
18
18
 
19
19
  s.extensions = ['ext/extconf.rb']
20
20
  s.require_paths = ['lib']
data/ext/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
1
  /Makefile
2
2
  /dst
3
-
3
+ /mkmf.log
data/ext/extconf.rb CHANGED
@@ -1,13 +1,37 @@
1
1
  require 'mkmf'
2
2
  require 'fileutils'
3
3
 
4
- HERE = File.expand_path('../', __FILE__)
5
- FileUtils.mkdir_p "#{HERE}/dst"
4
+ def sys(cmd)
5
+ puts " -- #{cmd}"
6
+ unless ret = xsystem(cmd)
7
+ puts " ==> tail -10 #{CWD}/mkmf.log"
8
+ puts File.readlines("#{CWD}/mkmf.log").last(10).join("")
9
+ raise "#{cmd} failed"
10
+ end
11
+ ret
12
+ end
13
+
14
+ CWD = File.expand_path('../', __FILE__)
15
+ FileUtils.mkdir_p "#{CWD}/dst"
16
+ xsystem('pwd') # to create mkmf.log before the chdir
17
+
18
+ Dir.chdir("#{CWD}/vendor/jansson-2.5") do
19
+ sys "./configure --prefix=#{CWD}/dst --disable-shared" unless File.exists?('config.h')
20
+ sys "make install"
21
+ end
22
+
23
+ ENV['CFLAGS'] = "-ggdb -I#{CWD}/dst/include"
24
+ ENV['LDFLAGS'] = "-L#{CWD}/dst/lib"
25
+ ENV['LIBS'] = "-ljansson"
26
+
27
+ if !have_func('fmemopen','stdio.h') && have_func('funopen','stdio.h')
28
+ ENV['CFLAGS'] += " -DHAVE_FMEMOPEN_C"
29
+ FileUtils.cp "#{CWD}/vendor/fmemopen/fmemopen.c", "#{CWD}/dst/include"
30
+ end
6
31
 
7
- Dir.chdir("#{HERE}/vendor/exuberant-ctags") do
8
- system "./configure --prefix=#{HERE}/dst"
9
- system "make"
10
- system "make install"
32
+ Dir.chdir("#{CWD}/vendor/exuberant-ctags") do
33
+ sys "./configure --prefix=#{CWD}/dst" unless File.exists?('config.h')
34
+ sys "make install"
11
35
  end
12
36
 
13
37
  File.open('Makefile', 'w') do |f|
@@ -38,6 +38,8 @@
38
38
  # include <io.h>
39
39
  #endif
40
40
 
41
+ #include <jansson.h>
42
+
41
43
  #include "debug.h"
42
44
  #include "ctags.h"
43
45
  #include "entry.h"
@@ -806,6 +808,69 @@ static int writeCtagsEntry (const tagEntryInfo *const tag)
806
808
  return length;
807
809
  }
808
810
 
811
+ static int writeJsonEntry (const tagEntryInfo *const tag)
812
+ {
813
+ char *const line = readSourceLine (TagFile.vLine, tag->filePosition, 0);
814
+ json_t *response = json_pack ("{ss ss si ss ss ss ss}",
815
+ "_type", "tag",
816
+ "name", tag->name,
817
+ "line", tag->lineNumber,
818
+ "path", tag->sourceFileName,
819
+ "kind", tag->kindName,
820
+ "language", tag->language,
821
+ "pattern", line
822
+ );
823
+
824
+ if (Option.extensionFields.scope &&
825
+ tag->extensionFields.scope [0] != NULL &&
826
+ tag->extensionFields.scope [1] != NULL)
827
+ json_object_set_new (response,
828
+ tag->extensionFields.scope [0],
829
+ json_string (tag->extensionFields.scope [1]));
830
+
831
+ if (Option.extensionFields.typeRef &&
832
+ tag->extensionFields.typeRef [0] != NULL &&
833
+ tag->extensionFields.typeRef [1] != NULL) {
834
+ char *val;
835
+ asprintf(&val, "%s:%s",
836
+ tag->extensionFields.typeRef [0],
837
+ tag->extensionFields.typeRef [1]);
838
+ json_object_set_new (response,
839
+ "typeref",
840
+ json_string (val));
841
+ free (val);
842
+ }
843
+
844
+ if (Option.extensionFields.fileScope && tag->isFileScope)
845
+ json_object_set_new (response, "scope",
846
+ json_string ("file"));
847
+
848
+ if (Option.extensionFields.inheritance &&
849
+ tag->extensionFields.inheritance != NULL)
850
+ json_object_set_new (response, "inherits",
851
+ json_string (tag->extensionFields.inheritance));
852
+
853
+ if (Option.extensionFields.access && tag->extensionFields.access != NULL)
854
+ json_object_set_new (response, "access",
855
+ json_string (tag->extensionFields.access));
856
+
857
+ if (Option.extensionFields.implementation &&
858
+ tag->extensionFields.implementation != NULL)
859
+ json_object_set_new (response, "implementation",
860
+ json_string (tag->extensionFields.implementation));
861
+
862
+ if (Option.extensionFields.signature &&
863
+ tag->extensionFields.signature != NULL)
864
+ json_object_set_new (response, "signature",
865
+ json_string (tag->extensionFields.signature));
866
+
867
+ json_dumpf (response, stdout, 0);
868
+ fprintf (stdout, "\n");
869
+ fflush (stdout);
870
+
871
+ json_decref (response);
872
+ }
873
+
809
874
  extern void makeTagEntry (const tagEntryInfo *const tag)
810
875
  {
811
876
  Assert (tag->name != NULL);
@@ -816,7 +881,11 @@ extern void makeTagEntry (const tagEntryInfo *const tag)
816
881
  int length = 0;
817
882
 
818
883
  DebugStatement ( debugEntry (tag); )
819
- if (Option.xref)
884
+ if (Option.json)
885
+ {
886
+ writeJsonEntry (tag);
887
+ }
888
+ else if (Option.xref)
820
889
  {
821
890
  if (! tag->isFileEntry)
822
891
  length = writeXrefEntry (tag);
@@ -22,7 +22,9 @@
22
22
  * INCLUDE FILES
23
23
  */
24
24
  #include "general.h" /* must always come first */
25
+ #include "ctags.h"
25
26
 
27
+ #include <jansson.h>
26
28
  #include <string.h>
27
29
 
28
30
  /* To provide timings features if available.
@@ -293,7 +295,7 @@ static boolean createTagsForEntry (const char *const entryName)
293
295
  verbose ("excluding \"%s\"\n", entryName);
294
296
  else if (status->isSymbolicLink && ! Option.followLinks)
295
297
  verbose ("ignoring \"%s\" (symbolic link)\n", entryName);
296
- else if (! status->exists && ! Option.stdinFileName)
298
+ else if (! status->exists)
297
299
  error (WARNING | PERROR, "cannot open source file \"%s\"", entryName);
298
300
  else if (status->isDirectory)
299
301
  resize = recurseIntoDirectory (entryName);
@@ -466,6 +468,65 @@ static boolean etagsInclude (void)
466
468
  return (boolean)(Option.etags && Option.etagsInclude != NULL);
467
469
  }
468
470
 
471
+ static void interactiveJsonMode ()
472
+ {
473
+ char buffer[1024];
474
+ json_t *request;
475
+
476
+ openTagFile ();
477
+ fprintf (stdout, "{\"name\": \"" PROGRAM_NAME "\", \"version\": \"" PROGRAM_VERSION "\"}\n");
478
+ fflush (stdout);
479
+
480
+ while (fgets (buffer, sizeof(buffer), stdin)) {
481
+ if (buffer[0] == '\n')
482
+ continue;
483
+
484
+ request = json_loads (buffer, JSON_DISABLE_EOF_CHECK, NULL);
485
+ if (! request) {
486
+ error (FATAL, "invalid json");
487
+ goto next;
488
+ }
489
+
490
+ json_t *command = json_object_get (request, "command");
491
+ if (! command) {
492
+ error (FATAL, "command name not found");
493
+ goto next;
494
+ }
495
+
496
+ if (!strcmp ("list-parsers", json_string_value (command))) {
497
+ } else if (!strcmp ("generate-tags", json_string_value (command))) {
498
+ json_int_t size = -1;
499
+ const char *filename;
500
+
501
+ if (json_unpack (request, "{s?I ss}", "size", &size, "filename", &filename) == -1) {
502
+ error (FATAL, "invalid generate-tags request");
503
+ goto next;
504
+ }
505
+
506
+ if (size == -1) { /* read from disk */
507
+ createTagsForEntry (filename);
508
+ } else { /* read nbytes from stream */
509
+ size_t nbytes = (size_t)size;
510
+ File.buffer = malloc (nbytes+1);
511
+ File.buffer [nbytes] = 0;
512
+ File.buffer_size = fread (File.buffer, 1, nbytes, stdin);
513
+ parseFile (filename);
514
+ free (File.buffer);
515
+ File.buffer = NULL;
516
+ }
517
+
518
+ fprintf (stdout, "{\"completed\": \"generate-tags\"}\n");
519
+ fflush (stdout);
520
+ } else {
521
+ error (FATAL, "unknown command name");
522
+ goto next;
523
+ }
524
+
525
+ next:
526
+ json_decref (request);
527
+ }
528
+ }
529
+
469
530
  static void makeTags (cookedArgs *args)
470
531
  {
471
532
  clock_t timeStamps [3];
@@ -478,7 +539,7 @@ static void makeTags (cookedArgs *args)
478
539
  if (filesRequired ())
479
540
  error (FATAL, "No files specified. Try \"%s --help\".",
480
541
  getExecutableName ());
481
- else if (! Option.recurse && ! Option.stdinFileName && ! etagsInclude ())
542
+ else if (! Option.recurse && ! etagsInclude ())
482
543
  return;
483
544
  }
484
545
 
@@ -506,10 +567,6 @@ static void makeTags (cookedArgs *args)
506
567
  if (! files && Option.recurse)
507
568
  resize = recurseIntoDirectory (".");
508
569
 
509
- if (Option.stdinFileName)
510
- {
511
- resize = createTagsForEntry(Option.stdinFileName);
512
- }
513
570
 
514
571
  timeStamp (1);
515
572
 
@@ -564,7 +621,11 @@ extern int main (int __unused__ argc, char **argv)
564
621
  verbose ("Reading initial options from command line\n");
565
622
  parseOptions (args);
566
623
  checkOptions ();
567
- makeTags (args);
624
+ if (Option.json)
625
+ interactiveJsonMode ();
626
+ else
627
+ makeTags (args);
628
+
568
629
 
569
630
  /* Clean up.
570
631
  */
@@ -148,6 +148,7 @@ optionValues Option = {
148
148
  FALSE, /* --tag-relative */
149
149
  FALSE, /* --totals */
150
150
  FALSE, /* --line-directives */
151
+ FALSE, /* --json */
151
152
  #ifdef DEBUG
152
153
  0, 0 /* -D, -b */
153
154
  #endif
@@ -228,6 +229,8 @@ static optionDescription LongOptionDescription [] = {
228
229
  {1," Print this option summary."},
229
230
  {1," --if0=[yes|no]"},
230
231
  {1," Should C code within #if 0 conditional branches be parsed [no]?"},
232
+ {1," --json"},
233
+ {1," Enter interactive json command mode."},
231
234
  {1," --<LANG>-kinds=[+|-]kinds"},
232
235
  {1," Enable/disable tag kinds for language <LANG>."},
233
236
  {1," --langdef=name"},
@@ -396,7 +399,7 @@ extern void setDefaultTagFileName (void)
396
399
  extern boolean filesRequired (void)
397
400
  {
398
401
  boolean result = FilesRequired;
399
- if (Option.recurse || Option.stdinFileName)
402
+ if (Option.recurse || Option.json)
400
403
  result = FALSE;
401
404
  return result;
402
405
  }
@@ -960,14 +963,12 @@ static void processLanguageForceOption (
960
963
  Option.language = language;
961
964
  }
962
965
 
963
- static void processStdinFileName (
964
- const char *const option, const char *const parameter)
966
+ static void processJsonOption (
967
+ const char *const option,
968
+ const char *const parameter __unused__)
965
969
  {
966
- if (strlen(parameter) == 0) {
967
- error (FATAL, "No filename specified for --stdin-filename");
968
- }
969
-
970
- Option.stdinFileName = stringCopy(parameter);
970
+ Option.json = TRUE;
971
+ Option.tagFileName = stringCopy ("-");
971
972
  }
972
973
 
973
974
  static char* skipPastMap (char* p)
@@ -1389,6 +1390,7 @@ static parametricOption ParametricOptions [] = {
1389
1390
  { "filter-terminator", processFilterTerminatorOption, TRUE },
1390
1391
  { "format", processFormatOption, TRUE },
1391
1392
  { "help", processHelpOption, TRUE },
1393
+ { "json", processJsonOption, TRUE },
1392
1394
  { "lang", processLanguageForceOption, FALSE },
1393
1395
  { "language", processLanguageForceOption, FALSE },
1394
1396
  { "language-force", processLanguageForceOption, FALSE },
@@ -1401,8 +1403,7 @@ static parametricOption ParametricOptions [] = {
1401
1403
  { "list-languages", processListLanguagesOption, TRUE },
1402
1404
  { "options", processOptionFile, FALSE },
1403
1405
  { "sort", processSortOption, TRUE },
1404
- { "version", processVersionOption, TRUE },
1405
- { "stdin-filename", processStdinFileName, FALSE }
1406
+ { "version", processVersionOption, TRUE }
1406
1407
  };
1407
1408
 
1408
1409
  static booleanOption BooleanOptions [] = {
@@ -1693,7 +1694,7 @@ extern void previewFirstOption (cookedArgs* const args)
1693
1694
  else if (strcmp (args->item, "options") == 0 &&
1694
1695
  strcmp (args->parameter, "NONE") == 0)
1695
1696
  {
1696
- fprintf (stderr, "No options will be read from files or environment\n");
1697
+ /* fprintf (stderr, "No options will be read from files or environment\n");*/
1697
1698
  SkipConfiguration = TRUE;
1698
1699
  cArgForth (args);
1699
1700
  }
@@ -1830,7 +1831,6 @@ extern void freeOptionResources (void)
1830
1831
  freeString (&Option.tagFileName);
1831
1832
  freeString (&Option.fileList);
1832
1833
  freeString (&Option.filterTerminator);
1833
- freeString (&Option.stdinFileName);
1834
1834
 
1835
1835
  freeList (&Excluded);
1836
1836
  freeList (&Option.ignore);