aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-22 20:22:33 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-08-22 20:22:33 +0200
commit770b12cc2274df8e86ce89b9047bfd3a51954a7f (patch)
tree146dd4f140c288715758413a1fac0e8d60140460
parentec5a2ebbb375d5ad49daeba72ec6aeb874d4a81e (diff)
downloadaskama-770b12cc2274df8e86ce89b9047bfd3a51954a7f.tar.gz
askama-770b12cc2274df8e86ce89b9047bfd3a51954a7f.tar.bz2
askama-770b12cc2274df8e86ce89b9047bfd3a51954a7f.zip
Rename method call internals for clarity
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs6
-rw-r--r--askama_derive/src/parser.rs4
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<Expr<'a>>),
BinOp(&'a str, Box<Expr<'a>>, Box<Expr<'a>>),
Group(Box<Expr<'a>>),
- Call(Box<Expr<'a>>, &'a str, Vec<Expr<'a>>),
+ MethodCall(Box<Expr<'a>>, &'a str, Vec<Expr<'a>>),
}
#[derive(Debug)]
@@ -173,7 +173,7 @@ named!(expr_attr<Expr>, 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)
};