From: noreply@... Date: 2007-05-29T03:01:41+09:00 Subject: [ ruby-Patches-11184 ] [rdoc] constants with multiline values Patches item #11184, was opened at 2007-05-28 11:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1700&aid=11184&group_id=426 Category: Ruby1.8 Group: None Status: Open Resolution: None Priority: 3 Submitted By: Joel VanderWerf (vjoel) Assigned to: Nobody (None) Summary: [rdoc] constants with multiline values Initial Comment: RDoc as of ruby 1.8.6 does not correctly handle constants whose value extends beyond the first line. Originally reported and patched by Chris Alfeld in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7647 The original post noted the following example: ---- A = [ 1, 2, 3 ] B = { 1 => 'foo', 2 => 'bar' } C = proc do |x| x+1 end ---- The original patch was against 1.8.4. The patch for 1.8.6 is: --- parsers/parse_rb.rb.bck 2007-05-13 13:04:13.000000000 -0700 +++ parsers/parse_rb.rb 2007-05-13 13:04:13.000000000 -0700 @@ -1848,9 +1848,9 @@ case tk when TkSEMICOLON break - when TkLPAREN, TkfLPAREN + when TkLPAREN, TkfLPAREN, TkLBRACE, TkLBRACK, TkDO nest += 1 - when TkRPAREN + when TkRPAREN, TkRBRACE, TkRBRACK, TkEND nest -= 1 when TkCOMMENT if nest <= 0 && @scanner.lex_state == EXPR_END @@ -1858,7 +1858,7 @@ break end when TkNL - if (@scanner.lex_state == EXPR_END and nest <= 0) || !@scanner.continue + if (nest <= 0) && ((@scanner.lex_state == EXPR_END) || (!@scanner.continue)) unget_tk(tk) break end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1700&aid=11184&group_id=426