aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/code_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/code_object.rb')
-rw-r--r--lib/rdoc/code_object.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb
index 02b2f2fcf6..3a8adfab67 100644
--- a/lib/rdoc/code_object.rb
+++ b/lib/rdoc/code_object.rb
@@ -61,11 +61,23 @@ class RDoc::CodeObject
attr_reader :force_documentation
##
+ # Line in #file where this CodeObject was defined
+
+ attr_accessor :line
+
+ ##
# Hash of arbitrary metadata for this CodeObject
attr_reader :metadata
##
+ # Offset in #file where this CodeObject was defined
+ #--
+ # TODO character or byte?
+
+ attr_accessor :offset
+
+ ##
# Our parent CodeObject
attr_accessor :parent
@@ -115,6 +127,12 @@ class RDoc::CodeObject
if comment and not comment.empty? then
normalize_comment comment
else
+ # TODO is this sufficient?
+ # HACK correct fix is to have #initialize create @comment
+ # with the correct encoding
+ if Object.const_defined? :Encoding and @comment.empty? then
+ @comment.force_encoding comment.encoding
+ end
@comment
end
end