aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-10-15 15:02:50 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-10-15 15:02:50 +0200
commit3d9048ab50b1030ff741371ed0d853fcc3ab5780 (patch)
treee8d09841a58aee343a0e847cc9b3e6da71a4c581
parentaa18a4c1598b1cf530e37fa73bceb06dad43afdc (diff)
downloadaskama-3d9048ab50b1030ff741371ed0d853fcc3ab5780.tar.gz
askama-3d9048ab50b1030ff741371ed0d853fcc3ab5780.tar.bz2
askama-3d9048ab50b1030ff741371ed0d853fcc3ab5780.zip
Add some whitespace to write_call()
-rw-r--r--askama_shared/src/generator.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index 13c5072..f58d1dd 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -457,10 +457,12 @@ impl<'a> Generator<'a> {
panic!(format!("macro '{}' not found", name));
}
});
+
self.flush_ws(ws); // Cannot handle_ws() here: whitespace from macro definition comes first
self.locals.push();
self.writeln("{");
self.prepare_ws(&def.ws1);
+
for (i, arg) in def.args.iter().enumerate() {
self.write(&format!("let {} = &", arg));
self.visit_expr(args.get(i)
@@ -469,6 +471,7 @@ impl<'a> Generator<'a> {
self.locals.insert(arg);
}
self.handle(state, &def.nodes, AstLevel::Nested);
+
self.flush_ws(&def.ws2);
self.writeln("}");
self.locals.pop();