Merge branch '2.x' into 3.x

* 2.x:
  macros imported "globally" in a template are now available in macros without re-importing them
  added more tests
  added some tests
This commit is contained in:
Fabien Potencier
2019-05-17 14:16:15 +02:00
24 changed files with 205 additions and 41 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ final class FromTokenParser extends AbstractTokenParser
$stream->expect(/* Token::BLOCK_END_TYPE */ 3);
$var = new AssignNameExpression($this->parser->getVarName(), $token->getLine());
$node = new ImportNode($macro, $var, $token->getLine(), $this->getTag());
$node = new ImportNode($macro, $var, $token->getLine(), $this->getTag(), $this->parser->isMainScope());
foreach ($targets as $name => $alias) {
$this->parser->addImportedSymbol('function', $alias, 'macro_'.$name, $var);