diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-29 18:14:51 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-29 18:14:51 +0100 |
| commit | 3cad6bf60785d899ecb78b557bf7ba3cd8903e56 (patch) | |
| tree | 44af3b98399f3b74149418b89bf684e0e4cbbafb | |
| parent | 5c53b9ff606f927bf0f2e4c40daf19d50ece09d9 (diff) | |
Allow to add `none` and node
| -rw-r--r-- | src/eval/ops.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval/ops.rs b/src/eval/ops.rs index 94e57718..649b8467 100644 --- a/src/eval/ops.rs +++ b/src/eval/ops.rs @@ -84,6 +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), + + (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), |
