On Fri, Jun 19, 2009 at 8:07 PM, Andy Chu<[email protected]> wrote:
>
>> {.section group}
>> {.section @|plural?}
>>  There are {num} people in group {name}.
>> {.or}
>>  There is one person in group {name}.
>> {.end}
>> {.end}
>
> I don't see the rule that this is implying.  If plural? returns
> "null", then how does the {.or} section have access to {name}?  I
> don't see how wrapping it in another section does it.  Any rule I can
> infer here will have a bunch of special cases and require keeping
> track of more state.

I was assuming here that the new value is pushed on
the name lookup stack only in the true half of the .section.

>>> {.section group|plural?}
>>>   {@|fancy-formatter-for-plural-groups}
>>> {.or}
>>>   There is one person in group {name}.  {# No fancy formatter}
>>> {.end}
>>
>> {.section group|plural?}
>>  {@|fancy-formatter-for-plural-groups}
>> {.or}
>>  There is one person in group {group.name}.  {# No fancy formatter}
>> {.end}
>
> Also don't get this -- is the {group.name} vs. {name} a purposeful
> disambiguation?  I don't see why this is done differently than the
> first case.

There's already a value stack, so if group was a valid name
in the .section line, then even if something did get pushed
onto the value stack during the .or, the lookup could still
find group again, and then use group.name.

Russ

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON 
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to