From 2bf2f48a0be06e57d596968358ff60f57e488b0d Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 8 Jul 2006 23:17:53 +0000 Subject: cached rdoc diagrams, private rdoc comments, minor clarifications in debug.rb and pp.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/generators/html_generator.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/rdoc/generators') diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb index be79226c8e..1f9b808e8d 100644 --- a/lib/rdoc/generators/html_generator.rb +++ b/lib/rdoc/generators/html_generator.rb @@ -114,7 +114,12 @@ module Generators lookup = name end - if /([A-Z].*)[.\#](.*)/ =~ lookup + # Find class, module, or method in class or module. + if /([A-Z]\w*)[.\#](\w+[!?=]?)/ =~ lookup + container = $1 + method = $2 + ref = @context.find_symbol(container, method) + elsif /([A-Za-z]\w*)[.\#](\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?)/ =~ lookup container = $1 method = $2 ref = @context.find_symbol(container, method) @@ -206,12 +211,14 @@ module Generators unless defined? @markup @markup = SM::SimpleMarkup.new - # class names, variable names, file names, or instance variables + # class names, variable names, or instance variables @markup.add_special(/( - \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth + \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))? # A::B.meth(**) (for operator in Fortran95) + | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))? # meth(**) (for operator in Fortran95) + | \b([A-Z]\w*(::\w+)*[.\#]\w+) # A::B.meth | \b([A-Z]\w+(::\w+)*) # A::B.. | \#\w+[!?=]? # #meth_name - | \b\w+([_\/\.]+\w+)+[!?=]? # meth_name + | \b\w+([_\/\.]+\w+)*[!?=]? # meth_name )/x, :CROSSREF) -- cgit v1.2.3