diff --git a/src/Symfony/Bundle/TwigBundle/TokenParser/TransTokenParser.php b/src/Symfony/Bundle/TwigBundle/TokenParser/TransTokenParser.php index 6772b73bfd59..ce7f17e53034 100644 --- a/src/Symfony/Bundle/TwigBundle/TokenParser/TransTokenParser.php +++ b/src/Symfony/Bundle/TwigBundle/TokenParser/TransTokenParser.php @@ -50,7 +50,7 @@ public function parse(\Twig_Token $token) $stream->expect(\Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'decideTransFork'), true); } - } else { + } elseif (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) { throw new \Twig_SyntaxError(sprintf('Unexpected token. Twig was looking for the "from" keyword line %s)', $lineno), -1); } } else {