I'm trying to get a feel for how the template system works, but
something is confusing me regarding nested blocks.

Lets say we have a simple template:

{% if foo %}
    hello
   {% if bar %}
       bye
   {% endif %}
{% else %}

{% endif %}

Seems like the lexer would produce the following tokens:
<if><text><if><text><endif><else><endif>

So when we create a nodelist, I'd expect the parse statement:
 nodelist_true = parser.parse(('else', 'endif'))

To return the nodes for:
<if><text><if><text><endif>

And not the expected:
<if><text><if><text><endif><else>

Am I missing something about how the lexer/parser does it's magic?  I
don't see how nesting would be handled in the current code, and it's
driving me crazy not knowing how it works.

Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to