diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-19 05:08:28 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-19 05:08:28 +0000 |
commit | 75ef9e79d6f872d9155cfa69d717b0c693be7fc9 (patch) | |
tree | 97fa40e34793b267292d9d769150292a43f3838e /lib/rdoc/parser | |
parent | 37e59f5583c781e98f41608251e094377237a133 (diff) |
Import RDoc 2.5.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser')
-rw-r--r-- | lib/rdoc/parser/ruby.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index b1684a6900..e9cdc0b83e 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -1524,24 +1524,29 @@ class RDoc::Parser::Ruby < RDoc::Parser skip_tkspace false tk = get_tk case tk - when TkLPAREN, TkfLPAREN + when TkLPAREN, TkfLPAREN then end_token = TkRPAREN else end_token = TkNL end + b_nest = 0 nest = 0 - @scanner.instance_eval{@continue = false} + @scanner.instance_eval { @continue = false } loop do case tk - when TkSEMICOLON - break - when TkLPAREN, TkfLPAREN + when TkSEMICOLON then + break if b_nest.zero? + when TkLPAREN, TkfLPAREN then nest += 1 + when TkBEGIN then + b_nest += 1 + when TkEND then + b_nest -= 1 when TkDO break if nest.zero? - when end_token + when end_token then if end_token == TkRPAREN nest -= 1 break if @scanner.lex_state == EXPR_END and nest.zero? @@ -1553,6 +1558,7 @@ class RDoc::Parser::Ruby < RDoc::Parser end tk = get_tk end + skip_tkspace false get_tk if TkDO === peek_tk |