Add comment about subtleties of code generation for includes

This commit is contained in:
Dirkjan Ochtman 2018-07-25 14:35:20 +01:00
parent fdd90a4e1c
commit 9d8e55b24d

View File

@ -537,6 +537,8 @@ impl<'a> Generator<'a> {
let src = get_template_source(&path);
let nodes = parser::parse(&src);
{
// Since nodes must not outlive the Generator, we instantiate
// a nested Generator here to handle the include's nodes.
let mut gen = self.child();
gen.handle(ctx, &nodes, buf, AstLevel::Nested);
}