aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama/src/generator.rs6
-rw-r--r--askama/src/parser.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/askama/src/generator.rs b/askama/src/generator.rs
index 66a266c..d8018c6 100644
--- a/askama/src/generator.rs
+++ b/askama/src/generator.rs
@@ -95,7 +95,7 @@ impl<'a> Generator<'a> {
self.write(")");
}
- fn visit_compare(&mut self, op: &str, left: &Expr, right: &Expr) {
+ fn visit_binop(&mut self, op: &str, left: &Expr, right: &Expr) {
self.visit_expr(left);
self.write(&format!(" {} ", op));
self.visit_expr(right);
@@ -106,8 +106,8 @@ impl<'a> Generator<'a> {
Expr::StrLit(s) => self.visit_str_lit(s),
Expr::Var(s) => self.visit_var(s),
Expr::Filter(name, ref val) => self.visit_filter(name, val),
- Expr::Compare(op, ref left, ref right) =>
- self.visit_compare(op, left, right),
+ Expr::BinOp(op, ref left, ref right) =>
+ self.visit_binop(op, left, right),
}
}
diff --git a/askama/src/parser.rs b/askama/src/parser.rs
index 8265213..5f14482 100644
--- a/askama/src/parser.rs
+++ b/askama/src/parser.rs
@@ -5,7 +5,7 @@ pub enum Expr<'a> {
StrLit(&'a str),
Var(&'a str),
Filter(&'a str, Box<Expr<'a>>),
- Compare(&'a str, Box<Expr<'a>>, Box<Expr<'a>>),
+ BinOp(&'a str, Box<Expr<'a>>, Box<Expr<'a>>),
}
pub enum Target<'a> {
@@ -113,8 +113,8 @@ named!(expr_compare<Expr>, do_parse!(
tag_s!("<=") | tag_s!("<")
)) >>
right: expr_filtered >>
- (Expr::Compare(str::from_utf8(op).unwrap(),
- Box::new(left), Box::new(right)))
+ (Expr::BinOp(str::from_utf8(op).unwrap(),
+ Box::new(left), Box::new(right)))
));
named!(expr_any<Expr>, alt!(