mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add explicit line breaks in method signatures for ri. Fixup some comments in object.c. Support changes comments for "in xxx.c"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9ac4ebbf21
commit
16b7b1fb95
5 changed files with 39 additions and 9 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
|
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods):
|
||||||
|
Someone changed the "// in eval.c" comments to "/*...*/" style,
|
||||||
|
so the parsing of the source file name broke.
|
||||||
|
|
||||||
|
* object.c: Remove spurious space in TrueClass documentation.
|
||||||
|
|
||||||
|
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_body): Fix
|
||||||
|
bad regexp: if the code before a documented method contained
|
||||||
|
a comment that wasn't terminated by whitespace, that comment
|
||||||
|
and all intervening code was included in the following
|
||||||
|
method's documentation.
|
||||||
|
|
||||||
|
* lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter::break_to_newline):
|
||||||
|
HTML formats need explicit line breaks.
|
||||||
|
|
||||||
Mon Jan 12 11:46:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jan 12 11:46:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (LIBPATHFLAG, RPATHFLAG): enclose paths with single
|
* configure.in (LIBPATHFLAG, RPATHFLAG): enclose paths with single
|
||||||
|
|
|
@ -261,11 +261,10 @@ module RDoc
|
||||||
\s*"([^"]+)",
|
\s*"([^"]+)",
|
||||||
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
|
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
|
||||||
\s*(-?\w+)\s*\)
|
\s*(-?\w+)\s*\)
|
||||||
(?:;\s*//\s+in\s+(\w+?\.[cy]))?
|
(?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
|
||||||
}xm) do
|
}xm) do
|
||||||
|type, var_name, meth_name, meth_body, param_count, source_file|
|
|type, var_name, meth_name, meth_body, param_count, source_file|
|
||||||
#"
|
#"
|
||||||
next if meth_name == "initialize_copy"
|
|
||||||
|
|
||||||
# Ignore top-object and weird struct.c dynamic stuff
|
# Ignore top-object and weird struct.c dynamic stuff
|
||||||
next if var_name == "ruby_top_self"
|
next if var_name == "ruby_top_self"
|
||||||
|
@ -282,10 +281,9 @@ module RDoc
|
||||||
\s*"([^"]+)",
|
\s*"([^"]+)",
|
||||||
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
|
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
|
||||||
\s*(-?\w+)\s*\)
|
\s*(-?\w+)\s*\)
|
||||||
(?:;\s*//\s+in\s+(\w+?\.[cy]))?
|
(?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
|
||||||
}xm) do #"
|
}xm) do #"
|
||||||
|meth_name, meth_body, param_count, source_file|
|
|meth_name, meth_body, param_count, source_file|
|
||||||
|
|
||||||
handle_method("method", "rb_mKernel", meth_name,
|
handle_method("method", "rb_mKernel", meth_name,
|
||||||
meth_body, param_count, source_file)
|
meth_body, param_count, source_file)
|
||||||
end
|
end
|
||||||
|
@ -346,7 +344,7 @@ module RDoc
|
||||||
|
|
||||||
# Find the C code corresponding to a Ruby method
|
# Find the C code corresponding to a Ruby method
|
||||||
def find_body(meth_name, meth_obj, body)
|
def find_body(meth_name, meth_obj, body)
|
||||||
if body =~ %r{((?>/\*.*?\*/\s+))(static\s+)?VALUE\s+#{meth_name}
|
if body =~ %r{((?>/\*.*?\*/\s*))(static\s+)?VALUE\s+#{meth_name}
|
||||||
\s*(\(.*?\)).*?^}xm
|
\s*(\(.*?\)).*?^}xm
|
||||||
comment, params = $1, $3
|
comment, params = $1, $3
|
||||||
body_text = $&
|
body_text = $&
|
||||||
|
|
|
@ -237,7 +237,10 @@ class DefaultDisplay
|
||||||
params = method.name + params
|
params = method.name + params
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
params.split(/\n/).each {|p| @formatter.wrap(p) }
|
params.split(/\n/).each do |p|
|
||||||
|
@formatter.wrap(p)
|
||||||
|
@formatter.break_to_newline
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -68,6 +68,15 @@ module RI
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
# called when we want to ensure a nbew 'wrap' starts on a newline
|
||||||
|
# Only needed for HtmlFormatter, because the rest do their
|
||||||
|
# own line breaking
|
||||||
|
|
||||||
|
def break_to_newline
|
||||||
|
end
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
|
||||||
def bold_print(txt)
|
def bold_print(txt)
|
||||||
print txt
|
print txt
|
||||||
end
|
end
|
||||||
|
@ -459,14 +468,13 @@ module RI
|
||||||
print(escape(achar.char))
|
print(escape(achar.char))
|
||||||
end
|
end
|
||||||
update_attributes(curr_attr, 0) unless curr_attr.zero?
|
update_attributes(curr_attr, 0) unless curr_attr.zero?
|
||||||
puts
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def draw_line(label=nil)
|
def draw_line(label=nil)
|
||||||
if label != nil
|
if label != nil
|
||||||
bold_print(label)
|
bold_print(label)
|
||||||
end
|
end
|
||||||
puts("<hr /><p />")
|
puts("<hr>")
|
||||||
end
|
end
|
||||||
|
|
||||||
def bold_print(txt)
|
def bold_print(txt)
|
||||||
|
@ -477,6 +485,10 @@ module RI
|
||||||
puts("<p>")
|
puts("<p>")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def break_to_newline
|
||||||
|
puts("<br>")
|
||||||
|
end
|
||||||
|
|
||||||
def display_heading(text, level, indent)
|
def display_heading(text, level, indent)
|
||||||
level = 4 if level > 4
|
level = 4 if level > 4
|
||||||
tag("h#{level}") { text }
|
tag("h#{level}") { text }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue