diff options
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r-- | askama_derive/src/generator.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 3fa5b9f..0e80265 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -54,9 +54,16 @@ impl Generator { self.write(&format!("self.{}", str::from_utf8(s).unwrap())); } + fn visit_filter(&mut self, name: &str, val: &Expr) { + self.write(&format!("askama::filters::{}(&", name)); + self.visit_expr(val); + self.write(")"); + } + fn visit_expr(&mut self, expr: &Expr) { match expr { &Expr::Var(s) => self.visit_var(s), + &Expr::Filter(name, ref val) => self.visit_filter(name, &val), } } |