Skip to content

Commit b55defb

Browse files
committed
Fix crasher, RDoc now ignores comments above local variable assignment
1 parent 9bb8036 commit b55defb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

History.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* When merging ri data with a nonexistant directory, RDoc no longer crashes.
2626
* Fix visibility of methods in XML output. Issue by Yehuda Katz.
2727
* Fixed relative link generation.
28+
* Fix crash, RDoc now ignores comments above local variable assignments in
29+
modules.
2830

2931
=== 2.2.1 / 2008-09-24
3032
This version provides some minor fixes and enhancements to 2.2.0 intended

lib/rdoc/parser/ruby.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,8 +2045,11 @@ def parse_meta_method(container, single, tk, comment)
20452045
name = name_t.text[1..-1]
20462046
when TkSTRING then
20472047
name = name_t.text[1..-2]
2048+
when TkASSIGN then # ignore
2049+
remove_token_listener self
2050+
return
20482051
else
2049-
warn "#{container.top_level.file_relative_name}:#{name_t.line_no} unknown name token #{name_t.inspect} for meta-method"
2052+
warn "#{container.toplevel.file_relative_name}:#{name_t.line_no} unknown name token #{name_t.inspect} for meta-method '#{tk.name}'"
20502053
name = 'unknown'
20512054
end
20522055
end

0 commit comments

Comments
 (0)