diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-14 22:01:02 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-14 22:01:02 +0200 |
commit | 9552bd50403955cfdcac18757ea942894c891fe8 (patch) | |
tree | 6252a13712411b5c23d35fc2fac23e7a9473f141 /askama_derive/src/generator.rs | |
parent | d83959d976d69d6de3bbd150c5cc46556456a824 (diff) | |
download | askama-9552bd50403955cfdcac18757ea942894c891fe8.tar.gz askama-9552bd50403955cfdcac18757ea942894c891fe8.tar.bz2 askama-9552bd50403955cfdcac18757ea942894c891fe8.zip |
Introduce and clean up scopes where necessary
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r-- | askama_derive/src/generator.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 75e4a2d..3c97845 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -331,7 +331,9 @@ impl<'a> Generator<'a> { }, } self.writeln(" {"); + self.locals.push(); self.handle(nodes); + self.locals.pop(); } self.handle_ws(ws); self.writeln("}"); @@ -371,7 +373,11 @@ impl<'a> Generator<'a> { -> ::askama::Result<()> {{", name)); self.prepare_ws(ws1); + + self.locals.push(); self.handle(nodes); + self.locals.pop(); + self.flush_ws(ws2); self.writeln("Ok(())"); self.writeln("}"); |