[Templates] Those @#&$(*&^!!*^*& [%'s,

Paul Seamons mail at seamons.com
Fri Apr 11 20:44:07 BST 2008


> Gotcha 1.  If you have a block that you have concatenated
> together to avoid running out of % signs. (They cost more, you
> know. Semicolons are much cheaper.  I get them in bigger boxes)
> AND in your cleverness you make a mistake. (hang head in
> shame...) the parser spits out a message like
> 'Unexpected token foo found in lines 87-112'  Great.  foo is used
> 7 times, WHICH foo is the problem.  If ';' is the equivalent of
> '%] [%' surely the parser can be beaten over the head and ears to
> spit out a line number, or even spit out the line containing the
> error.

This isn't a solution for ttree - but it will tell you where the error is.  
You will need to use ttree to begin - get the error, and then check the 
offending file using the following:

perl -e 'use Template::Alloy; 
Template::Alloy->new(ABSOLUTE=>1)->load_template("/bad/parse/file.html"); 
print "OK\n"'

It will spit out the line and character that the error occurred at.

Paul



More information about the templates mailing list