diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-02 00:32:30 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-02 00:32:30 +0000 |
commit | cc2a16d94d744d14d4a5eb06eca22137f8a9b79e (patch) | |
tree | 2907a20e2d9ae3a2831707056bb3fe2d384b066d /lib/rdoc/context.rb | |
parent | 918f625a5eeba35b9b191cb39c1d634b4cc7efee (diff) | |
download | ruby-cc2a16d94d744d14d4a5eb06eca22137f8a9b79e.tar.gz |
Import RDoc 3.5.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/context.rb')
-rw-r--r-- | lib/rdoc/context.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb index c424ef1676..3c12d10058 100644 --- a/lib/rdoc/context.rb +++ b/lib/rdoc/context.rb @@ -188,7 +188,6 @@ class RDoc::Context < RDoc::CodeObject @in_files = [] @name ||= "unknown" - @comment ||= "" @parent = nil @visibility = :public @@ -440,10 +439,13 @@ class RDoc::Context < RDoc::CodeObject # HACK: avoid duplicate 'PI' & 'E' in math.c (1.8.7 source code) # (this is a #ifdef: should be handled by the C parser) known = @constants_hash[constant.name] - if known - #$stderr.puts "\nconstant #{constant.name} already registered" + + if known then known.comment = constant.comment if known.comment.empty? - known.value = constant.value if known.value.nil? or known.value.strip.empty? + + known.value = constant.value if + known.value.nil? or known.value.strip.empty? + known.is_alias_for ||= constant.is_alias_for else @constants_hash[constant.name] = constant @@ -495,9 +497,10 @@ class RDoc::Context < RDoc::CodeObject end ## - # Adds an alias from +from+ (a class or module) to +name+. + # Adds an alias from +from+ (a class or module) to +name+ which was defined + # in +file+. - def add_module_alias from, name + def add_module_alias from, name, file return from if @done_documenting to_name = child_name(name) @@ -519,7 +522,8 @@ class RDoc::Context < RDoc::CodeObject # HACK: register a constant for this alias: # constant value and comment will be updated after, # when the Ruby parser adds the constant - const = RDoc::Constant.new(name, nil, '') + const = RDoc::Constant.new name, nil, '' + const.record_location file const.is_alias_for = from add_constant const |