diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 08:24:56 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 08:24:56 +0000 |
commit | ceab1511da3ca41bcf24a3675513dd1ee2c0e193 (patch) | |
tree | 9d6ed5d31d885292a3cb04fedb82a55dae1dbcd4 /lib/rdoc | |
parent | 52fe0d4fb3d7b5b77b82d3a2e439aab134524b82 (diff) |
merge revision(s) 17497:
* lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip
magic comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
-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 58ba06084e..750c483c15 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -1546,10 +1546,15 @@ module RDoc 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 @@ -1557,7 +1562,6 @@ module RDoc tk = get_tk end end - first_line = false end unget_tk(tk) res |