From: caleb clausen Date: 2010-04-09T02:11:12+09:00 Subject: [ruby-core:29347] [Bug #1240] parser bug in 1.8.7 and 1.9.1p0 Issue #1240 has been updated by caleb clausen. On 4/8/10, Yusuke ENDOH wrote: > 2010/4/8 Caleb Clausen : >> Wait.... please don't harden any bugs into the specification of the >> language. If you want to say that it's too obscure/too hard to fix, >> that's fine. WONTFIX is ok, under the circumstances. If you want to >> say it's implementation dependent behavior, that's at least >> acceptable. But let's not pretend that what's clearly a bug is >> intended behavior. (Best of all would be to fix the bug, but I'm not >> really asking for that.) > > You are right. I guess it be considered as WONTFIX. Thank you. > BTW, how about the following? :-) > > # ok > while (((((((((((((((((((((((((((((((false))))))))))))))))))))))))))))))) > do; end > > # parse error > while ((((((((((((((((((((((((((((((((false)))))))))))))))))))))))))))))))) > do; end Ooooo! Both of those don't parse right in redparse. But not for the reason you seem to expect; it's objecting to the do on its own line. That is to say, this also doesn't parse: while false do; end Thanks for the bug. I'll fix it right away. Taking out the newline before do makes them parse right again. (For MRI too, tho.) Incidentally, all the ruby versions I have (1.8.6, 1.9.0, 1.9.1) also object to do after a newline. I guess this was added (relatively) recently? > If your CPU is 64 bit, please run after 32 '(' and ')' are added :-p This was on a 32 bit cpu. I wouldn't anticipate any problems with any number of nested parentheses. (Until, that is, you run out of memory.) > IMHO, do_cond (omittable `do' keyword in the part of while/until/for > constructs) brings confusion but little benefit to the Ruby syntax. > How about removal of do_cond in 2.0? Hear, hear! I agree wholeheartedly. (Unless there's someone out there who actually likes this? Speak now or forever hold your peace.) ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1240 ---------------------------------------- http://redmine.ruby-lang.org