From: "Aleksi Niemelä" Date: 2001-09-10T09:51:14+09:00 Subject: [ruby-talk:21025] A parsing bug in 1.7.1? I encountered a possible parsing bug in latest nightly snapshot Ruby 1.7.1. These work and don't work almost randomly :) : [foo("bar")] works [foo("bar"),] works [foo ("bar")] works [foo ("bar"),] doesn't work [foo ("bar"), foo("bar")] works [foo ("bar"), foo("bar"),] doesn't The reason for "doesn't work" is that 'foo ("bar"),' is parsed as a method call and doesn't work for the same reason foo(3,) doesn't work (expecting more arguments, as there's no optional comma at the end of the arguments list in the grammar). Why I'm filing this in the first place is that all of the above works with 1.6.4 so there might be some regression here, or a deliberately made choice for grammar change. In either case it might be good to raise public awareness. In any case it's nice to note array notation doesn't go along nicely as expected (by a novice) with small whitespace adjustments. So [foo ("bar"), 2] is expected to be [(foo("bar")), 2] by a novice whereas it's actually [(foo("bar", 2))], while [foo("bar"), 2] parses always as the expected one. - Aleksi Ps. please excuse my company policy following this line This transmission is intended only for the use of the individual or entity to which it is addressed. The message may contain information that is private and confidential. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any distribution, dissemination or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately by return E-mail and remove the original message. Thank You. The content of this message is not given or endorsed by HEX unless such content relates to the official business of the firm. HEX reserves the right to monitor all E-mail communications through its networks. The attachments have been scanned for viruses prior to leaving our E-mail server. HEX shall not be liable for any consequences of any virus being passed on.