8 Apr 2009 20:27
Re: New bflang2 language highlighting for Smarty
On Fri, 2009-04-03 at 01:55 +0300, alex bodnaru wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> hi Lindsay, everybody,
>
> that's a very important feature in my opinion too, that might open options for
> multiple html template languages as well.
>
> one question/reminder: did you treat js and css as includable languages as well?
In Smarty templates, these languages need to be exempted altogether from
template processing since they make use of curly braces, which are also
the tag delimiters for Smarty template processing commands. Smarty
therefore defines a pair of template tags, "{literal}" and "{/literal}",
which delimit sections of code which the Smarty engine will skip over.
smarty.bflang2 handles this by defining a context between these
delimiters where the contents of all-html.bfinc are included, and
all-html.bfinc handles css and js since it's pulled from html.bflang2.
So the answer to your question is no, because js and css are already
included in all-html.bfinc. They _could_ be treated as nested language
contexts, but this wasn't necessary in smarty.bflang2.
The bflang2 paradigm seems to make the implementation of nested language
contexts a bit awkward, to say the least. There needs to be some way of
unambiguously defining language contexts for which the defining
delimiters trump _any_ context in which they occur and switch into or
out of that language context. I ran into this in working on the "{php}"
(Continue reading)
RSS Feed