diff options
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/markup/attribute_manager.rb | 2 | ||||
-rw-r--r-- | lib/rdoc/method_attr.rb | 7 | ||||
-rw-r--r-- | lib/rdoc/ruby_lex.rb | 4 | ||||
-rw-r--r-- | lib/rdoc/token_stream.rb | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/lib/rdoc/markup/attribute_manager.rb b/lib/rdoc/markup/attribute_manager.rb index c5a50d519c..ce4ac76d5b 100644 --- a/lib/rdoc/markup/attribute_manager.rb +++ b/lib/rdoc/markup/attribute_manager.rb @@ -130,7 +130,7 @@ class RDoc::Markup::AttributeManager # first do matching ones tags = @matching_word_pairs.keys.join("") - re = /(^|\W)([#{tags}])([#:\\]?[\w.\/-]+?\S?)\2(\W|$)/ + re = /(^|\W)([#{tags}])([#\\]?[\w:.\/-]+?\S?)\2(\W|$)/ 1 while str.gsub!(re) do attr = @matching_word_pairs[$2] diff --git a/lib/rdoc/method_attr.rb b/lib/rdoc/method_attr.rb index 9af64539c3..a0ea851dc5 100644 --- a/lib/rdoc/method_attr.rb +++ b/lib/rdoc/method_attr.rb @@ -361,7 +361,12 @@ class RDoc::MethodAttr < RDoc::CodeObject end def pretty_print q # :nodoc: - alias_for = @is_alias_for ? "alias for #{@is_alias_for.name}" : nil + alias_for = + if @is_alias_for.respond_to? :name then + "alias for #{@is_alias_for.name}" + elsif Array === @is_alias_for then + "alias for #{@is_alias_for.last}" + end q.group 2, "[#{self.class.name} #{full_name} #{visibility}", "]" do if alias_for then diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb index ce1c25dd6b..91b90ab2cf 100644 --- a/lib/rdoc/ruby_lex.rb +++ b/lib/rdoc/ruby_lex.rb @@ -1184,9 +1184,9 @@ class RDoc::RubyLex str = if ltype == quoted and %w[" ' /].include? ltype then ltype.dup elsif RUBY_VERSION > '1.9' then - "%#{type or PERCENT_LTYPE.key ltype}#{PERCENT_PAREN_REV[quoted]}" + "%#{type or PERCENT_LTYPE.key ltype}#{PERCENT_PAREN_REV[quoted]||quoted}" else - "%#{type or PERCENT_LTYPE.index ltype}#{PERCENT_PAREN_REV[quoted]}" + "%#{type or PERCENT_LTYPE.index ltype}#{PERCENT_PAREN_REV[quoted]||quoted}" end subtype = nil diff --git a/lib/rdoc/token_stream.rb b/lib/rdoc/token_stream.rb index 851bc05bf5..b46b7da2f7 100644 --- a/lib/rdoc/token_stream.rb +++ b/lib/rdoc/token_stream.rb @@ -88,7 +88,7 @@ module RDoc::TokenStream # Returns a string representation of the token stream def tokens_to_s - token_stream.map { |token| token.text }.join '' + token_stream.compact.map { |token| token.text }.join '' end end |