Skip to content

Commit dc576b0

Browse files
committed
Import changes from Ruby trunk
1 parent 98adee0 commit dc576b0

File tree

8 files changed

+24
-17
lines changed

8 files changed

+24
-17
lines changed

lib/rdoc/generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
module RDoc::Generator
88

99
##
10-
# Name of sub-direcory that holds file descriptions
10+
# Name of sub-directory that holds file descriptions
1111

1212
FILE_DIR = "files"
1313

1414
##
15-
# Name of sub-direcory that holds class descriptions
15+
# Name of sub-directory that holds class descriptions
1616

1717
CLASS_DIR = "classes"
1818

lib/rdoc/generator/ri.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def generate(toplevels)
4545
def process_class(from_class)
4646
generate_class_info(from_class)
4747

48-
# now recure into this classes constituent classess
48+
# now recurse into this class' constituent classes
4949
from_class.each_classmodule do |mod|
5050
process_class(mod)
5151
end

lib/rdoc/known_classes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ module RDoc
2323
"rb_cProc" => "Proc",
2424
"rb_cRange" => "Range",
2525
"rb_cRegexp" => "Regexp",
26+
"rb_cRubyVM" => "RubyVM",
2627
"rb_cString" => "String",
2728
"rb_cStruct" => "Struct",
2829
"rb_cSymbol" => "Symbol",
2930
"rb_cThread" => "Thread",
3031
"rb_cTime" => "Time",
3132
"rb_cTrueClass" => "TrueClass",
32-
"rb_cVM" => "VM",
3333

3434
"rb_eArgError" => "ArgError",
3535
"rb_eEOFError" => "EOFError",

lib/rdoc/markup/fragments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Fragment
1111
attr_reader :level, :param, :txt
1212
attr_accessor :type
1313

14-
######
14+
##
1515
# This is a simple factory system that lets us associate fragement
1616
# types (a string) with a subclass of fragment
1717

lib/rdoc/parser/c.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
# method in the HTML output. This method must be in the same source file
4747
# as the rb_define_method.
4848
#
49-
# C classes can be diagramed (see /tc/dl/ruby/ruby/error.c), and RDoc
49+
# C classes can be diagrammed (see /tc/dl/ruby/ruby/error.c), and RDoc
5050
# integrates C and Ruby source into one tree
5151
#
52-
# The comment blocks may include special direcives:
52+
# The comment blocks may include special directives:
5353
#
5454
# [Document-class: <i>name</i>]
5555
# This comment block is documentation for the given class. Use this
@@ -63,7 +63,7 @@
6363
# Because C source doesn't give descripive names to Ruby-level parameters,
6464
# you need to document the calling sequence explicitly
6565
#
66-
# In additon, RDoc assumes by default that the C method implementing a
66+
# In addition, RDoc assumes by default that the C method implementing a
6767
# Ruby function is in the same source file as the rb_define_method call.
6868
# If this isn't the case, add the comment:
6969
#

lib/rdoc/parser/f95.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def set_text(text)
196196
EXTERNAL_ALIAS_MES = "The entity is"
197197

198198
##
199-
# devine code constructs
199+
# Define code constructs
200200

201201
def scan
202202
# remove private comment
@@ -1062,7 +1062,7 @@ def collect_first_comment(body)
10621062
# If "all" argument is true, information of all arguments are returned.
10631063
#
10641064
# If "modified_params" is true, list of arguments are decorated, for
1065-
# exameple, optional arguments are parenthetic as "[arg]".
1065+
# example, optional arguments are parenthetic as "[arg]".
10661066

10671067
def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
10681068
return unless args || all
@@ -1140,7 +1140,7 @@ def find_namelists(text, before_contains=nil)
11401140
end
11411141

11421142
##
1143-
# Comments just after module or subprogram, or arguments are returnd. If
1143+
# Comments just after module or subprogram, or arguments are returned. If
11441144
# "COMMENTS_ARE_UPPER" is true, comments just before modules or subprograms
11451145
# are returnd
11461146

lib/rdoc/parser/ruby.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file contains stuff stolen outright from:
33
#
44
# rtags.rb -
5-
# ruby-lex.rb - ruby lexcal analizer
5+
# ruby-lex.rb - ruby lexcal analyzer
66
# ruby-token.rb - ruby tokens
77
# by Keiju ISHITSUKA (Nippon Rational Inc.)
88
#
@@ -1491,20 +1491,27 @@ def collect_first_comment
14911491
tk = get_tk
14921492

14931493
while TkCOMMENT === tk
1494-
if first_line && tk.text[0,2] == "#!"
1494+
if first_line and tk.text =~ /\A#!/ then
1495+
skip_tkspace
1496+
tk = get_tk
1497+
elsif first_line and tk.text =~ /\A#\s*-\*-/ =~ tk.text then
1498+
first_line = false
14951499
skip_tkspace
14961500
tk = get_tk
14971501
else
1502+
first_line = false
14981503
res << tk.text << "\n"
14991504
tk = get_tk
1505+
15001506
if TkNL === tk then
1501-
skip_tkspace(false)
1507+
skip_tkspace false
15021508
tk = get_tk
15031509
end
15041510
end
1505-
first_line = false
15061511
end
1507-
unget_tk(tk)
1512+
1513+
unget_tk tk
1514+
15081515
res
15091516
end
15101517

test/test_rdoc_parser_c.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def setup
2525
end
2626

2727
def teardown
28-
@tempfile.unlink
28+
@tempfile.close
2929
end
3030

3131
def test_do_classes_boot_class

0 commit comments

Comments
 (0)