[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: '__iter', yet again!
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Thu, 17 Dec 2009 17:52:16 +0100
2009/12/17 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> After thinking more about what you want, I realize it would be easy to
>> implement using token filters. All you need is a filter that converts:
>> for k,v in <expressions> do end
>> into:
>> for k,v in __iter_handler( <expressions> ) do end
>
>> Of course the token filter is not trivial because it would have to
>> recognize the expression end, but that is a feature many token filters
>> need, so you may be able to find it already implemented.
>
> Other application do need to recognize expressions but in this case you
> you only need to issue "__iter_handler(" after "in" and ")" before "do".
But you have to distinguish which "do" belong to a generic for. And
you cannot assume it's the first one since the expression list may
contain function definition, with arbitrary code in there.
- References:
- Re: '__iter', yet again!, Jerome Vuarand
- Re: '__iter', yet again!, Jerome Vuarand
- Re: '__iter', yet again!, Luiz Henrique de Figueiredo
- Re: '__iter', yet again!, steve donovan
- Re: '__iter', yet again!, Jerome Vuarand
- Re: '__iter', yet again!, Luiz Henrique de Figueiredo