rdoc 6.5.0 → 6.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +2 -2
  3. data/TODO.rdoc +1 -1
  4. data/lib/rdoc/alias.rb +0 -1
  5. data/lib/rdoc/anon_class.rb +0 -1
  6. data/lib/rdoc/any_method.rb +15 -0
  7. data/lib/rdoc/attr.rb +0 -1
  8. data/lib/rdoc/class_module.rb +0 -1
  9. data/lib/rdoc/comment.rb +20 -41
  10. data/lib/rdoc/constant.rb +0 -1
  11. data/lib/rdoc/context/section.rb +0 -1
  12. data/lib/rdoc/cross_reference.rb +0 -1
  13. data/lib/rdoc/encoding.rb +1 -6
  14. data/lib/rdoc/erb_partial.rb +0 -1
  15. data/lib/rdoc/erbio.rb +2 -7
  16. data/lib/rdoc/extend.rb +0 -1
  17. data/lib/rdoc/generator/darkfish.rb +2 -6
  18. data/lib/rdoc/generator/json_index.rb +2 -2
  19. data/lib/rdoc/generator/markup.rb +0 -1
  20. data/lib/rdoc/generator/ri.rb +0 -1
  21. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -1
  22. data/lib/rdoc/generator/template/darkfish/class.rhtml +6 -0
  23. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +38 -13
  24. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +13 -0
  25. data/lib/rdoc/generator/template/darkfish/js/search.js +3 -3
  26. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +5 -4
  27. data/lib/rdoc/generator/template/json_index/js/navigation.js +8 -8
  28. data/lib/rdoc/ghost_method.rb +0 -1
  29. data/lib/rdoc/include.rb +0 -1
  30. data/lib/rdoc/markdown/entities.rb +0 -1
  31. data/lib/rdoc/markdown/literals.rb +66 -43
  32. data/lib/rdoc/markdown.kpeg +1 -1
  33. data/lib/rdoc/markdown.rb +3 -1
  34. data/lib/rdoc/markup/attr_changer.rb +0 -1
  35. data/lib/rdoc/markup/attr_span.rb +0 -1
  36. data/lib/rdoc/markup/attribute_manager.rb +11 -12
  37. data/lib/rdoc/markup/attributes.rb +0 -1
  38. data/lib/rdoc/markup/blank_line.rb +0 -1
  39. data/lib/rdoc/markup/block_quote.rb +0 -1
  40. data/lib/rdoc/markup/document.rb +0 -1
  41. data/lib/rdoc/markup/formatter.rb +1 -2
  42. data/lib/rdoc/markup/hard_break.rb +0 -1
  43. data/lib/rdoc/markup/heading.rb +0 -1
  44. data/lib/rdoc/markup/include.rb +0 -1
  45. data/lib/rdoc/markup/indented_paragraph.rb +0 -1
  46. data/lib/rdoc/markup/list.rb +0 -1
  47. data/lib/rdoc/markup/list_item.rb +0 -1
  48. data/lib/rdoc/markup/paragraph.rb +0 -1
  49. data/lib/rdoc/markup/parser.rb +1 -1
  50. data/lib/rdoc/markup/raw.rb +0 -1
  51. data/lib/rdoc/markup/regexp_handling.rb +0 -1
  52. data/lib/rdoc/markup/rule.rb +0 -1
  53. data/lib/rdoc/markup/to_ansi.rb +0 -1
  54. data/lib/rdoc/markup/to_html.rb +6 -3
  55. data/lib/rdoc/markup/to_html_crossref.rb +0 -1
  56. data/lib/rdoc/markup/to_html_snippet.rb +0 -1
  57. data/lib/rdoc/markup/to_joined_paragraph.rb +2 -3
  58. data/lib/rdoc/markup/to_label.rb +0 -1
  59. data/lib/rdoc/markup/to_markdown.rb +0 -1
  60. data/lib/rdoc/markup/to_rdoc.rb +0 -1
  61. data/lib/rdoc/markup/to_table_of_contents.rb +0 -1
  62. data/lib/rdoc/markup/to_test.rb +0 -1
  63. data/lib/rdoc/markup/to_tt_only.rb +0 -1
  64. data/lib/rdoc/markup/verbatim.rb +0 -1
  65. data/lib/rdoc/meta_method.rb +0 -1
  66. data/lib/rdoc/method_attr.rb +0 -1
  67. data/lib/rdoc/mixin.rb +0 -1
  68. data/lib/rdoc/normal_class.rb +0 -1
  69. data/lib/rdoc/normal_module.rb +0 -1
  70. data/lib/rdoc/options.rb +3 -2
  71. data/lib/rdoc/parser/changelog.rb +0 -1
  72. data/lib/rdoc/parser/markdown.rb +0 -2
  73. data/lib/rdoc/parser/rd.rb +0 -1
  74. data/lib/rdoc/parser/ripper_state_lex.rb +1 -1
  75. data/lib/rdoc/parser/ruby.rb +4 -4
  76. data/lib/rdoc/parser/ruby_tools.rb +0 -2
  77. data/lib/rdoc/parser/text.rb +0 -1
  78. data/lib/rdoc/rd/block_parser.rb +654 -4
  79. data/lib/rdoc/rd/block_parser.ry +1 -1
  80. data/lib/rdoc/rd/inline.rb +0 -1
  81. data/lib/rdoc/rd/inline_parser.rb +653 -3
  82. data/lib/rdoc/rdoc.rb +2 -4
  83. data/lib/rdoc/require.rb +0 -1
  84. data/lib/rdoc/ri/driver.rb +9 -8
  85. data/lib/rdoc/ri/store.rb +0 -1
  86. data/lib/rdoc/single_class.rb +0 -1
  87. data/lib/rdoc/stats/quiet.rb +0 -1
  88. data/lib/rdoc/stats/verbose.rb +0 -2
  89. data/lib/rdoc/task.rb +28 -2
  90. data/lib/rdoc/text.rb +6 -0
  91. data/lib/rdoc/token_stream.rb +1 -2
  92. data/lib/rdoc/top_level.rb +0 -1
  93. data/lib/rdoc/version.rb +1 -1
  94. metadata +8 -5
@@ -39,45 +39,75 @@ class RDoc::Markdown::Literals
39
39
  attr_accessor :result, :pos
40
40
 
41
41
  def current_column(target=pos)
42
- if c = string.rindex("\n", target-1)
43
- return target - c - 1
42
+ if string[target] == "\n" && (c = string.rindex("\n", target-1) || -1)
43
+ return target - c
44
+ elsif c = string.rindex("\n", target)
45
+ return target - c
44
46
  end
45
47
 
46
48
  target + 1
47
49
  end
48
50
 
51
+ def position_line_offsets
52
+ unless @position_line_offsets
53
+ @position_line_offsets = []
54
+ total = 0
55
+ string.each_line do |line|
56
+ total += line.size
57
+ @position_line_offsets << total
58
+ end
59
+ end
60
+ @position_line_offsets
61
+ end
62
+
49
63
  if [].respond_to? :bsearch_index
50
64
  def current_line(target=pos)
51
- unless @line_offsets
52
- @line_offsets = []
53
- total = 0
54
- string.each_line do |line|
55
- total += line.size
56
- @line_offsets << total
57
- end
65
+ if line = position_line_offsets.bsearch_index {|x| x > target }
66
+ return line + 1
58
67
  end
59
-
60
- @line_offsets.bsearch_index {|x| x >= target } + 1 || -1
68
+ raise "Target position #{target} is outside of string"
61
69
  end
62
70
  else
63
71
  def current_line(target=pos)
64
- cur_offset = 0
65
- cur_line = 0
66
-
67
- string.each_line do |line|
68
- cur_line += 1
69
- cur_offset += line.size
70
- return cur_line if cur_offset >= target
72
+ if line = position_line_offsets.index {|x| x > target }
73
+ return line + 1
71
74
  end
72
75
 
73
- -1
76
+ raise "Target position #{target} is outside of string"
77
+ end
78
+ end
79
+
80
+ def current_character(target=pos)
81
+ if target < 0 || target >= string.size
82
+ raise "Target position #{target} is outside of string"
74
83
  end
84
+ string[target, 1]
85
+ end
86
+
87
+ KpegPosInfo = Struct.new(:pos, :lno, :col, :line, :char)
88
+
89
+ def current_pos_info(target=pos)
90
+ l = current_line target
91
+ c = current_column target
92
+ ln = get_line(l-1)
93
+ chr = string[target,1]
94
+ KpegPosInfo.new(target, l, c, ln, chr)
75
95
  end
76
96
 
77
97
  def lines
78
- lines = []
79
- string.each_line { |l| lines << l }
80
- lines
98
+ string.lines
99
+ end
100
+
101
+ def get_line(no)
102
+ loff = position_line_offsets
103
+ if no < 0
104
+ raise "Line No is out of range: #{no} < 0"
105
+ elsif no >= loff.size
106
+ raise "Line No is out of range: #{no} >= #{loff.size}"
107
+ end
108
+ lend = loff[no]-1
109
+ lstart = no > 0 ? loff[no-1] : 0
110
+ string[lstart..lend]
81
111
  end
82
112
 
83
113
 
@@ -91,6 +121,7 @@ class RDoc::Markdown::Literals
91
121
  @string = string
92
122
  @string_size = string ? string.size : 0
93
123
  @pos = pos
124
+ @position_line_offsets = nil
94
125
  end
95
126
 
96
127
  def show_pos
@@ -115,30 +146,22 @@ class RDoc::Markdown::Literals
115
146
  end
116
147
 
117
148
  def failure_caret
118
- l = current_line @failing_rule_offset
119
- c = current_column @failing_rule_offset
120
-
121
- line = lines[l-1]
122
- "#{line}\n#{' ' * (c - 1)}^"
149
+ p = current_pos_info @failing_rule_offset
150
+ "#{p.line.chomp}\n#{' ' * (p.col - 1)}^"
123
151
  end
124
152
 
125
153
  def failure_character
126
- l = current_line @failing_rule_offset
127
- c = current_column @failing_rule_offset
128
- lines[l-1][c-1, 1]
154
+ current_character @failing_rule_offset
129
155
  end
130
156
 
131
157
  def failure_oneline
132
- l = current_line @failing_rule_offset
133
- c = current_column @failing_rule_offset
134
-
135
- char = lines[l-1][c-1, 1]
158
+ p = current_pos_info @failing_rule_offset
136
159
 
137
160
  if @failed_rule.kind_of? Symbol
138
161
  info = self.class::Rules[@failed_rule]
139
- "@#{l}:#{c} failed rule '#{info.name}', got '#{char}'"
162
+ "@#{p.lno}:#{p.col} failed rule '#{info.name}', got '#{p.char}'"
140
163
  else
141
- "@#{l}:#{c} failed rule '#{@failed_rule}', got '#{char}'"
164
+ "@#{p.lno}:#{p.col} failed rule '#{@failed_rule}', got '#{p.char}'"
142
165
  end
143
166
  end
144
167
 
@@ -151,10 +174,9 @@ class RDoc::Markdown::Literals
151
174
 
152
175
  def show_error(io=STDOUT)
153
176
  error_pos = @failing_rule_offset
154
- line_no = current_line(error_pos)
155
- col_no = current_column(error_pos)
177
+ p = current_pos_info(error_pos)
156
178
 
157
- io.puts "On line #{line_no}, column #{col_no}:"
179
+ io.puts "On line #{p.lno}, column #{p.col}:"
158
180
 
159
181
  if @failed_rule.kind_of? Symbol
160
182
  info = self.class::Rules[@failed_rule]
@@ -163,10 +185,9 @@ class RDoc::Markdown::Literals
163
185
  io.puts "Failed to match rule '#{@failed_rule}'"
164
186
  end
165
187
 
166
- io.puts "Got: #{string[error_pos,1].inspect}"
167
- line = lines[line_no-1]
168
- io.puts "=> #{line}"
169
- io.print(" " * (col_no + 3))
188
+ io.puts "Got: #{p.char.inspect}"
189
+ io.puts "=> #{p.line}"
190
+ io.print(" " * (p.col + 2))
170
191
  io.puts "^"
171
192
  end
172
193
 
@@ -275,6 +296,7 @@ class RDoc::Markdown::Literals
275
296
  end
276
297
 
277
298
  def apply_with_args(rule, *args)
299
+ @result = nil
278
300
  memo_key = [rule, args]
279
301
  if m = @memoizations[memo_key][@pos]
280
302
  @pos = m.pos
@@ -308,6 +330,7 @@ class RDoc::Markdown::Literals
308
330
  end
309
331
 
310
332
  def apply(rule)
333
+ @result = nil
311
334
  if m = @memoizations[rule][@pos]
312
335
  @pos = m.pos
313
336
  if !m.set
@@ -178,7 +178,7 @@
178
178
  # [dingus]: http://daringfireball.net/projects/markdown/dingus
179
179
  # [GFM]: https://github.github.com/gfm/
180
180
  # [pegmarkdown]: https://github.com/jgm/peg-markdown
181
- # [PHPE]: http://michelf.com/projects/php-markdown/extra/#def-list
181
+ # [PHPE]: https://michelf.ca/projects/php-markdown/extra/#def-list
182
182
  # [syntax]: http://daringfireball.net/projects/markdown/syntax
183
183
  #--
184
184
  # Last updated to jgm/peg-markdown commit 8f8fc22ef0
data/lib/rdoc/markdown.rb CHANGED
@@ -175,7 +175,7 @@
175
175
  # [dingus]: http://daringfireball.net/projects/markdown/dingus
176
176
  # [GFM]: https://github.github.com/gfm/
177
177
  # [pegmarkdown]: https://github.com/jgm/peg-markdown
178
- # [PHPE]: http://michelf.com/projects/php-markdown/extra/#def-list
178
+ # [PHPE]: https://michelf.ca/projects/php-markdown/extra/#def-list
179
179
  # [syntax]: http://daringfireball.net/projects/markdown/syntax
180
180
  #--
181
181
  # Last updated to jgm/peg-markdown commit 8f8fc22ef0
@@ -466,6 +466,7 @@ class RDoc::Markdown
466
466
  end
467
467
 
468
468
  def apply_with_args(rule, *args)
469
+ @result = nil
469
470
  memo_key = [rule, args]
470
471
  if m = @memoizations[memo_key][@pos]
471
472
  @pos = m.pos
@@ -499,6 +500,7 @@ class RDoc::Markdown
499
500
  end
500
501
 
501
502
  def apply(rule)
503
+ @result = nil
502
504
  if m = @memoizations[rule][@pos]
503
505
  @pos = m.pos
504
506
  if !m.set
@@ -20,4 +20,3 @@ class RDoc::Markup::AttrChanger
20
20
  end
21
21
 
22
22
  end
23
-
@@ -33,4 +33,3 @@ class RDoc::Markup::AttrSpan
33
33
  end
34
34
 
35
35
  end
36
-
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  ##
3
4
  # Manages changes of attributes in a block of text
4
5
 
5
- unless MatchData.method_defined?(:match_length)
6
- using Module.new {
7
- refine(MatchData) {
8
- def match_length(nth)
9
- b, e = offset(nth)
10
- e - b if b
11
- end
12
- }
13
- }
14
- end
15
-
16
6
  class RDoc::Markup::AttributeManager
7
+ unless ::MatchData.method_defined?(:match_length)
8
+ using ::Module.new {
9
+ refine(::MatchData) {
10
+ def match_length(nth) # :nodoc:
11
+ b, e = offset(nth)
12
+ e - b if b
13
+ end
14
+ }
15
+ }
16
+ end
17
17
 
18
18
  ##
19
19
  # The NUL character
@@ -400,4 +400,3 @@ class RDoc::Markup::AttributeManager
400
400
  end
401
401
 
402
402
  end
403
-
@@ -68,4 +68,3 @@ class RDoc::Markup::Attributes
68
68
  end
69
69
 
70
70
  end
71
-
@@ -25,4 +25,3 @@ class RDoc::Markup::BlankLine
25
25
  end
26
26
 
27
27
  end
28
-
@@ -12,4 +12,3 @@ class RDoc::Markup::BlockQuote < RDoc::Markup::Raw
12
12
  end
13
13
 
14
14
  end
15
-
@@ -162,4 +162,3 @@ class RDoc::Markup::Document
162
162
  end
163
163
 
164
164
  end
165
-
@@ -90,7 +90,7 @@ class RDoc::Markup::Formatter
90
90
 
91
91
  def add_regexp_handling_TIDYLINK
92
92
  @markup.add_regexp_handling(/(?:
93
- \{.*?\} | # multi-word label
93
+ \{[^{}]*\} | # multi-word label
94
94
  \b[^\s{}]+? # single-word label
95
95
  )
96
96
 
@@ -263,4 +263,3 @@ class RDoc::Markup::Formatter
263
263
  end
264
264
 
265
265
  end
266
-
@@ -29,4 +29,3 @@ class RDoc::Markup::HardBreak
29
29
  end
30
30
 
31
31
  end
32
-
@@ -76,4 +76,3 @@ RDoc::Markup::Heading =
76
76
  end
77
77
 
78
78
  end
79
-
@@ -40,4 +40,3 @@ class RDoc::Markup::Include
40
40
  end
41
41
 
42
42
  end
43
-
@@ -45,4 +45,3 @@ class RDoc::Markup::IndentedParagraph < RDoc::Markup::Raw
45
45
  end
46
46
 
47
47
  end
48
-
@@ -99,4 +99,3 @@ class RDoc::Markup::List
99
99
  end
100
100
 
101
101
  end
102
-
@@ -97,4 +97,3 @@ class RDoc::Markup::ListItem
97
97
  end
98
98
 
99
99
  end
100
-
@@ -26,4 +26,3 @@ class RDoc::Markup::Paragraph < RDoc::Markup::Raw
26
26
  end
27
27
 
28
28
  end
29
-
@@ -218,7 +218,7 @@ class RDoc::Markup::Parser
218
218
 
219
219
  break if peek_token.first == :BREAK
220
220
 
221
- data << ' ' if skip :NEWLINE
221
+ data << ' ' if skip :NEWLINE and /#{SPACE_SEPARATED_LETTER_CLASS}\z/o.match?(data)
222
222
  else
223
223
  unget
224
224
  break
@@ -67,4 +67,3 @@ class RDoc::Markup::Raw
67
67
  end
68
68
 
69
69
  end
70
-
@@ -38,4 +38,3 @@ class RDoc::Markup::RegexpHandling
38
38
  end
39
39
 
40
40
  end
41
-
@@ -18,4 +18,3 @@ class RDoc::Markup::Rule < Struct.new :weight
18
18
  end
19
19
 
20
20
  end
21
-
@@ -91,4 +91,3 @@ class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc
91
91
  end
92
92
 
93
93
  end
94
-
@@ -202,7 +202,9 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
202
202
  def accept_paragraph paragraph
203
203
  @res << "\n<p>"
204
204
  text = paragraph.text @hard_break
205
- text = text.gsub(/\r?\n/, ' ')
205
+ text = text.gsub(/(#{SPACE_SEPARATED_LETTER_CLASS})?\K\r?\n(?=(?(1)(#{SPACE_SEPARATED_LETTER_CLASS})?))/o) {
206
+ defined?($2) && ' '
207
+ }
206
208
  @res << to_html(text)
207
209
  @res << "</p>\n"
208
210
  end
@@ -430,7 +432,9 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
430
432
 
431
433
  def parseable? text
432
434
  verbose, $VERBOSE = $VERBOSE, nil
433
- eval("BEGIN {return true}\n#{text}")
435
+ catch(:valid) do
436
+ eval("BEGIN { throw :valid, true }\n#{text}")
437
+ end
434
438
  rescue SyntaxError
435
439
  false
436
440
  ensure
@@ -445,4 +449,3 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
445
449
  end
446
450
 
447
451
  end
448
-
@@ -173,4 +173,3 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
173
173
  end
174
174
 
175
175
  end
176
-
@@ -282,4 +282,3 @@ class RDoc::Markup::ToHtmlSnippet < RDoc::Markup::ToHtml
282
282
  end
283
283
 
284
284
  end
285
-
@@ -25,9 +25,9 @@ class RDoc::Markup::ToJoinedParagraph < RDoc::Markup::Formatter
25
25
  def accept_paragraph paragraph
26
26
  parts = paragraph.parts.chunk do |part|
27
27
  String === part
28
- end.map do |string, chunk|
28
+ end.flat_map do |string, chunk|
29
29
  string ? chunk.join.rstrip : chunk
30
- end.flatten
30
+ end
31
31
 
32
32
  paragraph.parts.replace parts
33
33
  end
@@ -44,4 +44,3 @@ class RDoc::Markup::ToJoinedParagraph < RDoc::Markup::Formatter
44
44
  alias accept_table ignore
45
45
 
46
46
  end
47
-
@@ -72,4 +72,3 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter
72
72
  alias start_accepting ignore
73
73
 
74
74
  end
75
-
@@ -189,4 +189,3 @@ class RDoc::Markup::ToMarkdown < RDoc::Markup::ToRdoc
189
189
  end
190
190
 
191
191
  end
192
-
@@ -342,4 +342,3 @@ class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
342
342
  end
343
343
 
344
344
  end
345
-
@@ -86,4 +86,3 @@ class RDoc::Markup::ToTableOfContents < RDoc::Markup::Formatter
86
86
  # :startdoc:
87
87
 
88
88
  end
89
-
@@ -67,4 +67,3 @@ class RDoc::Markup::ToTest < RDoc::Markup::Formatter
67
67
  # :startdoc:
68
68
 
69
69
  end
70
-
@@ -118,4 +118,3 @@ class RDoc::Markup::ToTtOnly < RDoc::Markup::Formatter
118
118
  end
119
119
 
120
120
  end
121
-
@@ -81,4 +81,3 @@ class RDoc::Markup::Verbatim < RDoc::Markup::Raw
81
81
  end
82
82
 
83
83
  end
84
-
@@ -4,4 +4,3 @@
4
4
 
5
5
  class RDoc::MetaMethod < RDoc::AnyMethod
6
6
  end
7
-
@@ -416,4 +416,3 @@ class RDoc::MethodAttr < RDoc::CodeObject
416
416
  end
417
417
 
418
418
  end
419
-
data/lib/rdoc/mixin.rb CHANGED
@@ -118,4 +118,3 @@ class RDoc::Mixin < RDoc::CodeObject
118
118
  end
119
119
 
120
120
  end
121
-
@@ -90,4 +90,3 @@ class RDoc::NormalClass < RDoc::ClassModule
90
90
  end
91
91
 
92
92
  end
93
-
@@ -71,4 +71,3 @@ class RDoc::NormalModule < RDoc::ClassModule
71
71
  end
72
72
 
73
73
  end
74
-
data/lib/rdoc/options.rb CHANGED
@@ -565,9 +565,10 @@ class RDoc::Options
565
565
 
566
566
  @op_dir ||= 'doc'
567
567
 
568
- @rdoc_include << "." if @rdoc_include.empty?
569
568
  root = @root.to_s
570
- @rdoc_include << root unless @rdoc_include.include?(root)
569
+ if @rdoc_include.empty? || !@rdoc_include.include?(root)
570
+ @rdoc_include << root
571
+ end
571
572
 
572
573
  @exclude = self.exclude
573
574
 
@@ -332,4 +332,3 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
332
332
  end
333
333
  end
334
334
  end
335
-
@@ -20,5 +20,3 @@ class RDoc::Parser::Markdown < RDoc::Parser
20
20
  end
21
21
 
22
22
  end
23
-
24
-
@@ -20,4 +20,3 @@ class RDoc::Parser::RD < RDoc::Parser
20
20
  end
21
21
 
22
22
  end
23
-
@@ -368,7 +368,7 @@ class RDoc::Parser::RipperStateLex
368
368
  private def get_symbol_tk(tk)
369
369
  is_symbol = true
370
370
  symbol_tk = Token.new(tk.line_no, tk.char_no, :on_symbol)
371
- if ":'" == tk[:text] or ':"' == tk[:text]
371
+ if ":'" == tk[:text] or ':"' == tk[:text] or tk[:text].start_with?('%s')
372
372
  tk1 = get_string_tk(tk)
373
373
  symbol_tk[:text] = tk1[:text]
374
374
  symbol_tk[:state] = tk1[:state]
@@ -8,6 +8,9 @@
8
8
  # by Keiju ISHITSUKA (Nippon Rational Inc.)
9
9
  #
10
10
 
11
+ require 'ripper'
12
+ require_relative 'ripper_state_lex'
13
+
11
14
  ##
12
15
  # Extracts code elements from a source file returning a TopLevel object
13
16
  # containing the constituent file elements.
@@ -138,9 +141,6 @@
138
141
  # Note that by default, the :method: directive will be ignored if there is a
139
142
  # standard rdocable item following it.
140
143
 
141
- require 'ripper'
142
- require_relative 'ripper_state_lex'
143
-
144
144
  class RDoc::Parser::Ruby < RDoc::Parser
145
145
 
146
146
  parse_files_matching(/\.rbw?$/)
@@ -2134,7 +2134,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
2134
2134
  if :on_nl == tk[:kind] or (:on_kw == tk[:kind] && 'def' == tk[:text]) then
2135
2135
  return
2136
2136
  elsif :on_comment == tk[:kind] or :on_embdoc == tk[:kind] then
2137
- return unless tk[:text] =~ /\s*:?([\w-]+):\s*(.*)/
2137
+ return unless tk[:text] =~ /:?\b([\w-]+):\s*(.*)/
2138
2138
 
2139
2139
  directive = $1.downcase
2140
2140
 
@@ -163,5 +163,3 @@ module RDoc::Parser::RubyTools
163
163
  end
164
164
 
165
165
  end
166
-
167
-
@@ -9,4 +9,3 @@
9
9
 
10
10
  module RDoc::Parser::Text
11
11
  end
12
-