summaryrefslogtreecommitdiff
path: root/src/eval/ops.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-02-02 16:02:23 +0100
committerLaurenz <laurmaedje@gmail.com>2022-02-02 16:02:23 +0100
commita7b403fd742941f6b163f06876aec96729db707f (patch)
treeb5062eddbcb814713b65f59d3f59dfe7e2bcaca8 /src/eval/ops.rs
parent0a1916c1e4259aff1306b26c06d4edcf0f190a3b (diff)
Rename `Node` to `Template`
Diffstat (limited to 'src/eval/ops.rs')
-rw-r--r--src/eval/ops.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/eval/ops.rs b/src/eval/ops.rs
index 649b8467..b5fa9f9a 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),
- (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),
+ (Template(a), Template(b)) => Template(a + b),
+ (Template(a), Str(b)) => Template(a + super::Template::Text(b)),
+ (Str(a), Template(b)) => Template(super::Template::Text(a) + b),
(a, b) => mismatch!("cannot join {} with {}", a, b),
})
}
@@ -85,11 +85,11 @@ pub fn add(lhs: Value, rhs: Value) -> StrResult<Value> {
(Array(a), Array(b)) => Array(a + b),
(Dict(a), Dict(b)) => Dict(a + b),
- (Node(a), None) => Node(a),
- (None, Node(b)) => Node(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),
+ (Template(a), None) => Template(a),
+ (None, Template(b)) => Template(b),
+ (Template(a), Template(b)) => Template(a + b),
+ (Template(a), Str(b)) => Template(a + super::Template::Text(b)),
+ (Str(a), Template(b)) => Template(super::Template::Text(a) + b),
(a, b) => {
if let (Dyn(a), Dyn(b)) = (&a, &b) {
@@ -178,8 +178,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)?),
- (Node(a), Int(b)) => Node(a.repeat(b)?),
- (Int(a), Node(b)) => Node(b.repeat(a)?),
+ (Template(a), Int(b)) => Template(a.repeat(b)?),
+ (Int(a), Template(b)) => Template(b.repeat(a)?),
(a, b) => mismatch!("cannot multiply {} with {}", a, b),
})
@@ -296,7 +296,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,
- (Node(a), Node(b)) => a == b,
+ (Template(a), Template(b)) => a == b,
(Func(a), Func(b)) => a == b,
(Dyn(a), Dyn(b)) => a == b,