summaryrefslogtreecommitdiff
path: root/src/eval/ops.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/ops.rs')
-rw-r--r--src/eval/ops.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/eval/ops.rs b/src/eval/ops.rs
index ede1230f..23530c10 100644
--- a/src/eval/ops.rs
+++ b/src/eval/ops.rs
@@ -22,9 +22,9 @@ pub fn join(lhs: Value, rhs: Value) -> StrResult<Value> {
(Str(a), Str(b)) => Str(a + b),
(Array(a), Array(b)) => Array(a + b),
(Dict(a), Dict(b)) => Dict(a + b),
- (Template(a), Template(b)) => Template(a + b),
- (Template(a), Str(b)) => Template(a + b),
- (Str(a), Template(b)) => Template(a + b),
+ (Node(a), Node(b)) => Node(a + b),
+ (Node(a), Str(b)) => Node(a + super::Node::Text(b)),
+ (Str(a), Node(b)) => Node(super::Node::Text(a) + b),
(a, b) => mismatch!("cannot join {} with {}", a, b),
})
}
@@ -84,9 +84,9 @@ pub fn add(lhs: Value, rhs: Value) -> StrResult<Value> {
(Str(a), Str(b)) => Str(a + b),
(Array(a), Array(b)) => Array(a + b),
(Dict(a), Dict(b)) => Dict(a + b),
- (Template(a), Template(b)) => Template(a + b),
- (Template(a), Str(b)) => Template(a + b),
- (Str(a), Template(b)) => Template(a + b),
+ (Node(a), Node(b)) => Node(a + b),
+ (Node(a), Str(b)) => Node(a + super::Node::Text(b)),
+ (Str(a), Node(b)) => Node(super::Node::Text(a) + b),
(a, b) => {
if let (Dyn(a), Dyn(b)) = (&a, &b) {
@@ -179,8 +179,8 @@ pub fn mul(lhs: Value, rhs: Value) -> StrResult<Value> {
(Int(a), Str(b)) => Str(repeat_str(b, a)?),
(Array(a), Int(b)) => Array(a.repeat(b)?),
(Int(a), Array(b)) => Array(b.repeat(a)?),
- (Template(a), Int(b)) => Template(a.repeat(b)?),
- (Int(a), Template(b)) => Template(b.repeat(a)?),
+ (Node(a), Int(b)) => Node(a.repeat(b)?),
+ (Int(a), Node(b)) => Node(b.repeat(a)?),
(a, b) => mismatch!("cannot multiply {} with {}", a, b),
})
@@ -297,7 +297,7 @@ pub fn equal(lhs: &Value, rhs: &Value) -> bool {
(Str(a), Str(b)) => a == b,
(Array(a), Array(b)) => a == b,
(Dict(a), Dict(b)) => a == b,
- (Template(a), Template(b)) => a == b,
+ (Node(a), Node(b)) => a == b,
(Func(a), Func(b)) => a == b,
(Dyn(a), Dyn(b)) => a == b,