From: Josh Cheek Date: 2010-07-07T18:15:33+09:00 Subject: Re: Hashes don't allow preceding commas by design? --0015175cd7f286af5f048ac89cf0 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 7, 2010 at 3:36 AM, Peter Hickman < peterhickman386@googlemail.com> wrote: > It's not hashes it is the parser in general. When it parses a line (up to > the newline) if the line appears compete then the parser expects a new > statement on the next line. So with > > 1: => a, b = 1, > 2: => 2 > > Line 1 is incomplete so the parser treats line 2 as a continuation of line > 1. But with > > 1: => a, b = 1 > 2: => ,2 > > Line 1 is complete in that the line contains a valid Ruby statement so the > parser expects the next line to be a new statement, line 2 is in error > because no valid Ruby statements start with a comma. > > This is what you are seeing in your examples. > I think that I feel this should not be the case, because I feel that the interpreter should not consider any of it complete since it is inside of an incomplete hash. However, these examples have me so unsure of what is supposed to be what that I can't construct a response illustrating this. Please double check these examples. --0015175cd7f286af5f048ac89cf0--