[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: expression parser change
- From: "E. Toernig" <froese@...>
- Date: Thu, 23 Dec 2010 01:15:21 +0100
Kevin Vermeer wrote:
>
> A real-life example of code that would break in a different fashion, that I
> (and others, I'm sure) have used many times is code like the following line:
>
> -- Get stdout stream by running "cmd", convert to string, and trim it.
> local cmd = io.popen "cmd":read "*a":gsub("^%s*(.-)%s*$", "%1")
>
> The current policy allows the ':' operator to work as a pipe between these
> functions. The proposed change would, unfortunately, try to call 'read' on
> the string "cmd" and gsub on the string "*a".
I'm not sure whether you are talking about may patch or Pavel's suggestion
but I can assure you, that my patch parses your example exactly like current
Lua and as you want it to be parsed.
Ciao, ET.