> Sergey> As I can see, current TT2 parser is not state-driven.
The real
> Sergey> disadvnatage is that you cannot use things like this 
> [% var = '%]'
> Sergey> %] in template.
> 
> What would you want that to do?  I capture blocks with:
> 
>     [% var = BLOCK %]
>     Lots ...
>     [% END %]
> 
> Works great.

Me too :) But I was telling not about block capturing, but about
having literals '[%' or '%]' in string without breaking the
parser.

To be honest, I have never tried to write a construction like that
[% var = '%]' %]
until I examined Template::Parser module and noticed that it
should not work.


The one (and only?) case when such an assignment could be useful
is described in Template::FAQ (section "If I'm using TT to write
out a TT template").


I don't think it is a big trouble - one can always write something
like "%\]" or '%' _ ']'. But anyway it may be considered as a bug,
or at least strange behaviour. I expect that when I write
single-quoted string, the parser will not care what is inside,
until it meets second (closing) single quote (as is is in perl and
other languages).


-- 
Sergey Martynoff


_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to