From 770b12cc2274df8e86ce89b9047bfd3a51954a7f Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 22 Aug 2017 20:22:33 +0200 Subject: Rename method call internals for clarity --- askama_derive/src/generator.rs | 6 +++--- askama_derive/src/parser.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 3288e22..aa3eadf 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -244,7 +244,7 @@ impl<'a> Generator<'a> { self.write(")"); } - fn visit_call(&mut self, obj: &Expr, method: &str, args: &[Expr]) { + fn visit_method_call(&mut self, obj: &Expr, method: &str, args: &[Expr]) { self.visit_expr(obj); self.write(&format!(".{}(", method)); for (i, arg) in args.iter().enumerate() { @@ -266,8 +266,8 @@ impl<'a> Generator<'a> { Expr::BinOp(op, ref left, ref right) => self.visit_binop(op, left, right), Expr::Group(ref inner) => self.visit_group(inner), - Expr::Call(ref obj, method, ref args) => - self.visit_call(obj, method, args), + Expr::MethodCall(ref obj, method, ref args) => + self.visit_method_call(obj, method, args), } } diff --git a/askama_derive/src/parser.rs b/askama_derive/src/parser.rs index c6c437c..9e8f087 100644 --- a/askama_derive/src/parser.rs +++ b/askama_derive/src/parser.rs @@ -10,7 +10,7 @@ pub enum Expr<'a> { Filter(&'a str, Vec>), BinOp(&'a str, Box>, Box>), Group(Box>), - Call(Box>, &'a str, Vec>), + MethodCall(Box>, &'a str, Vec>), } #[derive(Debug)] @@ -173,7 +173,7 @@ named!(expr_attr, do_parse!( let mut res = obj; for (aname, args) in attrs { res = if args.is_some() { - Expr::Call(Box::new(res), aname, args.unwrap()) + Expr::MethodCall(Box::new(res), aname, args.unwrap()) } else { Expr::Attr(Box::new(res), aname) }; -- cgit