diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-10 02:01:00 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-10 02:01:00 +0000 |
commit | db6c51ec4f9d1b7386215cad5924e6e03733b6d6 (patch) | |
tree | a9c5accde00bbc0263aebb5b6d65f0922b9aef20 /lib/rdoc/parser/ruby.rb | |
parent | 4e1fe5357e0286c738e9aaca5201765d187fbed3 (diff) | |
download | ruby-db6c51ec4f9d1b7386215cad5924e6e03733b6d6.tar.gz |
Merge rdoc-6.0.0.beta3.
* It version introduced did you mean? feature for ri command:
https://github.com/ruby/rdoc/pull/533
* Removed obbsoleted ruby_token.rbb.
[Bug #13990][ruby-core:83180]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser/ruby.rb')
-rw-r--r-- | lib/rdoc/parser/ruby.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index ce5b454bd5..c81f152b56 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -376,7 +376,11 @@ class RDoc::Parser::Ruby < RDoc::Parser unless :on_const == name_t[:kind] || :on_ident == name_t[:kind] raise RDoc::Error, "Invalid class or module definition: #{given_name}" end - given_name << '::' << name_t[:text] + if prev_container == container and !ignore_constants + given_name = name_t[:text] + else + given_name << '::' << name_t[:text] + end end skip_tkspace false @@ -872,21 +876,17 @@ class RDoc::Parser::Ruby < RDoc::Parser return unless name =~ /^\w+$/ - eq_tk = get_tk - - if :on_op == eq_tk[:kind] && '::' == eq_tk[:text] then - unget_tk eq_tk + if :on_op == peek_tk[:kind] && '::' == peek_tk[:text] then unget_tk tk container, name_t, = get_class_or_module container, ignore_constants name = name_t[:text] - - eq_tk = get_tk end is_array_or_hash = false - if eq_tk && :on_lbracket == eq_tk[:kind] + if peek_tk && :on_lbracket == peek_tk[:kind] + get_tk nest = 1 while bracket_tk = get_tk case bracket_tk[:kind] @@ -898,14 +898,13 @@ class RDoc::Parser::Ruby < RDoc::Parser end end skip_tkspace false - eq_tk = get_tk is_array_or_hash = true end - unless eq_tk && :on_op == eq_tk[:kind] && '=' == eq_tk[:text] then - unget_tk eq_tk + unless peek_tk && :on_op == peek_tk[:kind] && '=' == peek_tk[:text] then return false end + get_tk value = '' con = RDoc::Constant.new name, value, comment |