diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-05 01:41:25 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-05 01:41:25 +0000 |
commit | d42d6e690e3f553b971322eae783ac6b0d4d9692 (patch) | |
tree | 2004bf4517ee7b81466c300cf30092e62e65467e /lib/rdoc/parser/ruby.rb | |
parent | 670c6e8ce9d4a12bb4832e10fab27365398649bf (diff) | |
download | ruby-d42d6e690e3f553b971322eae783ac6b0d4d9692.tar.gz |
* lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser/ruby.rb')
-rw-r--r-- | lib/rdoc/parser/ruby.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index 1c4b637640..ce1083edc7 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -187,15 +187,16 @@ class RDoc::Parser::Ruby < RDoc::Parser end ## - # Extracts the visibility information for the visibility token +tk+. + # Extracts the visibility information for the visibility token +tk+ + # and +single+ class type identifier. # # Returns the visibility type (a string), the visibility (a symbol) and # +singleton+ if the methods following should be converted to singleton # methods. - def get_visibility_information tk # :nodoc: + def get_visibility_information tk, single # :nodoc: vis_type = tk.name - singleton = false + singleton = single == SINGLE vis = case vis_type @@ -226,6 +227,7 @@ class RDoc::Parser::Ruby < RDoc::Parser comment = '' comment.force_encoding @encoding if @encoding first_line = true + first_comment_tk_class = nil tk = get_tk @@ -238,6 +240,9 @@ class RDoc::Parser::Ruby < RDoc::Parser skip_tkspace tk = get_tk else + break if first_comment_tk_class and not first_comment_tk_class === tk + first_comment_tk_class = tk.class + first_line = false comment << tk.text << "\n" tk = get_tk @@ -841,7 +846,6 @@ class RDoc::Parser::Ruby < RDoc::Parser # true, no found constants will be added to RDoc. def parse_constant container, tk, comment, ignore_constants = false - prev_container = container offset = tk.seek line_no = tk.line_no @@ -864,8 +868,6 @@ class RDoc::Parser::Ruby < RDoc::Parser end unless TkASSIGN === eq_tk then - suppress_parents container, prev_container - unget_tk eq_tk return false end @@ -889,7 +891,7 @@ class RDoc::Parser::Ruby < RDoc::Parser read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS @stats.add_constant con - con = container.add_constant con + container.add_constant con true end @@ -1305,7 +1307,7 @@ class RDoc::Parser::Ruby < RDoc::Parser return unless name meth = RDoc::AnyMethod.new get_tkread, name - meth.singleton = singleton + meth.singleton = single == SINGLE ? true : singleton record_location meth meth.offset = offset @@ -1875,9 +1877,7 @@ class RDoc::Parser::Ruby < RDoc::Parser # Determines the visibility in +container+ from +tk+ def parse_visibility(container, single, tk) - singleton = (single == SINGLE) - - vis_type, vis, singleton = get_visibility_information tk + vis_type, vis, singleton = get_visibility_information tk, single skip_tkspace_comment false @@ -2078,7 +2078,7 @@ class RDoc::Parser::Ruby < RDoc::Parser def skip_for_variable skip_tkspace false - tk = get_tk + get_tk skip_tkspace false tk = get_tk unget_tk(tk) unless TkIN === tk |