docspring 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (523) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +11 -5
  5. data/docs/CreateHtmlSubmissionData.md +3 -1
  6. data/docs/CreatePdfSubmissionData.md +3 -1
  7. data/docs/PDFApi.md +156 -10
  8. data/docs/PublishVersionData.md +20 -0
  9. data/docs/RestoreVersionData.md +18 -0
  10. data/docs/Submission.md +4 -0
  11. data/docs/SubmissionPreview.md +4 -0
  12. data/docs/Template.md +15 -1
  13. data/docs/TemplateDeleteResponse.md +24 -0
  14. data/docs/TemplatePreview.md +13 -1
  15. data/docs/TemplatePublishVersionResponse.md +22 -0
  16. data/lib/docspring/api/pdf_api.rb +152 -5
  17. data/lib/docspring/api_client.rb +1 -1
  18. data/lib/docspring/models/combined_submission_action.rb +1 -5
  19. data/lib/docspring/models/create_html_submission_data.rb +13 -4
  20. data/lib/docspring/models/create_pdf_submission_data.rb +13 -4
  21. data/lib/docspring/models/publish_version_data.rb +230 -0
  22. data/lib/docspring/models/restore_version_data.rb +221 -0
  23. data/lib/docspring/models/submission.rb +41 -1
  24. data/lib/docspring/models/submission_data_request_event.rb +1 -5
  25. data/lib/docspring/models/submission_preview.rb +41 -1
  26. data/lib/docspring/models/template.rb +106 -4
  27. data/lib/docspring/models/template_delete_response.rb +287 -0
  28. data/lib/docspring/models/template_preview.rb +88 -4
  29. data/lib/docspring/models/template_publish_version_response.rb +282 -0
  30. data/lib/docspring/version.rb +1 -1
  31. data/lib/docspring.rb +4 -0
  32. data/spec/api/pdf_api_spec.rb +27 -2
  33. data/spec/models/create_html_submission_data_spec.rb +6 -0
  34. data/spec/models/create_pdf_submission_data_spec.rb +6 -0
  35. data/spec/models/publish_version_data_spec.rb +42 -0
  36. data/spec/models/restore_version_data_spec.rb +36 -0
  37. data/spec/models/submission_preview_spec.rb +16 -0
  38. data/spec/models/submission_spec.rb +16 -0
  39. data/spec/models/template_delete_response_spec.rb +58 -0
  40. data/spec/models/template_preview_spec.rb +40 -0
  41. data/spec/models/template_publish_version_response_spec.rb +52 -0
  42. data/spec/models/template_spec.rb +46 -0
  43. data/vendor/bundle/ruby/3.3.0/bin/irb +29 -0
  44. data/vendor/bundle/ruby/3.3.0/bin/rdbg +29 -0
  45. data/vendor/bundle/ruby/3.3.0/bin/rdoc +29 -0
  46. data/vendor/bundle/ruby/3.3.0/bin/ri +29 -0
  47. data/vendor/bundle/ruby/3.3.0/cache/ast-2.4.3.gem +0 -0
  48. data/vendor/bundle/ruby/3.3.0/cache/debug-1.10.0.gem +0 -0
  49. data/vendor/bundle/ruby/3.3.0/cache/io-console-0.8.0.gem +0 -0
  50. data/vendor/bundle/ruby/3.3.0/cache/irb-1.15.1.gem +0 -0
  51. data/vendor/bundle/ruby/3.3.0/cache/parser-3.3.7.2.gem +0 -0
  52. data/vendor/bundle/ruby/3.3.0/cache/pp-0.6.2.gem +0 -0
  53. data/vendor/bundle/ruby/3.3.0/cache/prettyprint-0.2.0.gem +0 -0
  54. data/vendor/bundle/ruby/3.3.0/cache/rdoc-6.12.0.gem +0 -0
  55. data/vendor/bundle/ruby/3.3.0/cache/reline-0.6.0.gem +0 -0
  56. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/debug/debug.bundle +0 -0
  57. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/gem.build_complete +0 -0
  58. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/debug-1.10.0/gem_make.out +19 -0
  59. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/gem.build_complete +0 -0
  60. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/gem_make.out +31 -0
  61. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/io/console.bundle +0 -0
  62. data/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/io-console-0.8.0/mkmf.log +447 -0
  63. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/LICENSE.MIT +20 -0
  64. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/README.YARD.md +12 -0
  65. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/node.rb +268 -0
  66. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/processor/mixin.rb +288 -0
  67. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/processor.rb +12 -0
  68. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast/sexp.rb +30 -0
  69. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.3/lib/ast.rb +17 -0
  70. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/CONTRIBUTING.md +573 -0
  71. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/Gemfile +10 -0
  72. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/LICENSE.txt +22 -0
  73. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/README.md +970 -0
  74. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/Rakefile +57 -0
  75. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/TODO.md +23 -0
  76. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/debug.gemspec +33 -0
  77. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/exe/rdbg +53 -0
  78. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/Makefile +270 -0
  79. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/debug.c +228 -0
  80. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/debug_version.h +1 -0
  81. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/extconf.rb +27 -0
  82. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/iseq_collector.c +93 -0
  83. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/abbrev_command.rb +77 -0
  84. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/breakpoint.rb +556 -0
  85. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/client.rb +263 -0
  86. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/color.rb +123 -0
  87. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/config.rb +590 -0
  88. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/console.rb +213 -0
  89. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/dap_custom/traceInspector.rb +336 -0
  90. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/debug.bundle +0 -0
  91. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/frame_info.rb +188 -0
  92. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/irb_integration.rb +37 -0
  93. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/local.rb +115 -0
  94. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/open.rb +13 -0
  95. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/open_nonstop.rb +15 -0
  96. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/prelude.rb +50 -0
  97. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server.rb +534 -0
  98. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server_cdp.rb +1348 -0
  99. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/server_dap.rb +1108 -0
  100. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/session.rb +2659 -0
  101. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/source_repository.rb +150 -0
  102. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/start.rb +5 -0
  103. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/thread_client.rb +1455 -0
  104. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/tracer.rb +241 -0
  105. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/version.rb +5 -0
  106. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug.rb +9 -0
  107. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/misc/README.md.erb +636 -0
  108. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/.document +5 -0
  109. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/BSDL +22 -0
  110. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/COPYING +56 -0
  111. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/README.md +46 -0
  112. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/Makefile +272 -0
  113. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/console.c +1969 -0
  114. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/extconf.rb +61 -0
  115. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/win32_vk.inc +1390 -0
  116. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console/size.rb +23 -0
  117. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console.bundle +0 -0
  118. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/Gemfile +29 -0
  119. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/LICENSE.txt +22 -0
  120. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/README.md +125 -0
  121. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/Rakefile +52 -0
  122. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/bin/console +6 -0
  123. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/bin/setup +6 -0
  124. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/doc/irb/irb-tools.rd.ja +184 -0
  125. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/doc/irb/irb.rd.ja +425 -0
  126. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/exe/irb +9 -0
  127. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/irb.gemspec +46 -0
  128. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/cmd/nop.rb +4 -0
  129. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/color.rb +263 -0
  130. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/color_printer.rb +56 -0
  131. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/backtrace.rb +17 -0
  132. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/base.rb +60 -0
  133. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/break.rb +17 -0
  134. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/catch.rb +17 -0
  135. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/cd.rb +51 -0
  136. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/chws.rb +40 -0
  137. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/context.rb +16 -0
  138. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/continue.rb +17 -0
  139. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/copy.rb +73 -0
  140. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/debug.rb +73 -0
  141. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/delete.rb +17 -0
  142. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/disable_irb.rb +19 -0
  143. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/edit.rb +63 -0
  144. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/exit.rb +18 -0
  145. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/finish.rb +17 -0
  146. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/force_exit.rb +18 -0
  147. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/help.rb +83 -0
  148. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/history.rb +45 -0
  149. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/info.rb +17 -0
  150. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/internal_helpers.rb +27 -0
  151. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/irb_info.rb +33 -0
  152. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/load.rb +91 -0
  153. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/ls.rb +167 -0
  154. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/measure.rb +49 -0
  155. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/next.rb +17 -0
  156. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/pushws.rb +65 -0
  157. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/show_doc.rb +51 -0
  158. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/show_source.rb +74 -0
  159. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/step.rb +17 -0
  160. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/subirb.rb +123 -0
  161. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command/whereami.rb +23 -0
  162. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/command.rb +23 -0
  163. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/completion.rb +504 -0
  164. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/context.rb +751 -0
  165. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/debug/ui.rb +101 -0
  166. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/debug.rb +127 -0
  167. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/default_commands.rb +279 -0
  168. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/easter-egg.rb +152 -0
  169. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/change-ws.rb +37 -0
  170. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/eval_history.rb +149 -0
  171. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/loader.rb +127 -0
  172. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/multi-irb.rb +258 -0
  173. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/tracer.rb +39 -0
  174. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/use-loader.rb +67 -0
  175. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ext/workspaces.rb +36 -0
  176. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/frame.rb +80 -0
  177. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/help.rb +28 -0
  178. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method/base.rb +16 -0
  179. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method/conf.rb +11 -0
  180. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/helper_method.rb +29 -0
  181. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/history.rb +116 -0
  182. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/init.rb +540 -0
  183. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/input-method.rb +515 -0
  184. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/inspector.rb +136 -0
  185. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/error.rb +52 -0
  186. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/help-message +55 -0
  187. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/ja/error.rb +53 -0
  188. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/lc/ja/help-message +58 -0
  189. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/locale.rb +153 -0
  190. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/nesting_parser.rb +239 -0
  191. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/notifier.rb +230 -0
  192. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/output-method.rb +80 -0
  193. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/pager.rb +213 -0
  194. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ruby-lex.rb +476 -0
  195. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ruby_logo.aa +118 -0
  196. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/source_finder.rb +138 -0
  197. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/statement.rb +101 -0
  198. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/version.rb +11 -0
  199. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/workspace.rb +171 -0
  200. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/ws-for-case-2.rb +9 -0
  201. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb/xmp.rb +164 -0
  202. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/lib/irb.rb +736 -0
  203. data/vendor/bundle/ruby/3.3.0/gems/irb-1.15.1/man/irb.1 +292 -0
  204. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/LICENSE.txt +26 -0
  205. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/bin/ruby-parse +7 -0
  206. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/bin/ruby-rewrite +7 -0
  207. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/gauntlet_parser.rb +123 -0
  208. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/all.rb +17 -0
  209. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ast/node.rb +40 -0
  210. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ast/processor.rb +293 -0
  211. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/base.rb +291 -0
  212. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/builders/default.rb +2338 -0
  213. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/clobbering_error.rb +13 -0
  214. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/color.rb +32 -0
  215. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/context.rb +51 -0
  216. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/current.rb +137 -0
  217. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/current_arg_stack.rb +46 -0
  218. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/deprecation.rb +13 -0
  219. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/diagnostic/engine.rb +104 -0
  220. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/diagnostic.rb +163 -0
  221. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/dedenter.rb +88 -0
  222. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/explanation.rb +55 -0
  223. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/literal.rb +284 -0
  224. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer/stack_state.rb +49 -0
  225. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-F0.rb +12922 -0
  226. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-F1.rb +14875 -0
  227. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/lexer-strings.rb +5424 -0
  228. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/macruby.rb +9634 -0
  229. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/max_numparam_stack.rb +56 -0
  230. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/messages.rb +125 -0
  231. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/meta.rb +48 -0
  232. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/rewriter.rb +105 -0
  233. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby18.rb +9272 -0
  234. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby19.rb +9558 -0
  235. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby20.rb +10229 -0
  236. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby21.rb +10203 -0
  237. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby22.rb +10302 -0
  238. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby23.rb +10322 -0
  239. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby24.rb +10454 -0
  240. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby25.rb +10374 -0
  241. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby26.rb +10352 -0
  242. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby27.rb +11947 -0
  243. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby30.rb +12243 -0
  244. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby31.rb +12716 -0
  245. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby32.rb +12704 -0
  246. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby33.rb +12589 -0
  247. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/ruby34.rb +12596 -0
  248. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/rubymotion.rb +9515 -0
  249. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner/ruby_parse.rb +157 -0
  250. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner/ruby_rewrite.rb +101 -0
  251. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/runner.rb +299 -0
  252. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/buffer.rb +369 -0
  253. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/comment/associator.rb +233 -0
  254. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/comment.rb +134 -0
  255. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/collection.rb +18 -0
  256. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/condition.rb +21 -0
  257. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/constant.rb +32 -0
  258. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/definition.rb +23 -0
  259. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/for.rb +19 -0
  260. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/heredoc.rb +19 -0
  261. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/index.rb +33 -0
  262. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/keyword.rb +20 -0
  263. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/method_definition.rb +25 -0
  264. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/objc_kwarg.rb +19 -0
  265. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/operator.rb +17 -0
  266. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/rescue_body.rb +21 -0
  267. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/send.rb +36 -0
  268. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/ternary.rb +18 -0
  269. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map/variable.rb +31 -0
  270. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/map.rb +186 -0
  271. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/range.rb +326 -0
  272. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/rewriter/action.rb +44 -0
  273. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/rewriter.rb +513 -0
  274. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/tree_rewriter/action.rb +243 -0
  275. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/source/tree_rewriter.rb +431 -0
  276. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/static_environment.rb +134 -0
  277. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/syntax_error.rb +21 -0
  278. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/tree_rewriter.rb +133 -0
  279. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
  280. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/variables_stack.rb +36 -0
  281. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser/version.rb +5 -0
  282. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/lib/parser.rb +91 -0
  283. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.7.2/parser.gemspec +43 -0
  284. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/BSDL +22 -0
  285. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/COPYING +56 -0
  286. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/lib/pp.rb +699 -0
  287. data/vendor/bundle/ruby/3.3.0/gems/pp-0.6.2/pp.gemspec +35 -0
  288. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.github/dependabot.yml +6 -0
  289. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.github/workflows/test.yml +41 -0
  290. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/.gitignore +8 -0
  291. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/Gemfile +4 -0
  292. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/LICENSE.txt +22 -0
  293. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/README.md +43 -0
  294. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/Rakefile +10 -0
  295. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/bin/console +14 -0
  296. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/bin/setup +8 -0
  297. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/lib/prettyprint.rb +558 -0
  298. data/vendor/bundle/ruby/3.3.0/gems/prettyprint-0.2.0/prettyprint.gemspec +29 -0
  299. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/CONTRIBUTING.rdoc +219 -0
  300. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/CVE-2013-0256.rdoc +49 -0
  301. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/ExampleMarkdown.md +39 -0
  302. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/ExampleRDoc.rdoc +210 -0
  303. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/History.rdoc +1668 -0
  304. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/LEGAL.rdoc +50 -0
  305. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/LICENSE.rdoc +59 -0
  306. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/README.rdoc +142 -0
  307. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/RI.md +842 -0
  308. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/TODO.rdoc +60 -0
  309. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/exe/rdoc +43 -0
  310. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/exe/ri +12 -0
  311. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/alias.rb +111 -0
  312. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/anon_class.rb +10 -0
  313. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/any_method.rb +379 -0
  314. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/attr.rb +175 -0
  315. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/class_module.rb +871 -0
  316. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/constant.rb +186 -0
  317. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/context/section.rb +175 -0
  318. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/context.rb +1264 -0
  319. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/extend.rb +9 -0
  320. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/ghost_method.rb +6 -0
  321. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/include.rb +9 -0
  322. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/meta_method.rb +6 -0
  323. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/method_attr.rb +430 -0
  324. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/mixin.rb +120 -0
  325. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/normal_class.rb +92 -0
  326. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/normal_module.rb +73 -0
  327. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/require.rb +51 -0
  328. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/single_class.rb +30 -0
  329. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object/top_level.rb +291 -0
  330. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_object.rb +426 -0
  331. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/code_objects.rb +5 -0
  332. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/comment.rb +239 -0
  333. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/cross_reference.rb +228 -0
  334. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/encoding.rb +120 -0
  335. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/erb_partial.rb +18 -0
  336. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/erbio.rb +37 -0
  337. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/darkfish.rb +824 -0
  338. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/json_index.rb +300 -0
  339. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/markup.rb +159 -0
  340. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
  341. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/po.rb +84 -0
  342. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
  343. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/pot.rb +99 -0
  344. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/ri.rb +30 -0
  345. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
  346. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
  347. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +19 -0
  348. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +34 -0
  349. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
  350. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +9 -0
  351. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
  352. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
  353. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
  354. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
  355. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
  356. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
  357. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
  358. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
  359. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
  360. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  361. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/class.rhtml +206 -0
  362. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
  363. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +668 -0
  364. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
  365. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
  366. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
  367. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
  368. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  369. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  370. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
  371. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
  372. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  373. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  374. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
  375. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  376. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  377. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  378. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  379. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
  380. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  381. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
  382. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  383. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  384. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  385. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  386. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  387. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  388. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  389. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
  390. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  391. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
  392. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  393. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  394. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  395. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/index.rhtml +23 -0
  396. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +120 -0
  397. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/js/search.js +110 -0
  398. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/page.rhtml +18 -0
  399. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +20 -0
  400. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
  401. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +70 -0
  402. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
  403. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator/template/json_index/js/searcher.js +229 -0
  404. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/generator.rb +51 -0
  405. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n/locale.rb +102 -0
  406. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n/text.rb +126 -0
  407. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/i18n.rb +10 -0
  408. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/known_classes.rb +74 -0
  409. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/entities.rb +2131 -0
  410. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/literals.kpeg +21 -0
  411. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown/literals.rb +454 -0
  412. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown.kpeg +1244 -0
  413. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markdown.rb +16793 -0
  414. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attr_changer.rb +22 -0
  415. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attr_span.rb +35 -0
  416. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attribute_manager.rb +405 -0
  417. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/attributes.rb +70 -0
  418. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/blank_line.rb +27 -0
  419. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/block_quote.rb +14 -0
  420. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/document.rb +164 -0
  421. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/formatter.rb +272 -0
  422. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/hard_break.rb +31 -0
  423. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/heading.rb +78 -0
  424. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/include.rb +42 -0
  425. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
  426. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/list.rb +101 -0
  427. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/list_item.rb +99 -0
  428. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/paragraph.rb +28 -0
  429. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/parser.rb +585 -0
  430. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/pre_process.rb +318 -0
  431. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/raw.rb +69 -0
  432. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/regexp_handling.rb +40 -0
  433. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/rule.rb +20 -0
  434. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/table.rb +56 -0
  435. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_ansi.rb +93 -0
  436. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_bs.rb +102 -0
  437. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html.rb +452 -0
  438. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html_crossref.rb +226 -0
  439. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
  440. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_joined_paragraph.rb +46 -0
  441. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_label.rb +74 -0
  442. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_markdown.rb +191 -0
  443. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_rdoc.rb +352 -0
  444. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
  445. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_test.rb +69 -0
  446. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/to_tt_only.rb +120 -0
  447. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup/verbatim.rb +83 -0
  448. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/markup.rb +240 -0
  449. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/options.rb +1397 -0
  450. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/c.rb +1260 -0
  451. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/changelog.rb +350 -0
  452. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/markdown.rb +22 -0
  453. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/prism_ruby.rb +1099 -0
  454. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/rd.rb +22 -0
  455. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ripper_state_lex.rb +302 -0
  456. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ruby.rb +2381 -0
  457. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/ruby_tools.rb +165 -0
  458. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/simple.rb +61 -0
  459. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser/text.rb +11 -0
  460. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/parser.rb +297 -0
  461. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/block_parser.rb +1706 -0
  462. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/block_parser.ry +643 -0
  463. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline.rb +71 -0
  464. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline_parser.rb +1854 -0
  465. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd/inline_parser.ry +593 -0
  466. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rd.rb +99 -0
  467. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rdoc.rb +566 -0
  468. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/driver.rb +1558 -0
  469. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/formatter.rb +6 -0
  470. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/paths.rb +171 -0
  471. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/store.rb +6 -0
  472. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri/task.rb +71 -0
  473. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/ri.rb +20 -0
  474. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/rubygems_hook.rb +330 -0
  475. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/servlet.rb +451 -0
  476. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/normal.rb +58 -0
  477. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/quiet.rb +59 -0
  478. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats/verbose.rb +44 -0
  479. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/stats.rb +461 -0
  480. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/store.rb +1001 -0
  481. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/task.rb +354 -0
  482. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/text.rb +322 -0
  483. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/token_stream.rb +118 -0
  484. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/tom_doc.rb +257 -0
  485. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc/version.rb +10 -0
  486. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rdoc.rb +211 -0
  487. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/lib/rubygems_plugin.rb +23 -0
  488. data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.12.0/man/ri.1 +247 -0
  489. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/BSDL +22 -0
  490. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/COPYING +56 -0
  491. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/README.md +94 -0
  492. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/config.rb +373 -0
  493. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/face.rb +199 -0
  494. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/history.rb +76 -0
  495. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/ansi.rb +325 -0
  496. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/dumb.rb +120 -0
  497. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io/windows.rb +530 -0
  498. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/io.rb +55 -0
  499. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/base.rb +37 -0
  500. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/composite.rb +17 -0
  501. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/emacs.rb +517 -0
  502. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/vi_command.rb +518 -0
  503. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor/vi_insert.rb +517 -0
  504. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_actor.rb +8 -0
  505. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/key_stroke.rb +119 -0
  506. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/kill_ring.rb +125 -0
  507. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/line_editor.rb +2382 -0
  508. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/unicode/east_asian_width.rb +1267 -0
  509. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/unicode.rb +415 -0
  510. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline/version.rb +3 -0
  511. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/lib/reline.rb +519 -0
  512. data/vendor/bundle/ruby/3.3.0/gems/reline-0.6.0/license_of_rb-readline +25 -0
  513. data/vendor/bundle/ruby/3.3.0/plugins/rdoc_plugin.rb +1 -0
  514. data/vendor/bundle/ruby/3.3.0/specifications/ast-2.4.3.gemspec +29 -0
  515. data/vendor/bundle/ruby/3.3.0/specifications/debug-1.10.0.gemspec +32 -0
  516. data/vendor/bundle/ruby/3.3.0/specifications/io-console-0.8.0.gemspec +25 -0
  517. data/vendor/bundle/ruby/3.3.0/specifications/irb-1.15.1.gemspec +31 -0
  518. data/vendor/bundle/ruby/3.3.0/specifications/parser-3.3.7.2.gemspec +37 -0
  519. data/vendor/bundle/ruby/3.3.0/specifications/pp-0.6.2.gemspec +27 -0
  520. data/vendor/bundle/ruby/3.3.0/specifications/prettyprint-0.2.0.gemspec +23 -0
  521. data/vendor/bundle/ruby/3.3.0/specifications/rdoc-6.12.0.gemspec +31 -0
  522. data/vendor/bundle/ruby/3.3.0/specifications/reline-0.6.0.gemspec +26 -0
  523. metadata +499 -3
@@ -0,0 +1,2381 @@
1
+ # frozen_string_literal: true
2
+ ##
3
+ # This file contains stuff stolen outright from:
4
+ #
5
+ # rtags.rb -
6
+ # ruby-lex.rb - ruby lexcal analyzer
7
+ # ruby-token.rb - ruby tokens
8
+ # by Keiju ISHITSUKA (Nippon Rational Inc.)
9
+ #
10
+
11
+ if ENV['RDOC_USE_PRISM_PARSER']
12
+ require 'rdoc/parser/prism_ruby'
13
+ RDoc::Parser.const_set(:Ruby, RDoc::Parser::PrismRuby)
14
+ puts "========================================================================="
15
+ puts "RDoc is using the experimental Prism parser to generate the documentation"
16
+ puts "========================================================================="
17
+ return
18
+ end
19
+
20
+ require 'ripper'
21
+ require_relative 'ripper_state_lex'
22
+
23
+ ##
24
+ # Extracts code elements from a source file returning a TopLevel object
25
+ # containing the constituent file elements.
26
+ #
27
+ # This file is based on rtags
28
+ #
29
+ # RubyParser understands how to document:
30
+ # * classes
31
+ # * modules
32
+ # * methods
33
+ # * constants
34
+ # * aliases
35
+ # * private, public, protected
36
+ # * private_class_function, public_class_function
37
+ # * private_constant, public_constant
38
+ # * module_function
39
+ # * attr, attr_reader, attr_writer, attr_accessor
40
+ # * extra accessors given on the command line
41
+ # * metaprogrammed methods
42
+ # * require
43
+ # * include
44
+ #
45
+ # == Method Arguments
46
+ #
47
+ #--
48
+ # NOTE: I don't think this works, needs tests, remove the paragraph following
49
+ # this block when known to work
50
+ #
51
+ # The parser extracts the arguments from the method definition. You can
52
+ # override this with a custom argument definition using the :args: directive:
53
+ #
54
+ # ##
55
+ # # This method tries over and over until it is tired
56
+ #
57
+ # def go_go_go(thing_to_try, tries = 10) # :args: thing_to_try
58
+ # puts thing_to_try
59
+ # go_go_go thing_to_try, tries - 1
60
+ # end
61
+ #
62
+ # If you have a more-complex set of overrides you can use the :call-seq:
63
+ # directive:
64
+ #++
65
+ #
66
+ # The parser extracts the arguments from the method definition. You can
67
+ # override this with a custom argument definition using the :call-seq:
68
+ # directive:
69
+ #
70
+ # ##
71
+ # # This method can be called with a range or an offset and length
72
+ # #
73
+ # # :call-seq:
74
+ # # my_method(Range)
75
+ # # my_method(offset, length)
76
+ #
77
+ # def my_method(*args)
78
+ # end
79
+ #
80
+ # The parser extracts +yield+ expressions from method bodies to gather the
81
+ # yielded argument names. If your method manually calls a block instead of
82
+ # yielding or you want to override the discovered argument names use
83
+ # the :yields: directive:
84
+ #
85
+ # ##
86
+ # # My method is awesome
87
+ #
88
+ # def my_method(&block) # :yields: happy, times
89
+ # block.call 1, 2
90
+ # end
91
+ #
92
+ # == Metaprogrammed Methods
93
+ #
94
+ # To pick up a metaprogrammed method, the parser looks for a comment starting
95
+ # with '##' before an identifier:
96
+ #
97
+ # ##
98
+ # # This is a meta-programmed method!
99
+ #
100
+ # add_my_method :meta_method, :arg1, :arg2
101
+ #
102
+ # The parser looks at the token after the identifier to determine the name, in
103
+ # this example, :meta_method. If a name cannot be found, a warning is printed
104
+ # and 'unknown is used.
105
+ #
106
+ # You can force the name of a method using the :method: directive:
107
+ #
108
+ # ##
109
+ # # :method: some_method!
110
+ #
111
+ # By default, meta-methods are instance methods. To indicate that a method is
112
+ # a singleton method instead use the :singleton-method: directive:
113
+ #
114
+ # ##
115
+ # # :singleton-method:
116
+ #
117
+ # You can also use the :singleton-method: directive with a name:
118
+ #
119
+ # ##
120
+ # # :singleton-method: some_method!
121
+ #
122
+ # You can define arguments for metaprogrammed methods via either the
123
+ # :call-seq:, :arg: or :args: directives.
124
+ #
125
+ # Additionally you can mark a method as an attribute by
126
+ # using :attr:, :attr_reader:, :attr_writer: or :attr_accessor:. Just like
127
+ # for :method:, the name is optional.
128
+ #
129
+ # ##
130
+ # # :attr_reader: my_attr_name
131
+ #
132
+ # == Hidden methods and attributes
133
+ #
134
+ # You can provide documentation for methods that don't appear using
135
+ # the :method:, :singleton-method: and :attr: directives:
136
+ #
137
+ # ##
138
+ # # :attr_writer: ghost_writer
139
+ # # There is an attribute here, but you can't see it!
140
+ #
141
+ # ##
142
+ # # :method: ghost_method
143
+ # # There is a method here, but you can't see it!
144
+ #
145
+ # ##
146
+ # # this is a comment for a regular method
147
+ #
148
+ # def regular_method() end
149
+ #
150
+ # Note that by default, the :method: directive will be ignored if there is a
151
+ # standard rdocable item following it.
152
+
153
+ class RDoc::Parser::Ruby < RDoc::Parser
154
+
155
+ parse_files_matching(/\.rbw?$/)
156
+
157
+ include RDoc::TokenStream
158
+ include RDoc::Parser::RubyTools
159
+
160
+ ##
161
+ # RDoc::NormalClass type
162
+
163
+ NORMAL = "::"
164
+
165
+ ##
166
+ # RDoc::SingleClass type
167
+
168
+ SINGLE = "<<"
169
+
170
+ ##
171
+ # Creates a new Ruby parser.
172
+
173
+ def initialize(top_level, content, options, stats)
174
+ super
175
+
176
+ content = handle_tab_width(content)
177
+
178
+ @size = 0
179
+ @token_listeners = nil
180
+ content = RDoc::Encoding.remove_magic_comment content
181
+ @scanner = RDoc::Parser::RipperStateLex.parse(content)
182
+ @content = content
183
+ @scanner_point = 0
184
+ @prev_seek = nil
185
+ @markup = @options.markup
186
+ @track_visibility = :nodoc != @options.visibility
187
+ @encoding = @options.encoding
188
+
189
+ reset
190
+ end
191
+
192
+ ##
193
+ # Return +true+ if +tk+ is a newline.
194
+
195
+ def tk_nl?(tk)
196
+ :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
197
+ end
198
+
199
+ ##
200
+ # Retrieves the read token stream and replaces +pattern+ with +replacement+
201
+ # using gsub. If the result is only a ";" returns an empty string.
202
+
203
+ def get_tkread_clean pattern, replacement # :nodoc:
204
+ read = get_tkread.gsub(pattern, replacement).strip
205
+ return '' if read == ';'
206
+ read
207
+ end
208
+
209
+ ##
210
+ # Extracts the visibility information for the visibility token +tk+
211
+ # and +single+ class type identifier.
212
+ #
213
+ # Returns the visibility type (a string), the visibility (a symbol) and
214
+ # +singleton+ if the methods following should be converted to singleton
215
+ # methods.
216
+
217
+ def get_visibility_information tk, single # :nodoc:
218
+ vis_type = tk[:text]
219
+ singleton = single == SINGLE
220
+
221
+ vis =
222
+ case vis_type
223
+ when 'private' then :private
224
+ when 'protected' then :protected
225
+ when 'public' then :public
226
+ when 'private_class_method' then
227
+ singleton = true
228
+ :private
229
+ when 'public_class_method' then
230
+ singleton = true
231
+ :public
232
+ when 'module_function' then
233
+ singleton = true
234
+ :public
235
+ else
236
+ raise RDoc::Error, "Invalid visibility: #{tk.name}"
237
+ end
238
+
239
+ return vis_type, vis, singleton
240
+ end
241
+
242
+ ##
243
+ # Look for the first comment in a file that isn't a shebang line.
244
+
245
+ def collect_first_comment
246
+ skip_tkspace
247
+ comment = ''.dup
248
+ comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
249
+ first_line = true
250
+ first_comment_tk_kind = nil
251
+ line_no = nil
252
+
253
+ tk = get_tk
254
+
255
+ while tk && (:on_comment == tk[:kind] or :on_embdoc == tk[:kind])
256
+ comment_body = retrieve_comment_body(tk)
257
+ if first_line and comment_body =~ /\A#!/ then
258
+ skip_tkspace
259
+ tk = get_tk
260
+ elsif first_line and comment_body =~ /\A#\s*-\*-/ then
261
+ first_line = false
262
+ skip_tkspace
263
+ tk = get_tk
264
+ else
265
+ break if first_comment_tk_kind and not first_comment_tk_kind === tk[:kind]
266
+ first_comment_tk_kind = tk[:kind]
267
+
268
+ line_no = tk[:line_no] if first_line
269
+ first_line = false
270
+ comment << comment_body
271
+ tk = get_tk
272
+
273
+ if :on_nl === tk then
274
+ skip_tkspace_without_nl
275
+ tk = get_tk
276
+ end
277
+ end
278
+ end
279
+
280
+ unget_tk tk
281
+
282
+ new_comment comment, line_no
283
+ end
284
+
285
+ ##
286
+ # Consumes trailing whitespace from the token stream
287
+
288
+ def consume_trailing_spaces # :nodoc:
289
+ skip_tkspace_without_nl
290
+ end
291
+
292
+ ##
293
+ # Creates a new attribute in +container+ with +name+.
294
+
295
+ def create_attr container, single, name, rw, comment # :nodoc:
296
+ att = RDoc::Attr.new get_tkread, name, rw, comment, single == SINGLE
297
+ record_location att
298
+
299
+ container.add_attribute att
300
+ @stats.add_attribute att
301
+
302
+ att
303
+ end
304
+
305
+ ##
306
+ # Creates a module alias in +container+ at +rhs_name+ (or at the top-level
307
+ # for "::") with the name from +constant+.
308
+
309
+ def create_module_alias container, constant, rhs_name # :nodoc:
310
+ mod = if rhs_name =~ /^::/ then
311
+ @store.find_class_or_module rhs_name
312
+ else
313
+ container.find_module_named rhs_name
314
+ end
315
+
316
+ container.add_module_alias mod, rhs_name, constant, @top_level
317
+ end
318
+
319
+ ##
320
+ # Aborts with +msg+
321
+
322
+ def error(msg)
323
+ msg = make_message msg
324
+
325
+ abort msg
326
+ end
327
+
328
+ ##
329
+ # Looks for a true or false token.
330
+
331
+ def get_bool
332
+ skip_tkspace
333
+ tk = get_tk
334
+ if :on_kw == tk[:kind] && 'true' == tk[:text]
335
+ true
336
+ elsif :on_kw == tk[:kind] && ('false' == tk[:text] || 'nil' == tk[:text])
337
+ false
338
+ else
339
+ unget_tk tk
340
+ true
341
+ end
342
+ end
343
+
344
+ ##
345
+ # Look for the name of a class of module (optionally with a leading :: or
346
+ # with :: separated named) and return the ultimate name, the associated
347
+ # container, and the given name (with the ::).
348
+
349
+ def get_class_or_module container, ignore_constants = false
350
+ skip_tkspace
351
+ name_t = get_tk
352
+ given_name = ''.dup
353
+
354
+ # class ::A -> A is in the top level
355
+ if :on_op == name_t[:kind] and '::' == name_t[:text] then # bug
356
+ name_t = get_tk
357
+ container = @top_level
358
+ given_name << '::'
359
+ end
360
+
361
+ skip_tkspace_without_nl
362
+ given_name << name_t[:text]
363
+
364
+ is_self = name_t[:kind] == :on_op && name_t[:text] == '<<'
365
+ new_modules = []
366
+ while !is_self && (tk = peek_tk) and :on_op == tk[:kind] and '::' == tk[:text] do
367
+ prev_container = container
368
+ container = container.find_module_named name_t[:text]
369
+ container ||=
370
+ if ignore_constants then
371
+ c = RDoc::NormalModule.new name_t[:text]
372
+ c.store = @store
373
+ new_modules << [prev_container, c]
374
+ c
375
+ else
376
+ c = prev_container.add_module RDoc::NormalModule, name_t[:text]
377
+ c.ignore unless prev_container.document_children
378
+ @top_level.add_to_classes_or_modules c
379
+ c
380
+ end
381
+
382
+ record_location container
383
+
384
+ get_tk
385
+ skip_tkspace
386
+ if :on_lparen == peek_tk[:kind] # ProcObjectInConstant::()
387
+ parse_method_or_yield_parameters
388
+ break
389
+ end
390
+ name_t = get_tk
391
+ unless :on_const == name_t[:kind] || :on_ident == name_t[:kind]
392
+ raise RDoc::Error, "Invalid class or module definition: #{given_name}"
393
+ end
394
+ if prev_container == container and !ignore_constants
395
+ given_name = name_t[:text]
396
+ else
397
+ given_name << '::' + name_t[:text]
398
+ end
399
+ end
400
+
401
+ skip_tkspace_without_nl
402
+
403
+ return [container, name_t, given_name, new_modules]
404
+ end
405
+
406
+ ##
407
+ # Skip opening parentheses and yield the block.
408
+ # Skip closing parentheses too when exists.
409
+
410
+ def skip_parentheses(&block)
411
+ left_tk = peek_tk
412
+
413
+ if :on_lparen == left_tk[:kind]
414
+ get_tk
415
+
416
+ ret = skip_parentheses(&block)
417
+
418
+ right_tk = peek_tk
419
+ if :on_rparen == right_tk[:kind]
420
+ get_tk
421
+ end
422
+
423
+ ret
424
+ else
425
+ yield
426
+ end
427
+ end
428
+
429
+ ##
430
+ # Return a superclass, which can be either a constant of an expression
431
+
432
+ def get_class_specification
433
+ tk = peek_tk
434
+ if tk.nil?
435
+ return ''
436
+ elsif :on_kw == tk[:kind] && 'self' == tk[:text]
437
+ return 'self'
438
+ elsif :on_gvar == tk[:kind]
439
+ return ''
440
+ end
441
+
442
+ res = get_constant
443
+
444
+ skip_tkspace_without_nl
445
+
446
+ get_tkread # empty out read buffer
447
+
448
+ tk = get_tk
449
+ return res unless tk
450
+
451
+ case tk[:kind]
452
+ when :on_nl, :on_comment, :on_embdoc, :on_semicolon then
453
+ unget_tk(tk)
454
+ return res
455
+ end
456
+
457
+ res += parse_call_parameters(tk)
458
+ res
459
+ end
460
+
461
+ ##
462
+ # Parse a constant, which might be qualified by one or more class or module
463
+ # names
464
+
465
+ def get_constant
466
+ res = ""
467
+ skip_tkspace_without_nl
468
+ tk = get_tk
469
+
470
+ while tk && ((:on_op == tk[:kind] && '::' == tk[:text]) || :on_const == tk[:kind]) do
471
+ res += tk[:text]
472
+ tk = get_tk
473
+ end
474
+
475
+ unget_tk(tk)
476
+ res
477
+ end
478
+
479
+ ##
480
+ # Get an included module that may be surrounded by parens
481
+
482
+ def get_included_module_with_optional_parens
483
+ skip_tkspace_without_nl
484
+ get_tkread
485
+ tk = get_tk
486
+ end_token = get_end_token tk
487
+ return '' unless end_token
488
+
489
+ nest = 0
490
+ continue = false
491
+ only_constant = true
492
+
493
+ while tk != nil do
494
+ is_element_of_constant = false
495
+ case tk[:kind]
496
+ when :on_semicolon then
497
+ break if nest == 0
498
+ when :on_lbracket then
499
+ nest += 1
500
+ when :on_rbracket then
501
+ nest -= 1
502
+ when :on_lbrace then
503
+ nest += 1
504
+ when :on_rbrace then
505
+ nest -= 1
506
+ if nest <= 0
507
+ # we might have a.each { |i| yield i }
508
+ unget_tk(tk) if nest < 0
509
+ break
510
+ end
511
+ when :on_lparen then
512
+ nest += 1
513
+ when end_token[:kind] then
514
+ if end_token[:kind] == :on_rparen
515
+ nest -= 1
516
+ break if nest <= 0
517
+ else
518
+ break if nest <= 0
519
+ end
520
+ when :on_rparen then
521
+ nest -= 1
522
+ when :on_comment, :on_embdoc then
523
+ @read.pop
524
+ if :on_nl == end_token[:kind] and "\n" == tk[:text][-1] and
525
+ (!continue or (tk[:state] & Ripper::EXPR_LABEL) != 0) then
526
+ break if !continue and nest <= 0
527
+ end
528
+ when :on_comma then
529
+ continue = true
530
+ when :on_ident then
531
+ continue = false if continue
532
+ when :on_kw then
533
+ case tk[:text]
534
+ when 'def', 'do', 'case', 'for', 'begin', 'class', 'module'
535
+ nest += 1
536
+ when 'if', 'unless', 'while', 'until', 'rescue'
537
+ # postfix if/unless/while/until/rescue must be EXPR_LABEL
538
+ nest += 1 unless (tk[:state] & Ripper::EXPR_LABEL) != 0
539
+ when 'end'
540
+ nest -= 1
541
+ break if nest == 0
542
+ end
543
+ when :on_const then
544
+ is_element_of_constant = true
545
+ when :on_op then
546
+ is_element_of_constant = true if '::' == tk[:text]
547
+ end
548
+ only_constant = false unless is_element_of_constant
549
+ tk = get_tk
550
+ end
551
+
552
+ if only_constant
553
+ get_tkread_clean(/\s+/, ' ')
554
+ else
555
+ ''
556
+ end
557
+ end
558
+
559
+ ##
560
+ # Little hack going on here. In the statement:
561
+ #
562
+ # f = 2*(1+yield)
563
+ #
564
+ # We see the RPAREN as the next token, so we need to exit early. This still
565
+ # won't catch all cases (such as "a = yield + 1"
566
+
567
+ def get_end_token tk # :nodoc:
568
+ case tk[:kind]
569
+ when :on_lparen
570
+ token = RDoc::Parser::RipperStateLex::Token.new
571
+ token[:kind] = :on_rparen
572
+ token[:text] = ')'
573
+ token
574
+ when :on_rparen
575
+ nil
576
+ else
577
+ token = RDoc::Parser::RipperStateLex::Token.new
578
+ token[:kind] = :on_nl
579
+ token[:text] = "\n"
580
+ token
581
+ end
582
+ end
583
+
584
+ ##
585
+ # Retrieves the method container for a singleton method.
586
+
587
+ def get_method_container container, name_t # :nodoc:
588
+ prev_container = container
589
+ container = container.find_module_named(name_t[:text])
590
+
591
+ unless container then
592
+ constant = prev_container.constants.find do |const|
593
+ const.name == name_t[:text]
594
+ end
595
+
596
+ if constant then
597
+ parse_method_dummy prev_container
598
+ return
599
+ end
600
+ end
601
+
602
+ unless container then
603
+ # TODO seems broken, should starting at Object in @store
604
+ obj = name_t[:text].split("::").inject(Object) do |state, item|
605
+ state.const_get(item)
606
+ end rescue nil
607
+
608
+ type = obj.class == Class ? RDoc::NormalClass : RDoc::NormalModule
609
+
610
+ unless [Class, Module].include?(obj.class) then
611
+ warn("Couldn't find #{name_t[:text]}. Assuming it's a module")
612
+ end
613
+
614
+ if type == RDoc::NormalClass then
615
+ sclass = obj.superclass ? obj.superclass.name : nil
616
+ container = prev_container.add_class type, name_t[:text], sclass
617
+ else
618
+ container = prev_container.add_module type, name_t[:text]
619
+ end
620
+
621
+ record_location container
622
+ end
623
+
624
+ container
625
+ end
626
+
627
+ ##
628
+ # Extracts a name or symbol from the token stream.
629
+
630
+ def get_symbol_or_name
631
+ tk = get_tk
632
+ case tk[:kind]
633
+ when :on_symbol then
634
+ text = tk[:text].sub(/^:/, '')
635
+
636
+ next_tk = peek_tk
637
+ if next_tk && :on_op == next_tk[:kind] && '=' == next_tk[:text] then
638
+ get_tk
639
+ text << '='
640
+ end
641
+
642
+ text
643
+ when :on_ident, :on_const, :on_gvar, :on_cvar, :on_ivar, :on_op, :on_kw then
644
+ tk[:text]
645
+ when :on_tstring, :on_dstring then
646
+ tk[:text][1..-2]
647
+ else
648
+ raise RDoc::Error, "Name or symbol expected (got #{tk})"
649
+ end
650
+ end
651
+
652
+ ##
653
+ # Marks containers between +container+ and +ancestor+ as ignored
654
+
655
+ def suppress_parents container, ancestor # :nodoc:
656
+ while container and container != ancestor do
657
+ container.suppress unless container.documented?
658
+ container = container.parent
659
+ end
660
+ end
661
+
662
+ ##
663
+ # Look for directives in a normal comment block:
664
+ #
665
+ # # :stopdoc:
666
+ # # Don't display comment from this point forward
667
+ #
668
+ # This routine modifies its +comment+ parameter.
669
+
670
+ def look_for_directives_in container, comment
671
+ @preprocess.handle comment, container do |directive, param|
672
+ case directive
673
+ when 'method', 'singleton-method',
674
+ 'attr', 'attr_accessor', 'attr_reader', 'attr_writer' then
675
+ false # handled elsewhere
676
+ when 'section' then
677
+ break unless container.kind_of?(RDoc::Context)
678
+ container.set_current_section param, comment.dup
679
+ comment.text = ''
680
+ break
681
+ end
682
+ end
683
+
684
+ comment.remove_private
685
+ end
686
+
687
+ ##
688
+ # Adds useful info about the parser to +message+
689
+
690
+ def make_message message
691
+ prefix = "#{@file_name}:".dup
692
+
693
+ tk = peek_tk
694
+ prefix << "#{tk[:line_no]}:#{tk[:char_no]}:" if tk
695
+
696
+ "#{prefix} #{message}"
697
+ end
698
+
699
+ ##
700
+ # Creates a comment with the correct format
701
+
702
+ def new_comment comment, line_no = nil
703
+ c = RDoc::Comment.new comment, @top_level, :ruby
704
+ c.line = line_no
705
+ c.format = @markup
706
+ c
707
+ end
708
+
709
+ ##
710
+ # Creates an RDoc::Attr for the name following +tk+, setting the comment to
711
+ # +comment+.
712
+
713
+ def parse_attr(context, single, tk, comment)
714
+ line_no = tk[:line_no]
715
+
716
+ args = parse_symbol_arg 1
717
+ if args.size > 0 then
718
+ name = args[0]
719
+ rw = "R"
720
+ skip_tkspace_without_nl
721
+ tk = get_tk
722
+
723
+ if :on_comma == tk[:kind] then
724
+ rw = "RW" if get_bool
725
+ else
726
+ unget_tk tk
727
+ end
728
+
729
+ att = create_attr context, single, name, rw, comment
730
+ att.line = line_no
731
+
732
+ read_documentation_modifiers att, RDoc::ATTR_MODIFIERS
733
+ else
734
+ warn "'attr' ignored - looks like a variable"
735
+ end
736
+ end
737
+
738
+ ##
739
+ # Creates an RDoc::Attr for each attribute listed after +tk+, setting the
740
+ # comment for each to +comment+.
741
+
742
+ def parse_attr_accessor(context, single, tk, comment)
743
+ line_no = tk[:line_no]
744
+
745
+ args = parse_symbol_arg
746
+ rw = "?"
747
+
748
+ tmp = RDoc::CodeObject.new
749
+ read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS
750
+ # TODO In most other places we let the context keep track of document_self
751
+ # and add found items appropriately but here we do not. I'm not sure why.
752
+ return if @track_visibility and not tmp.document_self
753
+
754
+ case tk[:text]
755
+ when "attr_reader" then rw = "R"
756
+ when "attr_writer" then rw = "W"
757
+ when "attr_accessor" then rw = "RW"
758
+ else
759
+ rw = '?'
760
+ end
761
+
762
+ for name in args
763
+ att = create_attr context, single, name, rw, comment
764
+ att.line = line_no
765
+ end
766
+ end
767
+
768
+ ##
769
+ # Parses an +alias+ in +context+ with +comment+
770
+
771
+ def parse_alias(context, single, tk, comment)
772
+ line_no = tk[:line_no]
773
+
774
+ skip_tkspace
775
+
776
+ if :on_lparen === peek_tk[:kind] then
777
+ get_tk
778
+ skip_tkspace
779
+ end
780
+
781
+ new_name = get_symbol_or_name
782
+
783
+ skip_tkspace
784
+ if :on_comma === peek_tk[:kind] then
785
+ get_tk
786
+ skip_tkspace
787
+ end
788
+
789
+ begin
790
+ old_name = get_symbol_or_name
791
+ rescue RDoc::Error
792
+ return
793
+ end
794
+
795
+ al = RDoc::Alias.new(get_tkread, old_name, new_name, comment,
796
+ single == SINGLE)
797
+ record_location al
798
+ al.line = line_no
799
+
800
+ read_documentation_modifiers al, RDoc::ATTR_MODIFIERS
801
+ if al.document_self or not @track_visibility
802
+ context.add_alias al
803
+ @stats.add_alias al
804
+ end
805
+
806
+ al
807
+ end
808
+
809
+ ##
810
+ # Extracts call parameters from the token stream.
811
+
812
+ def parse_call_parameters(tk)
813
+ end_token = case tk[:kind]
814
+ when :on_lparen
815
+ :on_rparen
816
+ when :on_rparen
817
+ return ""
818
+ else
819
+ :on_nl
820
+ end
821
+ nest = 0
822
+
823
+ loop do
824
+ break if tk.nil?
825
+ case tk[:kind]
826
+ when :on_semicolon
827
+ break
828
+ when :on_lparen
829
+ nest += 1
830
+ when end_token
831
+ if end_token == :on_rparen
832
+ nest -= 1
833
+ break if RDoc::Parser::RipperStateLex.end?(tk) and nest <= 0
834
+ else
835
+ break if RDoc::Parser::RipperStateLex.end?(tk)
836
+ end
837
+ when :on_comment, :on_embdoc
838
+ unget_tk(tk)
839
+ break
840
+ when :on_op
841
+ if tk[:text] =~ /^(.{1,2})?=$/
842
+ unget_tk(tk)
843
+ break
844
+ end
845
+ end
846
+ tk = get_tk
847
+ end
848
+
849
+ get_tkread_clean "\n", " "
850
+ end
851
+
852
+ ##
853
+ # Parses a class in +context+ with +comment+
854
+
855
+ def parse_class container, single, tk, comment
856
+ line_no = tk[:line_no]
857
+
858
+ declaration_context = container
859
+ container, name_t, given_name, = get_class_or_module container
860
+
861
+ if name_t[:kind] == :on_const
862
+ cls = parse_class_regular container, declaration_context, single,
863
+ name_t, given_name, comment
864
+ elsif name_t[:kind] == :on_op && name_t[:text] == '<<'
865
+ case name = skip_parentheses { get_class_specification }
866
+ when 'self', container.name
867
+ read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
868
+ parse_statements container, SINGLE
869
+ return # don't update line
870
+ else
871
+ cls = parse_class_singleton container, name, comment
872
+ end
873
+ else
874
+ warn "Expected class name or '<<'. Got #{name_t[:kind]}: #{name_t[:text].inspect}"
875
+ return
876
+ end
877
+
878
+ cls.line = line_no
879
+
880
+ # after end modifiers
881
+ read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
882
+
883
+ cls
884
+ end
885
+
886
+ ##
887
+ # Parses and creates a regular class
888
+
889
+ def parse_class_regular container, declaration_context, single, # :nodoc:
890
+ name_t, given_name, comment
891
+ superclass = '::Object'
892
+
893
+ if given_name =~ /^::/ then
894
+ declaration_context = @top_level
895
+ given_name = $'
896
+ end
897
+
898
+ tk = peek_tk
899
+ if tk[:kind] == :on_op && tk[:text] == '<' then
900
+ get_tk
901
+ skip_tkspace
902
+ superclass = get_class_specification
903
+ superclass = '(unknown)' if superclass.empty?
904
+ end
905
+
906
+ cls_type = single == SINGLE ? RDoc::SingleClass : RDoc::NormalClass
907
+ cls = declaration_context.add_class cls_type, given_name, superclass
908
+ cls.ignore unless container.document_children
909
+
910
+ read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
911
+ record_location cls
912
+
913
+ cls.add_comment comment, @top_level
914
+
915
+ @top_level.add_to_classes_or_modules cls
916
+ @stats.add_class cls
917
+
918
+ suppress_parents container, declaration_context unless cls.document_self
919
+
920
+ parse_statements cls
921
+
922
+ cls
923
+ end
924
+
925
+ ##
926
+ # Parses a singleton class in +container+ with the given +name+ and
927
+ # +comment+.
928
+
929
+ def parse_class_singleton container, name, comment # :nodoc:
930
+ other = @store.find_class_named name
931
+
932
+ unless other then
933
+ if name =~ /^::/ then
934
+ name = $'
935
+ container = @top_level
936
+ end
937
+
938
+ other = container.add_module RDoc::NormalModule, name
939
+ record_location other
940
+
941
+ # class << $gvar
942
+ other.ignore if name.empty?
943
+
944
+ other.add_comment comment, @top_level
945
+ end
946
+
947
+ # notify :nodoc: all if not a constant-named class/module
948
+ # (and remove any comment)
949
+ unless name =~ /\A(::)?[A-Z]/ then
950
+ other.document_self = nil
951
+ other.document_children = false
952
+ other.clear_comment
953
+ end
954
+
955
+ @top_level.add_to_classes_or_modules other
956
+ @stats.add_class other
957
+
958
+ read_documentation_modifiers other, RDoc::CLASS_MODIFIERS
959
+ parse_statements(other, SINGLE)
960
+
961
+ other
962
+ end
963
+
964
+ ##
965
+ # Parses a constant in +context+ with +comment+. If +ignore_constants+ is
966
+ # true, no found constants will be added to RDoc.
967
+
968
+ def parse_constant container, tk, comment, ignore_constants = false
969
+ line_no = tk[:line_no]
970
+
971
+ name = tk[:text]
972
+ skip_tkspace_without_nl
973
+
974
+ return unless name =~ /^\w+$/
975
+
976
+ new_modules = []
977
+ if :on_op == peek_tk[:kind] && '::' == peek_tk[:text] then
978
+ unget_tk tk
979
+
980
+ container, name_t, _, new_modules = get_class_or_module container, true
981
+
982
+ name = name_t[:text]
983
+ end
984
+
985
+ is_array_or_hash = false
986
+ if peek_tk && :on_lbracket == peek_tk[:kind]
987
+ get_tk
988
+ nest = 1
989
+ while bracket_tk = get_tk
990
+ case bracket_tk[:kind]
991
+ when :on_lbracket
992
+ nest += 1
993
+ when :on_rbracket
994
+ nest -= 1
995
+ break if nest == 0
996
+ end
997
+ end
998
+ skip_tkspace_without_nl
999
+ is_array_or_hash = true
1000
+ end
1001
+
1002
+ unless peek_tk && :on_op == peek_tk[:kind] && '=' == peek_tk[:text] then
1003
+ return false
1004
+ end
1005
+ get_tk
1006
+
1007
+ unless ignore_constants
1008
+ new_modules.each do |prev_c, new_module|
1009
+ prev_c.add_module_by_normal_module new_module
1010
+ new_module.ignore unless prev_c.document_children
1011
+ @top_level.add_to_classes_or_modules new_module
1012
+ end
1013
+ end
1014
+
1015
+ value = ''
1016
+ con = RDoc::Constant.new name, value, comment
1017
+
1018
+ body = parse_constant_body container, con, is_array_or_hash
1019
+
1020
+ return unless body
1021
+
1022
+ con.value = body
1023
+ record_location con
1024
+ con.line = line_no
1025
+ read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
1026
+
1027
+ return if is_array_or_hash
1028
+
1029
+ @stats.add_constant con
1030
+ container.add_constant con
1031
+
1032
+ true
1033
+ end
1034
+
1035
+ def parse_constant_body container, constant, is_array_or_hash # :nodoc:
1036
+ nest = 0
1037
+ rhs_name = ''.dup
1038
+
1039
+ get_tkread
1040
+
1041
+ tk = get_tk
1042
+
1043
+ body = nil
1044
+ loop do
1045
+ break if tk.nil?
1046
+ if :on_semicolon == tk[:kind] then
1047
+ break if nest <= 0
1048
+ elsif [:on_tlambeg, :on_lparen, :on_lbrace, :on_lbracket].include?(tk[:kind]) then
1049
+ nest += 1
1050
+ elsif (:on_kw == tk[:kind] && 'def' == tk[:text]) then
1051
+ nest += 1
1052
+ elsif (:on_kw == tk[:kind] && %w{do if unless case begin}.include?(tk[:text])) then
1053
+ if (tk[:state] & Ripper::EXPR_LABEL) == 0
1054
+ nest += 1
1055
+ end
1056
+ elsif [:on_rparen, :on_rbrace, :on_rbracket].include?(tk[:kind]) ||
1057
+ (:on_kw == tk[:kind] && 'end' == tk[:text]) then
1058
+ nest -= 1
1059
+ elsif (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) then
1060
+ unget_tk tk
1061
+ if nest <= 0 and RDoc::Parser::RipperStateLex.end?(tk) then
1062
+ body = get_tkread_clean(/^[ \t]+/, '')
1063
+ read_documentation_modifiers constant, RDoc::CONSTANT_MODIFIERS
1064
+ break
1065
+ else
1066
+ read_documentation_modifiers constant, RDoc::CONSTANT_MODIFIERS
1067
+ end
1068
+ elsif :on_const == tk[:kind] then
1069
+ rhs_name << tk[:text]
1070
+
1071
+ next_tk = peek_tk
1072
+ if nest <= 0 and (next_tk.nil? || :on_nl == next_tk[:kind]) then
1073
+ create_module_alias container, constant, rhs_name unless is_array_or_hash
1074
+ break
1075
+ end
1076
+ elsif :on_nl == tk[:kind] then
1077
+ if nest <= 0 and RDoc::Parser::RipperStateLex.end?(tk) then
1078
+ unget_tk tk
1079
+ break
1080
+ end
1081
+ elsif :on_op == tk[:kind] && '::' == tk[:text]
1082
+ rhs_name << '::'
1083
+ end
1084
+ tk = get_tk
1085
+ end
1086
+
1087
+ body ? body : get_tkread_clean(/^[ \t]+/, '')
1088
+ end
1089
+
1090
+ ##
1091
+ # Generates an RDoc::Method or RDoc::Attr from +comment+ by looking for
1092
+ # :method: or :attr: directives in +comment+.
1093
+
1094
+ def parse_comment container, tk, comment
1095
+ return parse_comment_tomdoc container, tk, comment if @markup == 'tomdoc'
1096
+ column = tk[:char_no]
1097
+ line_no = comment.line.nil? ? tk[:line_no] : comment.line
1098
+
1099
+ comment.text = comment.text.sub(/(^# +:?)(singleton-)(method:)/, '\1\3')
1100
+ singleton = !!$~
1101
+
1102
+ co =
1103
+ if (comment.text = comment.text.sub(/^# +:?method: *(\S*).*?\n/i, '')) && !!$~ then
1104
+ line_no += $`.count("\n")
1105
+ parse_comment_ghost container, comment.text, $1, column, line_no, comment
1106
+ elsif (comment.text = comment.text.sub(/# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i, '')) && !!$~ then
1107
+ parse_comment_attr container, $1, $3, comment
1108
+ end
1109
+
1110
+ if co then
1111
+ co.singleton = singleton
1112
+ co.line = line_no
1113
+ end
1114
+
1115
+ true
1116
+ end
1117
+
1118
+ ##
1119
+ # Parse a comment that is describing an attribute in +container+ with the
1120
+ # given +name+ and +comment+.
1121
+
1122
+ def parse_comment_attr container, type, name, comment # :nodoc:
1123
+ return if name.empty?
1124
+
1125
+ rw = case type
1126
+ when 'attr_reader' then 'R'
1127
+ when 'attr_writer' then 'W'
1128
+ else 'RW'
1129
+ end
1130
+
1131
+ create_attr container, NORMAL, name, rw, comment
1132
+ end
1133
+
1134
+ def parse_comment_ghost container, text, name, column, line_no, # :nodoc:
1135
+ comment
1136
+ name = nil if name.empty?
1137
+
1138
+ meth = RDoc::GhostMethod.new get_tkread, name
1139
+ record_location meth
1140
+
1141
+ meth.start_collecting_tokens
1142
+ indent = RDoc::Parser::RipperStateLex::Token.new(1, 1, :on_sp, ' ' * column)
1143
+ position_comment = RDoc::Parser::RipperStateLex::Token.new(line_no, 1, :on_comment)
1144
+ position_comment[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
1145
+ newline = RDoc::Parser::RipperStateLex::Token.new(0, 0, :on_nl, "\n")
1146
+ meth.add_tokens [position_comment, newline, indent]
1147
+
1148
+ meth.params =
1149
+ if text.sub!(/^#\s+:?args?:\s*(.*?)\s*$/i, '') then
1150
+ $1
1151
+ else
1152
+ ''
1153
+ end
1154
+
1155
+ comment.normalize
1156
+ comment.extract_call_seq meth
1157
+
1158
+ return unless meth.name
1159
+
1160
+ container.add_method meth
1161
+
1162
+ meth.comment = comment
1163
+
1164
+ @stats.add_method meth
1165
+
1166
+ meth
1167
+ end
1168
+
1169
+ ##
1170
+ # Creates an RDoc::Method on +container+ from +comment+ if there is a
1171
+ # Signature section in the comment
1172
+
1173
+ def parse_comment_tomdoc container, tk, comment
1174
+ return unless signature = RDoc::TomDoc.signature(comment)
1175
+ column = tk[:char_no]
1176
+ line_no = tk[:line_no]
1177
+
1178
+ name, = signature.split %r%[ \(]%, 2
1179
+
1180
+ meth = RDoc::GhostMethod.new get_tkread, name
1181
+ record_location meth
1182
+ meth.line = line_no
1183
+
1184
+ meth.start_collecting_tokens
1185
+ indent = RDoc::Parser::RipperStateLex::Token.new(1, 1, :on_sp, ' ' * column)
1186
+ position_comment = RDoc::Parser::RipperStateLex::Token.new(line_no, 1, :on_comment)
1187
+ position_comment[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
1188
+ newline = RDoc::Parser::RipperStateLex::Token.new(0, 0, :on_nl, "\n")
1189
+ meth.add_tokens [position_comment, newline, indent]
1190
+
1191
+ meth.call_seq = signature
1192
+
1193
+ comment.normalize
1194
+
1195
+ return unless meth.name
1196
+
1197
+ container.add_method meth
1198
+
1199
+ meth.comment = comment
1200
+
1201
+ @stats.add_method meth
1202
+ end
1203
+
1204
+ ##
1205
+ # Parses an +include+ or +extend+, indicated by the +klass+ and adds it to
1206
+ # +container+ # with +comment+
1207
+
1208
+ def parse_extend_or_include klass, container, comment # :nodoc:
1209
+ loop do
1210
+ skip_tkspace_comment
1211
+
1212
+ name = get_included_module_with_optional_parens
1213
+
1214
+ unless name.empty? then
1215
+ obj = container.add klass, name, comment
1216
+ record_location obj
1217
+ end
1218
+
1219
+ return if peek_tk.nil? || :on_comma != peek_tk[:kind]
1220
+
1221
+ get_tk
1222
+ end
1223
+ end
1224
+
1225
+ ##
1226
+ # Parses an +included+ with a block feature of ActiveSupport::Concern.
1227
+
1228
+ def parse_included_with_activesupport_concern container, comment # :nodoc:
1229
+ skip_tkspace_without_nl
1230
+ tk = get_tk
1231
+ unless tk[:kind] == :on_lbracket || (tk[:kind] == :on_kw && tk[:text] == 'do')
1232
+ unget_tk tk
1233
+ return nil # should be a block
1234
+ end
1235
+
1236
+ parse_statements container
1237
+
1238
+ container
1239
+ end
1240
+
1241
+ ##
1242
+ # Parses identifiers that can create new methods or change visibility.
1243
+ #
1244
+ # Returns true if the comment was not consumed.
1245
+
1246
+ def parse_identifier container, single, tk, comment # :nodoc:
1247
+ case tk[:text]
1248
+ when 'private', 'protected', 'public', 'private_class_method',
1249
+ 'public_class_method', 'module_function' then
1250
+ parse_visibility container, single, tk
1251
+ return true
1252
+ when 'private_constant', 'public_constant'
1253
+ parse_constant_visibility container, single, tk
1254
+ return true
1255
+ when 'attr' then
1256
+ parse_attr container, single, tk, comment
1257
+ when /^attr_(reader|writer|accessor)$/ then
1258
+ parse_attr_accessor container, single, tk, comment
1259
+ when 'alias_method' then
1260
+ parse_alias container, single, tk, comment
1261
+ when 'require', 'include' then
1262
+ # ignore
1263
+ else
1264
+ if comment.text =~ /\A#\#$/ then
1265
+ case comment.text
1266
+ when /^# +:?attr(_reader|_writer|_accessor)?:/ then
1267
+ parse_meta_attr container, single, tk, comment
1268
+ else
1269
+ method = parse_meta_method container, single, tk, comment
1270
+ method.params = container.params if
1271
+ container.params
1272
+ method.block_params = container.block_params if
1273
+ container.block_params
1274
+ end
1275
+ end
1276
+ end
1277
+
1278
+ false
1279
+ end
1280
+
1281
+ ##
1282
+ # Parses a meta-programmed attribute and creates an RDoc::Attr.
1283
+ #
1284
+ # To create foo and bar attributes on class C with comment "My attributes":
1285
+ #
1286
+ # class C
1287
+ #
1288
+ # ##
1289
+ # # :attr:
1290
+ # #
1291
+ # # My attributes
1292
+ #
1293
+ # my_attr :foo, :bar
1294
+ #
1295
+ # end
1296
+ #
1297
+ # To create a foo attribute on class C with comment "My attribute":
1298
+ #
1299
+ # class C
1300
+ #
1301
+ # ##
1302
+ # # :attr: foo
1303
+ # #
1304
+ # # My attribute
1305
+ #
1306
+ # my_attr :foo, :bar
1307
+ #
1308
+ # end
1309
+
1310
+ def parse_meta_attr(context, single, tk, comment)
1311
+ args = parse_symbol_arg
1312
+ rw = "?"
1313
+
1314
+ # If nodoc is given, don't document any of them
1315
+
1316
+ tmp = RDoc::CodeObject.new
1317
+ read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS
1318
+
1319
+ regexp = /^# +:?(attr(_reader|_writer|_accessor)?): *(\S*).*?\n/i
1320
+ if regexp =~ comment.text then
1321
+ comment.text = comment.text.sub(regexp, '')
1322
+ rw = case $1
1323
+ when 'attr_reader' then 'R'
1324
+ when 'attr_writer' then 'W'
1325
+ else 'RW'
1326
+ end
1327
+ name = $3 unless $3.empty?
1328
+ end
1329
+
1330
+ if name then
1331
+ att = create_attr context, single, name, rw, comment
1332
+ else
1333
+ args.each do |attr_name|
1334
+ att = create_attr context, single, attr_name, rw, comment
1335
+ end
1336
+ end
1337
+
1338
+ att
1339
+ end
1340
+
1341
+ ##
1342
+ # Parses a meta-programmed method
1343
+
1344
+ def parse_meta_method(container, single, tk, comment)
1345
+ column = tk[:char_no]
1346
+ line_no = tk[:line_no]
1347
+
1348
+ start_collecting_tokens
1349
+ add_token tk
1350
+ add_token_listener self
1351
+
1352
+ skip_tkspace_without_nl
1353
+
1354
+ comment.text = comment.text.sub(/(^# +:?)(singleton-)(method:)/, '\1\3')
1355
+ singleton = !!$~
1356
+
1357
+ name = parse_meta_method_name comment, tk
1358
+
1359
+ return unless name
1360
+
1361
+ meth = RDoc::MetaMethod.new get_tkread, name
1362
+ record_location meth
1363
+ meth.line = line_no
1364
+ meth.singleton = singleton
1365
+
1366
+ remove_token_listener self
1367
+
1368
+ meth.start_collecting_tokens
1369
+ indent = RDoc::Parser::RipperStateLex::Token.new(1, 1, :on_sp, ' ' * column)
1370
+ position_comment = RDoc::Parser::RipperStateLex::Token.new(line_no, 1, :on_comment)
1371
+ position_comment[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
1372
+ newline = RDoc::Parser::RipperStateLex::Token.new(0, 0, :on_nl, "\n")
1373
+ meth.add_tokens [position_comment, newline, indent]
1374
+ meth.add_tokens @token_stream
1375
+
1376
+ parse_meta_method_params container, single, meth, tk, comment
1377
+
1378
+ meth.comment = comment
1379
+
1380
+ @stats.add_method meth
1381
+
1382
+ meth
1383
+ end
1384
+
1385
+ ##
1386
+ # Parses the name of a metaprogrammed method. +comment+ is used to
1387
+ # determine the name while +tk+ is used in an error message if the name
1388
+ # cannot be determined.
1389
+
1390
+ def parse_meta_method_name comment, tk # :nodoc:
1391
+ if comment.text.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
1392
+ return $1 unless $1.empty?
1393
+ end
1394
+
1395
+ name_t = get_tk
1396
+
1397
+ if :on_symbol == name_t[:kind] then
1398
+ name_t[:text][1..-1]
1399
+ elsif :on_tstring == name_t[:kind] then
1400
+ name_t[:text][1..-2]
1401
+ elsif :on_op == name_t[:kind] && '=' == name_t[:text] then # ignore
1402
+ remove_token_listener self
1403
+
1404
+ nil
1405
+ else
1406
+ warn "unknown name token #{name_t.inspect} for meta-method '#{tk[:text]}'"
1407
+ 'unknown'
1408
+ end
1409
+ end
1410
+
1411
+ ##
1412
+ # Parses the parameters and block for a meta-programmed method.
1413
+
1414
+ def parse_meta_method_params container, single, meth, tk, comment # :nodoc:
1415
+ token_listener meth do
1416
+ meth.params = ''
1417
+
1418
+ look_for_directives_in meth, comment
1419
+ comment.normalize
1420
+ comment.extract_call_seq meth
1421
+
1422
+ container.add_method meth
1423
+
1424
+ last_tk = tk
1425
+
1426
+ while tk = get_tk do
1427
+ if :on_semicolon == tk[:kind] then
1428
+ break
1429
+ elsif :on_nl == tk[:kind] then
1430
+ break unless last_tk and :on_comma == last_tk[:kind]
1431
+ elsif :on_sp == tk[:kind] then
1432
+ # expression continues
1433
+ elsif :on_kw == tk[:kind] && 'do' == tk[:text] then
1434
+ parse_statements container, single, meth
1435
+ break
1436
+ else
1437
+ last_tk = tk
1438
+ end
1439
+ end
1440
+ end
1441
+ end
1442
+
1443
+ ##
1444
+ # Parses a normal method defined by +def+
1445
+
1446
+ def parse_method(container, single, tk, comment)
1447
+ singleton = nil
1448
+ added_container = false
1449
+ name = nil
1450
+ column = tk[:char_no]
1451
+ line_no = tk[:line_no]
1452
+
1453
+ start_collecting_tokens
1454
+ add_token tk
1455
+
1456
+ token_listener self do
1457
+ prev_container = container
1458
+ name, container, singleton = parse_method_name container
1459
+ added_container = container != prev_container
1460
+ end
1461
+
1462
+ return unless name
1463
+
1464
+ meth = RDoc::AnyMethod.new get_tkread, name
1465
+ look_for_directives_in meth, comment
1466
+ meth.singleton = single == SINGLE ? true : singleton
1467
+ if singleton
1468
+ # `current_line_visibility' is useless because it works against
1469
+ # the normal method named as same as the singleton method, after
1470
+ # the latter was defined. Of course these are different things.
1471
+ container.current_line_visibility = :public
1472
+ end
1473
+
1474
+ record_location meth
1475
+ meth.line = line_no
1476
+
1477
+ meth.start_collecting_tokens
1478
+ indent = RDoc::Parser::RipperStateLex::Token.new(1, 1, :on_sp, ' ' * column)
1479
+ token = RDoc::Parser::RipperStateLex::Token.new(line_no, 1, :on_comment)
1480
+ token[:text] = "# File #{@top_level.relative_name}, line #{line_no}"
1481
+ newline = RDoc::Parser::RipperStateLex::Token.new(0, 0, :on_nl, "\n")
1482
+ meth.add_tokens [token, newline, indent]
1483
+ meth.add_tokens @token_stream
1484
+
1485
+ parse_method_params_and_body container, single, meth, added_container
1486
+
1487
+ comment.normalize
1488
+ comment.extract_call_seq meth
1489
+
1490
+ meth.comment = comment
1491
+
1492
+ # after end modifiers
1493
+ read_documentation_modifiers meth, RDoc::METHOD_MODIFIERS
1494
+
1495
+ @stats.add_method meth
1496
+ end
1497
+
1498
+ ##
1499
+ # Parses the parameters and body of +meth+
1500
+
1501
+ def parse_method_params_and_body container, single, meth, added_container
1502
+ token_listener meth do
1503
+ parse_method_parameters meth
1504
+
1505
+ if meth.document_self or not @track_visibility then
1506
+ container.add_method meth
1507
+ elsif added_container then
1508
+ container.document_self = false
1509
+ end
1510
+
1511
+ # Having now read the method parameters and documentation modifiers, we
1512
+ # now know whether we have to rename #initialize to ::new
1513
+
1514
+ if meth.name == "initialize" && !meth.singleton then
1515
+ if meth.dont_rename_initialize then
1516
+ meth.visibility = :protected
1517
+ else
1518
+ meth.singleton = true
1519
+ meth.name = "new"
1520
+ meth.visibility = :public
1521
+ end
1522
+ end
1523
+
1524
+ parse_statements container, single, meth
1525
+ end
1526
+ end
1527
+
1528
+ ##
1529
+ # Parses a method that needs to be ignored.
1530
+
1531
+ def parse_method_dummy container
1532
+ dummy = RDoc::Context.new
1533
+ dummy.parent = container
1534
+ dummy.store = container.store
1535
+ skip_method dummy
1536
+ end
1537
+
1538
+ ##
1539
+ # Parses the name of a method in +container+.
1540
+ #
1541
+ # Returns the method name, the container it is in (for def Foo.name) and if
1542
+ # it is a singleton or regular method.
1543
+
1544
+ def parse_method_name container # :nodoc:
1545
+ skip_tkspace
1546
+ name_t = get_tk
1547
+ back_tk = skip_tkspace_without_nl
1548
+ singleton = false
1549
+
1550
+ dot = get_tk
1551
+ if dot[:kind] == :on_period || (dot[:kind] == :on_op && dot[:text] == '::') then
1552
+ singleton = true
1553
+
1554
+ name, container = parse_method_name_singleton container, name_t
1555
+ else
1556
+ unget_tk dot
1557
+ back_tk.reverse_each do |token|
1558
+ unget_tk token
1559
+ end
1560
+
1561
+ name = parse_method_name_regular container, name_t
1562
+ end
1563
+
1564
+ return name, container, singleton
1565
+ end
1566
+
1567
+ ##
1568
+ # For the given +container+ and initial name token +name_t+ the method name
1569
+ # is parsed from the token stream for a regular method.
1570
+
1571
+ def parse_method_name_regular container, name_t # :nodoc:
1572
+ if :on_op == name_t[:kind] && (%w{* & [] []= <<}.include?(name_t[:text])) then
1573
+ name_t[:text]
1574
+ else
1575
+ unless [:on_kw, :on_const, :on_ident].include?(name_t[:kind]) then
1576
+ warn "expected method name token, . or ::, got #{name_t.inspect}"
1577
+ skip_method container
1578
+ return
1579
+ end
1580
+ name_t[:text]
1581
+ end
1582
+ end
1583
+
1584
+ ##
1585
+ # For the given +container+ and initial name token +name_t+ the method name
1586
+ # and the new +container+ (if necessary) are parsed from the token stream
1587
+ # for a singleton method.
1588
+
1589
+ def parse_method_name_singleton container, name_t # :nodoc:
1590
+ skip_tkspace
1591
+ name_t2 = get_tk
1592
+
1593
+ if (:on_kw == name_t[:kind] && 'self' == name_t[:text]) || (:on_op == name_t[:kind] && '%' == name_t[:text]) then
1594
+ # NOTE: work around '[' being consumed early
1595
+ if :on_lbracket == name_t2[:kind]
1596
+ get_tk
1597
+ name = '[]'
1598
+ else
1599
+ name = name_t2[:text]
1600
+ end
1601
+ elsif :on_const == name_t[:kind] then
1602
+ name = name_t2[:text]
1603
+
1604
+ container = get_method_container container, name_t
1605
+
1606
+ return unless container
1607
+
1608
+ name
1609
+ elsif :on_ident == name_t[:kind] || :on_ivar == name_t[:kind] || :on_gvar == name_t[:kind] then
1610
+ parse_method_dummy container
1611
+
1612
+ name = nil
1613
+ elsif (:on_kw == name_t[:kind]) && ('true' == name_t[:text] || 'false' == name_t[:text] || 'nil' == name_t[:text]) then
1614
+ klass_name = "#{name_t[:text].capitalize}Class"
1615
+ container = @store.find_class_named klass_name
1616
+ container ||= @top_level.add_class RDoc::NormalClass, klass_name
1617
+
1618
+ name = name_t2[:text]
1619
+ else
1620
+ warn "unexpected method name token #{name_t.inspect}"
1621
+ # break
1622
+ skip_method container
1623
+
1624
+ name = nil
1625
+ end
1626
+
1627
+ return name, container
1628
+ end
1629
+
1630
+ ##
1631
+ # Extracts +yield+ parameters from +method+
1632
+
1633
+ def parse_method_or_yield_parameters(method = nil,
1634
+ modifiers = RDoc::METHOD_MODIFIERS)
1635
+ skip_tkspace_without_nl
1636
+ tk = get_tk
1637
+ end_token = get_end_token tk
1638
+ return '' unless end_token
1639
+
1640
+ nest = 0
1641
+ continue = false
1642
+
1643
+ while tk != nil do
1644
+ case tk[:kind]
1645
+ when :on_semicolon then
1646
+ break if nest == 0
1647
+ when :on_lbracket then
1648
+ nest += 1
1649
+ when :on_rbracket then
1650
+ nest -= 1
1651
+ when :on_lbrace then
1652
+ nest += 1
1653
+ when :on_rbrace then
1654
+ nest -= 1
1655
+ if nest <= 0
1656
+ # we might have a.each { |i| yield i }
1657
+ unget_tk(tk) if nest < 0
1658
+ break
1659
+ end
1660
+ when :on_lparen then
1661
+ nest += 1
1662
+ when end_token[:kind] then
1663
+ if end_token[:kind] == :on_rparen
1664
+ nest -= 1
1665
+ break if nest <= 0
1666
+ else
1667
+ break
1668
+ end
1669
+ when :on_rparen then
1670
+ nest -= 1
1671
+ when :on_comment, :on_embdoc then
1672
+ @read.pop
1673
+ if :on_nl == end_token[:kind] and "\n" == tk[:text][-1] and
1674
+ (!continue or (tk[:state] & Ripper::EXPR_LABEL) != 0) then
1675
+ if method && method.block_params.nil? then
1676
+ unget_tk tk
1677
+ read_documentation_modifiers method, modifiers
1678
+ end
1679
+ break if !continue and nest <= 0
1680
+ end
1681
+ when :on_comma then
1682
+ continue = true
1683
+ when :on_ident then
1684
+ continue = false if continue
1685
+ end
1686
+ tk = get_tk
1687
+ end
1688
+
1689
+ get_tkread_clean(/\s+/, ' ')
1690
+ end
1691
+
1692
+ ##
1693
+ # Capture the method's parameters. Along the way, look for a comment
1694
+ # containing:
1695
+ #
1696
+ # # yields: ....
1697
+ #
1698
+ # and add this as the block_params for the method
1699
+
1700
+ def parse_method_parameters method
1701
+ res = parse_method_or_yield_parameters method
1702
+
1703
+ res = "(#{res})" unless res =~ /\A\(/
1704
+ method.params = res unless method.params
1705
+
1706
+ return if method.block_params
1707
+
1708
+ skip_tkspace_without_nl
1709
+ read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
1710
+ end
1711
+
1712
+ ##
1713
+ # Parses an RDoc::NormalModule in +container+ with +comment+
1714
+
1715
+ def parse_module container, single, tk, comment
1716
+ container, name_t, = get_class_or_module container
1717
+
1718
+ name = name_t[:text]
1719
+
1720
+ mod = container.add_module RDoc::NormalModule, name
1721
+ mod.ignore unless container.document_children
1722
+ record_location mod
1723
+
1724
+ read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
1725
+ mod.add_comment comment, @top_level
1726
+ parse_statements mod
1727
+
1728
+ # after end modifiers
1729
+ read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
1730
+
1731
+ @stats.add_module mod
1732
+ end
1733
+
1734
+ ##
1735
+ # Parses an RDoc::Require in +context+ containing +comment+
1736
+
1737
+ def parse_require(context, comment)
1738
+ skip_tkspace_comment
1739
+ tk = get_tk
1740
+
1741
+ if :on_lparen == tk[:kind] then
1742
+ skip_tkspace_comment
1743
+ tk = get_tk
1744
+ end
1745
+
1746
+ name = tk[:text][1..-2] if :on_tstring == tk[:kind]
1747
+
1748
+ if name then
1749
+ @top_level.add_require RDoc::Require.new(name, comment)
1750
+ else
1751
+ unget_tk tk
1752
+ end
1753
+ end
1754
+
1755
+ ##
1756
+ # Parses a rescue
1757
+
1758
+ def parse_rescue
1759
+ skip_tkspace_without_nl
1760
+
1761
+ while tk = get_tk
1762
+ case tk[:kind]
1763
+ when :on_nl, :on_semicolon, :on_comment then
1764
+ break
1765
+ when :on_comma then
1766
+ skip_tkspace_without_nl
1767
+
1768
+ get_tk if :on_nl == peek_tk[:kind]
1769
+ end
1770
+
1771
+ skip_tkspace_without_nl
1772
+ end
1773
+ end
1774
+
1775
+ ##
1776
+ # Retrieve comment body without =begin/=end
1777
+
1778
+ def retrieve_comment_body(tk)
1779
+ if :on_embdoc == tk[:kind]
1780
+ tk[:text].gsub(/\A=begin.*\n/, '').gsub(/=end\n?\z/, '')
1781
+ else
1782
+ tk[:text]
1783
+ end
1784
+ end
1785
+
1786
+ ##
1787
+ # The core of the Ruby parser.
1788
+
1789
+ def parse_statements(container, single = NORMAL, current_method = nil,
1790
+ comment = new_comment(''))
1791
+ raise 'no' unless RDoc::Comment === comment
1792
+ comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
1793
+
1794
+ nest = 1
1795
+ save_visibility = container.visibility
1796
+ container.visibility = :public unless current_method
1797
+
1798
+ non_comment_seen = true
1799
+
1800
+ while tk = get_tk do
1801
+ keep_comment = false
1802
+ try_parse_comment = false
1803
+
1804
+ non_comment_seen = true unless (:on_comment == tk[:kind] or :on_embdoc == tk[:kind])
1805
+
1806
+ case tk[:kind]
1807
+ when :on_nl, :on_ignored_nl, :on_comment, :on_embdoc then
1808
+ if :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
1809
+ skip_tkspace
1810
+ tk = get_tk
1811
+ else
1812
+ past_tokens = @read.size > 1 ? @read[0..-2] : []
1813
+ nl_position = 0
1814
+ past_tokens.reverse.each_with_index do |read_tk, i|
1815
+ if read_tk =~ /^\n$/ then
1816
+ nl_position = (past_tokens.size - 1) - i
1817
+ break
1818
+ elsif read_tk =~ /^#.*\n$/ then
1819
+ nl_position = ((past_tokens.size - 1) - i) + 1
1820
+ break
1821
+ end
1822
+ end
1823
+ comment_only_line = past_tokens[nl_position..-1].all?{ |c| c =~ /^\s+$/ }
1824
+ unless comment_only_line then
1825
+ tk = get_tk
1826
+ end
1827
+ end
1828
+
1829
+ if tk and (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) then
1830
+ if non_comment_seen then
1831
+ # Look for RDoc in a comment about to be thrown away
1832
+ non_comment_seen = parse_comment container, tk, comment unless
1833
+ comment.empty?
1834
+
1835
+ comment = ''
1836
+ comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
1837
+ end
1838
+
1839
+ line_no = nil
1840
+ while tk and (:on_comment == tk[:kind] or :on_embdoc == tk[:kind]) do
1841
+ comment_body = retrieve_comment_body(tk)
1842
+ line_no = tk[:line_no] if comment.empty?
1843
+ comment += comment_body
1844
+ comment << "\n" unless comment_body =~ /\n\z/
1845
+
1846
+ if comment_body.size > 1 && comment_body =~ /\n\z/ then
1847
+ skip_tkspace_without_nl # leading spaces
1848
+ end
1849
+ tk = get_tk
1850
+ end
1851
+
1852
+ comment = new_comment comment, line_no
1853
+
1854
+ unless comment.empty? then
1855
+ look_for_directives_in container, comment
1856
+
1857
+ if container.done_documenting then
1858
+ throw :eof if RDoc::TopLevel === container
1859
+ container.ongoing_visibility = save_visibility
1860
+ end
1861
+ end
1862
+
1863
+ keep_comment = true
1864
+ else
1865
+ non_comment_seen = true
1866
+ end
1867
+
1868
+ unget_tk tk
1869
+ keep_comment = true
1870
+ container.current_line_visibility = nil
1871
+
1872
+ when :on_kw then
1873
+ case tk[:text]
1874
+ when 'class' then
1875
+ parse_class container, single, tk, comment
1876
+
1877
+ when 'module' then
1878
+ parse_module container, single, tk, comment
1879
+
1880
+ when 'def' then
1881
+ parse_method container, single, tk, comment
1882
+
1883
+ when 'alias' then
1884
+ parse_alias container, single, tk, comment unless current_method
1885
+
1886
+ when 'yield' then
1887
+ if current_method.nil? then
1888
+ warn "Warning: yield outside of method" if container.document_self
1889
+ else
1890
+ parse_yield container, single, tk, current_method
1891
+ end
1892
+
1893
+ when 'until', 'while' then
1894
+ if (tk[:state] & Ripper::EXPR_LABEL) == 0
1895
+ nest += 1
1896
+ skip_optional_do_after_expression
1897
+ end
1898
+
1899
+ # Until and While can have a 'do', which shouldn't increase the nesting.
1900
+ # We can't solve the general case, but we can handle most occurrences by
1901
+ # ignoring a do at the end of a line.
1902
+
1903
+ # 'for' is trickier
1904
+ when 'for' then
1905
+ nest += 1
1906
+ skip_for_variable
1907
+ skip_optional_do_after_expression
1908
+
1909
+ when 'case', 'do', 'if', 'unless', 'begin' then
1910
+ if (tk[:state] & Ripper::EXPR_LABEL) == 0
1911
+ nest += 1
1912
+ end
1913
+
1914
+ when 'super' then
1915
+ current_method.calls_super = true if current_method
1916
+
1917
+ when 'rescue' then
1918
+ parse_rescue
1919
+
1920
+ when 'end' then
1921
+ nest -= 1
1922
+ if nest == 0 then
1923
+ container.ongoing_visibility = save_visibility
1924
+
1925
+ parse_comment container, tk, comment unless comment.empty?
1926
+
1927
+ return
1928
+ end
1929
+ end
1930
+
1931
+ when :on_const then
1932
+ unless parse_constant container, tk, comment, current_method then
1933
+ try_parse_comment = true
1934
+ end
1935
+
1936
+ when :on_ident then
1937
+ if nest == 1 and current_method.nil? then
1938
+ keep_comment = parse_identifier container, single, tk, comment
1939
+ end
1940
+
1941
+ case tk[:text]
1942
+ when "require" then
1943
+ parse_require container, comment
1944
+ when "include" then
1945
+ parse_extend_or_include RDoc::Include, container, comment
1946
+ when "extend" then
1947
+ parse_extend_or_include RDoc::Extend, container, comment
1948
+ when "included" then
1949
+ parse_included_with_activesupport_concern container, comment
1950
+ end
1951
+
1952
+ else
1953
+ try_parse_comment = nest == 1
1954
+ end
1955
+
1956
+ if try_parse_comment then
1957
+ non_comment_seen = parse_comment container, tk, comment unless
1958
+ comment.empty?
1959
+
1960
+ keep_comment = false
1961
+ end
1962
+
1963
+ unless keep_comment then
1964
+ comment = new_comment ''
1965
+ comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
1966
+ container.params = nil
1967
+ container.block_params = nil
1968
+ end
1969
+
1970
+ consume_trailing_spaces
1971
+ end
1972
+
1973
+ container.params = nil
1974
+ container.block_params = nil
1975
+ end
1976
+
1977
+ ##
1978
+ # Parse up to +no+ symbol arguments
1979
+
1980
+ def parse_symbol_arg(no = nil)
1981
+ skip_tkspace_comment
1982
+
1983
+ tk = get_tk
1984
+ if tk[:kind] == :on_lparen
1985
+ parse_symbol_arg_paren no
1986
+ else
1987
+ parse_symbol_arg_space no, tk
1988
+ end
1989
+ end
1990
+
1991
+ ##
1992
+ # Parses up to +no+ symbol arguments surrounded by () and places them in
1993
+ # +args+.
1994
+
1995
+ def parse_symbol_arg_paren no # :nodoc:
1996
+ args = []
1997
+
1998
+ loop do
1999
+ skip_tkspace_comment
2000
+ if tk1 = parse_symbol_in_arg
2001
+ args.push tk1
2002
+ break if no and args.size >= no
2003
+ end
2004
+
2005
+ skip_tkspace_comment
2006
+ case (tk2 = get_tk)[:kind]
2007
+ when :on_rparen
2008
+ break
2009
+ when :on_comma
2010
+ else
2011
+ warn("unexpected token: '#{tk2.inspect}'") if $DEBUG_RDOC
2012
+ break
2013
+ end
2014
+ end
2015
+
2016
+ args
2017
+ end
2018
+
2019
+ ##
2020
+ # Parses up to +no+ symbol arguments separated by spaces and places them in
2021
+ # +args+.
2022
+
2023
+ def parse_symbol_arg_space no, tk # :nodoc:
2024
+ args = []
2025
+
2026
+ unget_tk tk
2027
+ if tk = parse_symbol_in_arg
2028
+ args.push tk
2029
+ return args if no and args.size >= no
2030
+ end
2031
+
2032
+ loop do
2033
+ skip_tkspace_without_nl
2034
+
2035
+ tk1 = get_tk
2036
+ if tk1.nil? || :on_comma != tk1[:kind] then
2037
+ unget_tk tk1
2038
+ break
2039
+ end
2040
+
2041
+ skip_tkspace_comment
2042
+ if tk = parse_symbol_in_arg
2043
+ args.push tk
2044
+ break if no and args.size >= no
2045
+ end
2046
+ end
2047
+
2048
+ args
2049
+ end
2050
+
2051
+ ##
2052
+ # Returns symbol text from the next token
2053
+
2054
+ def parse_symbol_in_arg
2055
+ tk = get_tk
2056
+ if :on_symbol == tk[:kind] then
2057
+ tk[:text].sub(/^:/, '')
2058
+ elsif :on_tstring == tk[:kind] then
2059
+ tk[:text][1..-2]
2060
+ elsif :on_dstring == tk[:kind] or :on_ident == tk[:kind] then
2061
+ nil # ignore
2062
+ else
2063
+ warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG_RDOC
2064
+ nil
2065
+ end
2066
+ end
2067
+
2068
+ ##
2069
+ # Parses statements in the top-level +container+
2070
+
2071
+ def parse_top_level_statements container
2072
+ comment = collect_first_comment
2073
+
2074
+ look_for_directives_in container, comment
2075
+
2076
+ throw :eof if container.done_documenting
2077
+
2078
+ @markup = comment.format
2079
+
2080
+ # HACK move if to RDoc::Context#comment=
2081
+ container.comment = comment if container.document_self unless comment.empty?
2082
+
2083
+ parse_statements container, NORMAL, nil, comment
2084
+ end
2085
+
2086
+ ##
2087
+ # Determines the visibility in +container+ from +tk+
2088
+
2089
+ def parse_visibility(container, single, tk)
2090
+ vis_type, vis, singleton = get_visibility_information tk, single
2091
+
2092
+ skip_tkspace_comment false
2093
+
2094
+ ptk = peek_tk
2095
+ # Ryan Davis suggested the extension to ignore modifiers, because he
2096
+ # often writes
2097
+ #
2098
+ # protected unless $TESTING
2099
+ #
2100
+ if [:on_nl, :on_semicolon].include?(ptk[:kind]) || (:on_kw == ptk[:kind] && (['if', 'unless'].include?(ptk[:text]))) then
2101
+ container.ongoing_visibility = vis
2102
+ elsif :on_kw == ptk[:kind] && 'def' == ptk[:text]
2103
+ container.current_line_visibility = vis
2104
+ else
2105
+ update_visibility container, vis_type, vis, singleton
2106
+ end
2107
+ end
2108
+
2109
+ ##
2110
+ # Parses a Module#private_constant or Module#public_constant call from +tk+.
2111
+
2112
+ def parse_constant_visibility(container, single, tk)
2113
+ args = parse_symbol_arg
2114
+ case tk[:text]
2115
+ when 'private_constant'
2116
+ vis = :private
2117
+ when 'public_constant'
2118
+ vis = :public
2119
+ else
2120
+ raise RDoc::Error, 'Unreachable'
2121
+ end
2122
+ container.set_constant_visibility_for args, vis
2123
+ end
2124
+
2125
+ ##
2126
+ # Determines the block parameter for +context+
2127
+
2128
+ def parse_yield(context, single, tk, method)
2129
+ return if method.block_params
2130
+
2131
+ get_tkread
2132
+ method.block_params = parse_method_or_yield_parameters
2133
+ end
2134
+
2135
+ ##
2136
+ # Directives are modifier comments that can appear after class, module, or
2137
+ # method names. For example:
2138
+ #
2139
+ # def fred # :yields: a, b
2140
+ #
2141
+ # or:
2142
+ #
2143
+ # class MyClass # :nodoc:
2144
+ #
2145
+ # We return the directive name and any parameters as a two element array if
2146
+ # the name is in +allowed+. A directive can be found anywhere up to the end
2147
+ # of the current line.
2148
+
2149
+ def read_directive allowed
2150
+ tokens = []
2151
+
2152
+ while tk = get_tk do
2153
+ tokens << tk
2154
+
2155
+ if :on_nl == tk[:kind] or (:on_kw == tk[:kind] && 'def' == tk[:text]) then
2156
+ return
2157
+ elsif :on_comment == tk[:kind] or :on_embdoc == tk[:kind] then
2158
+ return unless tk[:text] =~ /:?\b([\w-]+):\s*(.*)/
2159
+
2160
+ directive = $1.downcase
2161
+
2162
+ return [directive, $2] if allowed.include? directive
2163
+
2164
+ return
2165
+ end
2166
+ end
2167
+ ensure
2168
+ unless tokens.length == 1 and (:on_comment == tokens.first[:kind] or :on_embdoc == tokens.first[:kind]) then
2169
+ tokens.reverse_each do |token|
2170
+ unget_tk token
2171
+ end
2172
+ end
2173
+ end
2174
+
2175
+ ##
2176
+ # Handles directives following the definition for +context+ (any
2177
+ # RDoc::CodeObject) if the directives are +allowed+ at this point.
2178
+ #
2179
+ # See also RDoc::Markup::PreProcess#handle_directive
2180
+
2181
+ def read_documentation_modifiers context, allowed
2182
+ skip_tkspace_without_nl
2183
+ directive, value = read_directive allowed
2184
+
2185
+ return unless directive
2186
+
2187
+ @preprocess.handle_directive '', directive, value, context do |dir, param|
2188
+ if %w[notnew not_new not-new].include? dir then
2189
+ context.dont_rename_initialize = true
2190
+
2191
+ true
2192
+ end
2193
+ end
2194
+ end
2195
+
2196
+ ##
2197
+ # Records the location of this +container+ in the file for this parser and
2198
+ # adds it to the list of classes and modules in the file.
2199
+
2200
+ def record_location container # :nodoc:
2201
+ case container
2202
+ when RDoc::ClassModule then
2203
+ @top_level.add_to_classes_or_modules container
2204
+ end
2205
+
2206
+ container.record_location @top_level
2207
+ end
2208
+
2209
+ ##
2210
+ # Scans this Ruby file for Ruby constructs
2211
+
2212
+ def scan
2213
+ reset
2214
+
2215
+ catch :eof do
2216
+ begin
2217
+ parse_top_level_statements @top_level
2218
+
2219
+ rescue StandardError => e
2220
+ if @content.include?('<%') and @content.include?('%>') then
2221
+ # Maybe, this is ERB.
2222
+ $stderr.puts "\033[2KRDoc detects ERB file. Skips it for compatibility:"
2223
+ $stderr.puts @file_name
2224
+ return
2225
+ end
2226
+
2227
+ if @scanner_point >= @scanner.size
2228
+ now_line_no = @scanner[@scanner.size - 1][:line_no]
2229
+ else
2230
+ now_line_no = peek_tk[:line_no]
2231
+ end
2232
+ first_tk_index = @scanner.find_index { |tk| tk[:line_no] == now_line_no }
2233
+ last_tk_index = @scanner.find_index { |tk| tk[:line_no] == now_line_no + 1 }
2234
+ last_tk_index = last_tk_index ? last_tk_index - 1 : @scanner.size - 1
2235
+ code = @scanner[first_tk_index..last_tk_index].map{ |t| t[:text] }.join
2236
+
2237
+ $stderr.puts <<-EOF
2238
+
2239
+ #{self.class} failure around line #{now_line_no} of
2240
+ #{@file_name}
2241
+
2242
+ EOF
2243
+
2244
+ unless code.empty? then
2245
+ $stderr.puts code
2246
+ $stderr.puts
2247
+ end
2248
+
2249
+ raise e
2250
+ end
2251
+ end
2252
+
2253
+ @top_level
2254
+ end
2255
+
2256
+ ##
2257
+ # while, until, and for have an optional do
2258
+
2259
+ def skip_optional_do_after_expression
2260
+ skip_tkspace_without_nl
2261
+ tk = get_tk
2262
+
2263
+ b_nest = 0
2264
+ nest = 0
2265
+
2266
+ loop do
2267
+ break unless tk
2268
+ case tk[:kind]
2269
+ when :on_semicolon, :on_nl, :on_ignored_nl then
2270
+ break if b_nest.zero?
2271
+ when :on_lparen then
2272
+ nest += 1
2273
+ when :on_rparen then
2274
+ nest -= 1
2275
+ when :on_kw then
2276
+ case tk[:text]
2277
+ when 'begin'
2278
+ b_nest += 1
2279
+ when 'end'
2280
+ b_nest -= 1
2281
+ when 'do'
2282
+ break if nest.zero?
2283
+ end
2284
+ when :on_comment, :on_embdoc then
2285
+ if b_nest.zero? and "\n" == tk[:text][-1] then
2286
+ break
2287
+ end
2288
+ end
2289
+ tk = get_tk
2290
+ end
2291
+
2292
+ skip_tkspace_without_nl
2293
+
2294
+ get_tk if peek_tk && :on_kw == peek_tk[:kind] && 'do' == peek_tk[:text]
2295
+ end
2296
+
2297
+ ##
2298
+ # skip the var [in] part of a 'for' statement
2299
+
2300
+ def skip_for_variable
2301
+ skip_tkspace_without_nl
2302
+ get_tk
2303
+ skip_tkspace_without_nl
2304
+ tk = get_tk
2305
+ unget_tk(tk) unless :on_kw == tk[:kind] and 'in' == tk[:text]
2306
+ end
2307
+
2308
+ ##
2309
+ # Skips the next method in +container+
2310
+
2311
+ def skip_method container
2312
+ meth = RDoc::AnyMethod.new "", "anon"
2313
+ parse_method_parameters meth
2314
+ parse_statements container, false, meth
2315
+ end
2316
+
2317
+ ##
2318
+ # Skip spaces until a comment is found
2319
+
2320
+ def skip_tkspace_comment(skip_nl = true)
2321
+ loop do
2322
+ skip_nl ? skip_tkspace : skip_tkspace_without_nl
2323
+ next_tk = peek_tk
2324
+ return if next_tk.nil? || (:on_comment != next_tk[:kind] and :on_embdoc != next_tk[:kind])
2325
+ get_tk
2326
+ end
2327
+ end
2328
+
2329
+ ##
2330
+ # Updates visibility in +container+ from +vis_type+ and +vis+.
2331
+
2332
+ def update_visibility container, vis_type, vis, singleton # :nodoc:
2333
+ new_methods = []
2334
+
2335
+ case vis_type
2336
+ when 'module_function' then
2337
+ args = parse_symbol_arg
2338
+ container.set_visibility_for args, :private, false
2339
+
2340
+ container.methods_matching args do |m|
2341
+ s_m = m.dup
2342
+ record_location s_m
2343
+ s_m.singleton = true
2344
+ new_methods << s_m
2345
+ end
2346
+ when 'public_class_method', 'private_class_method' then
2347
+ args = parse_symbol_arg
2348
+
2349
+ container.methods_matching args, true do |m|
2350
+ if m.parent != container then
2351
+ m = m.dup
2352
+ record_location m
2353
+ new_methods << m
2354
+ end
2355
+
2356
+ m.visibility = vis
2357
+ end
2358
+ else
2359
+ args = parse_symbol_arg
2360
+ container.set_visibility_for args, vis, singleton
2361
+ end
2362
+
2363
+ new_methods.each do |method|
2364
+ case method
2365
+ when RDoc::AnyMethod then
2366
+ container.add_method method
2367
+ when RDoc::Attr then
2368
+ container.add_attribute method
2369
+ end
2370
+ method.visibility = vis
2371
+ end
2372
+ end
2373
+
2374
+ ##
2375
+ # Prints +message+ to +$stderr+ unless we're being quiet
2376
+
2377
+ def warn message
2378
+ @options.warn make_message message
2379
+ end
2380
+
2381
+ end