[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Vala] Improved foreach



On Mon, May 26, 2008 00:45, Jamie McCracken wrote:
> On Sun, 2008-05-25 at 23:51 +0200, Jürg Billeter wrote:
>> On Sun, 2008-05-25 at 00:51 -0400, Jamie McCracken wrote:
>> > Var to be used in foreach
>>
>> We should certainly allow this, also in Vala. The logic in
>> ForeachStatement.accept_children is slightly broken as you're missing
>> visit_end_full_expression in the "var" case. It also seems that you
>> could simplify some changes in the semantic analyzer by reordering but
>> difficult to see as you've mixed two change sets, please keep patches
>> separated.
>>
>
> updated patch attached with just the VAR in foreach
>
> in the var case, accept_collection is called first then element type is
> calculated and type reference is set then accept_children is called
> which will now hit visit_end_full_expression as type-reference is no
> longer null
>
> if above is not right then please explain...

It may work but the logic is not as simple as it could be. I've updated
the patch to always visit the child nodes in the same order exactly once
and committed it together with the `var' support in the Vala parser.

Thanks,

Juerg



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]