diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-07-25 14:35:20 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2018-07-25 14:35:20 +0100 |
commit | 9d8e55b24ddf5c9b4cf20a30683928ce928a282d (patch) | |
tree | c91bbbf4e0e21b53e718c67e4eac78715998971b /askama_derive | |
parent | fdd90a4e1cf259422d3f5dc1c866068026b9e71e (diff) | |
download | askama-9d8e55b24ddf5c9b4cf20a30683928ce928a282d.tar.gz askama-9d8e55b24ddf5c9b4cf20a30683928ce928a282d.tar.bz2 askama-9d8e55b24ddf5c9b4cf20a30683928ce928a282d.zip |
Add comment about subtleties of code generation for includes
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/generator.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 24370fa..2f6c875 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -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); } |