Changes:
+ * added an exception when the template passed to "use" is not a string
* made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
* added {% line \d+ %} directive
template, if it does not define macros, and if the body is empty. But it
can *use* other templates.
+.. note::
+
+ Because ``use`` statements are resolved independently of the context
+ passed to the template, the template reference cannot be an expression.
+
The main template can also override any imported block. If the template
already defines the ``sidebar`` block, then the one defined in ``blocks.html``
is ignored. To avoid name conflicts, you can rename imported blocks:
public function parse(Twig_Token $token)
{
$template = $this->parser->getExpressionParser()->parseExpression();
+
+ if (!$template instanceof Twig_Node_Expression_Constant) {
+ throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $token->getLine());
+ }
+
$stream = $this->parser->getStream();
$targets = array();