Skip to content

Commit f0646a3

Browse files
author
Zachary Scott
committed
Revert "Ignore constants discovered in passing"
This reverts commit d96a7a7. Conflicts: History.rdoc lib/rdoc/parser/ruby.rb test/test_rdoc_parser_ruby.rb
1 parent d830669 commit f0646a3

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

History.rdoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@
9797
Bug #214 by Ryan Davis.
9898
* Fixed documented? check for classes which indicated incorrect 100%
9999
coverage. Bug #211 by Ryan Davis.
100-
* RDoc ignores constants discovered in passing in class and method bodies.
101-
Bug #209 by Ryan Davis.
102100
* An :enddoc: at the top level stops all further parsing. Bug #213 by Ryan
103101
Davis.
104102
* Improved handling of multiline call-seq. Bug #207 by Erik Hollensbe.

lib/rdoc/parser/ruby.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ def parse_class_singleton container, name, comment # :nodoc:
845845
# true, no found constants will be added to RDoc.
846846

847847
def parse_constant container, tk, comment, ignore_constants = false
848-
prev_container = container
849848
offset = tk.seek
850849
line_no = tk.line_no
851850

@@ -868,8 +867,6 @@ def parse_constant container, tk, comment, ignore_constants = false
868867
end
869868

870869
unless TkASSIGN === eq_tk then
871-
suppress_parents container, prev_container
872-
873870
unget_tk eq_tk
874871
return false
875872
end

test/test_rdoc_parser_ruby.rb

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ class Foo
788788
assert_equal 2, foo.method_list.length
789789
end
790790

791-
def test_parse_const_fail_w_meta_method
791+
def test_parse_const_fail_w_meta
792792
util_parser <<-CLASS
793793
class ConstFailMeta
794794
##
@@ -810,27 +810,6 @@ class ConstFailMeta
810810
assert_equal 1, const_fail_meta.attributes.length
811811
end
812812

813-
def test_parse_const_third_party
814-
util_parser <<-CLASS
815-
class A
816-
true if B::C
817-
true if D::E::F
818-
end
819-
CLASS
820-
821-
tk = @parser.get_tk
822-
823-
@parser.parse_class @top_level, RDoc::Parser::Ruby::NORMAL, tk, @comment
824-
825-
a = @top_level.classes.first
826-
assert_equal 'A', a.full_name
827-
828-
visible = @store.all_modules.reject { |mod| mod.suppressed? }
829-
visible = visible.map { |mod| mod.full_name }
830-
831-
assert_empty visible
832-
end
833-
834813
def test_parse_class_nested_superclass
835814
foo = @top_level.add_module RDoc::NormalModule, 'Foo'
836815

0 commit comments

Comments
 (0)