diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-21 06:57:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-21 06:57:28 +0000 |
commit | 6e8714850960a3e0b4e69522334480cf7ab1ec13 (patch) | |
tree | 6a77af68de8f4d30cb8023910b7f3591a6eb0d8e /lib/rdoc/parsers | |
parent | d1e40cbd1f8860d02474de5f673d56e56570571a (diff) | |
download | ruby-6e8714850960a3e0b4e69522334480cf7ab1ec13.tar.gz ruby-6e8714850960a3e0b4e69522334480cf7ab1ec13.tar.xz ruby-6e8714850960a3e0b4e69522334480cf7ab1ec13.zip |
* lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip
magic comment.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parsers')
-rw-r--r-- | lib/rdoc/parsers/parse_rb.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index 5e223bf77..a68094152 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -1536,10 +1536,15 @@ class RDoc::RubyParser tk = get_tk while tk.kind_of?(TkCOMMENT) - if first_line && tk.text[0,2] == "#!" + if first_line && /\A#!/ =~ tk.text + skip_tkspace + tk = get_tk + elsif first_line && /\A#\s*-\*-/ =~ tk.text + first_line = false skip_tkspace tk = get_tk else + first_line = false res << tk.text << "\n" tk = get_tk if tk.kind_of? TkNL @@ -1547,7 +1552,6 @@ class RDoc::RubyParser tk = get_tk end end - first_line = false end unget_tk(tk) res |