Skip to content

Commit 9570cdc

Browse files
committed
Remove dead code and stale comments left by the Ripper parser
- Delete lib/rdoc/parser/ruby_tools.rb (and its autoload). The RubyTools mixin -- get_tk / unget_tk / token_listener / etc. -- was only included by the Ripper parser; the Ruby parser scans tokens via Prism directly. - Drop the "When mixin is created from RDoc::Parser::Ruby, module name is already a resolved full-path name" note in mixin.rb. It only existed to contrast against the Ripper parser's unresolved names; with one parser left, it just mis-describes the lookup. - Reword the find_enclosing_module_named comment in context.rb ("stopped representing module nesting" -> "does not represent module nesting"); the past tense was relative to Ripper. - Drop "just like the old parser did" tail from the initialize/new rename comment in ruby.rb.
1 parent dd8c5b5 commit 9570cdc

5 files changed

Lines changed: 3 additions & 170 deletions

File tree

lib/rdoc/code_object/context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ def find_constant_named(name)
783783
# Tries to find a module at a higher scope.
784784
# But parent is not always a higher module nesting scope, so the result is not correct.
785785
# Parent chain can only represent last-opened nesting, and may be broken in some cases.
786-
# The Ruby parser stopped representing module nesting with parent chain at all.
786+
# The Ruby parser does not represent module nesting with the parent chain.
787787

788788
def find_enclosing_module_named(name)
789789
parent && parent.find_module_named(name)

lib/rdoc/code_object/mixin.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ def inspect # :nodoc:
7171
# lookup behavior.
7272
#
7373
# As of the beginning of October, 2011, no gem includes nonexistent modules.
74-
#
75-
# When mixin is created from RDoc::Parser::Ruby, module name is already a resolved full-path name.
76-
#
7774

7875
def module
7976
return @module if @module

lib/rdoc/parser.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ def initialize(top_level, content, options, stats)
266266
@preprocess.options = @options
267267
end
268268

269-
autoload :RubyTools, "#{__dir__}/parser/ruby_tools"
270-
autoload :Text, "#{__dir__}/parser/text"
269+
autoload :Text, "#{__dir__}/parser/text"
271270

272271
##
273272
# Normalizes tabs in +body+

lib/rdoc/parser/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def add_method(method_name, receiver_name:, receiver_fallback_type:, visibility:
682682
end
683683

684684
# Rename after add_method to register duplicated 'new' and 'initialize'
685-
# defined in c and ruby just like the old parser did.
685+
# defined in c and ruby.
686686
if !dont_rename_initialize && method_name == 'initialize' && !singleton
687687
if meth.dont_rename_initialize
688688
meth.visibility = :protected

lib/rdoc/parser/ruby_tools.rb

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)