From 9552bd50403955cfdcac18757ea942894c891fe8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 14 Aug 2017 22:01:02 +0200 Subject: Introduce and clean up scopes where necessary --- askama_derive/src/generator.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'askama_derive/src/generator.rs') 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("}"); -- cgit