diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-26 17:06:48 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-26 17:06:48 +0200 |
commit | 1d914727b137b684edd0d64e6d0b30ab155fa87c (patch) | |
tree | e09943001bfe76dc8ae3faf6c674a1fc97eb3f45 /askama_shared | |
parent | df58dcb49db77b2c283db3c9a8a738bdff3a8e37 (diff) | |
download | askama-1d914727b137b684edd0d64e6d0b30ab155fa87c.tar.gz askama-1d914727b137b684edd0d64e6d0b30ab155fa87c.tar.bz2 askama-1d914727b137b684edd0d64e6d0b30ab155fa87c.zip |
Insert macro parameter into locals after defining it (fixes #53)
Diffstat (limited to 'askama_shared')
-rw-r--r-- | askama_shared/src/generator.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index e135c13..a37b51f 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -442,10 +442,10 @@ impl<'a> Generator<'a> { self.prepare_ws(&def.ws1); for (i, arg) in def.args.iter().enumerate() { self.write(&format!("let {} = &", arg)); - self.locals.insert(arg); self.visit_expr(args.get(i) .expect(&format!("macro '{}' takes more than {} arguments", name, i))); self.writeln(";"); + self.locals.insert(arg); } self.handle(state, &def.nodes, AstLevel::Nested); self.flush_ws(&def.ws2); |