From 20f4f007644b841c71402a5ae64ee5373dc7b91a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 15 Dec 2023 19:36:07 +0900 Subject: [PATCH] [ruby/rdoc] [DOC] nodoc for probably internal methods https://github.com/ruby/rdoc/commit/f7dd147a8c --- lib/rdoc/generator/pot.rb | 1 + lib/rdoc/markup/attribute_manager.rb | 3 +++ lib/rdoc/markup/parser.rb | 4 ++++ lib/rdoc/markup/table.rb | 3 ++- lib/rdoc/markup/to_html.rb | 1 + lib/rdoc/markup/to_html_crossref.rb | 1 + lib/rdoc/parser/ripper_state_lex.rb | 4 ++++ 7 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/rdoc/generator/pot.rb b/lib/rdoc/generator/pot.rb index bee1133b07..b0b7c07179 100644 --- a/lib/rdoc/generator/pot.rb +++ b/lib/rdoc/generator/pot.rb @@ -81,6 +81,7 @@ class RDoc::Generator::POT end end + # :nodoc: def class_dir nil end diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_manager.rb index 1162f27284..f6eb06da95 100644 --- a/lib/rdoc/markup/attribute_manager.rb +++ b/lib/rdoc/markup/attribute_manager.rb @@ -138,6 +138,7 @@ class RDoc::Markup::AttributeManager res end + # :nodoc: def exclusive?(attr) (attr & @exclusive_bitmap) != 0 end @@ -155,6 +156,7 @@ class RDoc::Markup::AttributeManager convert_attrs_word_pair_map(str, attrs, exclusive) end + # :nodoc: def convert_attrs_matching_word_pairs(str, attrs, exclusive) # first do matching ones tags = @matching_word_pairs.select { |start, bitmap| @@ -179,6 +181,7 @@ class RDoc::Markup::AttributeManager str.delete!(NON_PRINTING_START + NON_PRINTING_END) end + # :nodoc: def convert_attrs_word_pair_map(str, attrs, exclusive) # then non-matching unless @word_pair_map.empty? then diff --git a/lib/rdoc/markup/parser.rb b/lib/rdoc/markup/parser.rb index 2ad4a65808..9c77048591 100644 --- a/lib/rdoc/markup/parser.rb +++ b/lib/rdoc/markup/parser.rb @@ -420,6 +420,8 @@ class RDoc::Markup::Parser # A simple wrapper of StringScanner that is aware of the current column and lineno class MyStringScanner + # :stopdoc: + def initialize(input) @line = @column = 0 @s = StringScanner.new input @@ -456,6 +458,8 @@ class RDoc::Markup::Parser def [](i) @s[i] end + + #:startdoc: end ## diff --git a/lib/rdoc/markup/table.rb b/lib/rdoc/markup/table.rb index 9ab1dc8ec9..27a20f073a 100644 --- a/lib/rdoc/markup/table.rb +++ b/lib/rdoc/markup/table.rb @@ -17,6 +17,7 @@ class RDoc::Markup::Table @header, @align, @body = header, align, body end + # :stopdoc: def == other self.class == other.class and @header == other.header and @@ -28,7 +29,7 @@ class RDoc::Markup::Table visitor.accept_table @header, @body, @align end - def pretty_print q # :nodoc: + def pretty_print q q.group 2, '[Table: ', ']' do q.group 2, '[Head: ', ']' do q.seplist @header.zip(@align) do |text, align| diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb index fb38924a04..91cadf9d16 100644 --- a/lib/rdoc/markup/to_html.rb +++ b/lib/rdoc/markup/to_html.rb @@ -61,6 +61,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter # # These methods are used by regexp handling markup added by RDoc::Markup#add_regexp_handling. + # :nodoc: URL_CHARACTERS_REGEXP_STR = /[A-Za-z0-9\-._~:\/\?#\[\]@!$&'\(\)*+,;%=]/.source ## diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb index 434b622495..01831461e3 100644 --- a/lib/rdoc/markup/to_html_crossref.rb +++ b/lib/rdoc/markup/to_html_crossref.rb @@ -42,6 +42,7 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml @cross_reference = RDoc::CrossReference.new @context end + # :nodoc: def init_link_notation_regexp_handlings add_regexp_handling_RDOCLINK diff --git a/lib/rdoc/parser/ripper_state_lex.rb b/lib/rdoc/parser/ripper_state_lex.rb index ff7c41829f..f6cefd0305 100644 --- a/lib/rdoc/parser/ripper_state_lex.rb +++ b/lib/rdoc/parser/ripper_state_lex.rb @@ -5,6 +5,8 @@ require 'ripper' # Wrapper for Ripper lex states class RDoc::Parser::RipperStateLex + # :stopdoc: + # TODO: Remove this constants after Ruby 2.4 EOL RIPPER_HAS_LEX_STATE = Ripper::Filter.method_defined?(:state) @@ -568,6 +570,8 @@ class RDoc::Parser::RipperStateLex tk end + # :startdoc: + # New lexer for +code+. def initialize(code) @buf = []