Re: [Pyobjc-dev] Objective-P?
Brought to you by:
ronaldoussoren
From: Greg E. <gre...@ca...> - 2009-11-16 23:38:42
|
Anders Hovmöller wrote: > As I understand it there are three cases: > 1. [1, 2, 3] # explicit list > 2. [x for x in foo] # list comprehension > 3. [foo bar] # objc message send > So the only thing I needed to do was to split once on zero or more > spaces and if the second identifier is "for" or begins with comma it's > python code and I should leave it alone. Um, not quite... [foo.baz bar] [foo[baz] bar] [foo.baz(42) bar] [foo+baz bar] etc. However you're probably right if you're willing to do a full parse, since you end up with an expression followed immediately by an identifier, which is not currently legal. -- Greg |