From 3cad6bf60785d899ecb78b557bf7ba3cd8903e56 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 29 Jan 2022 18:14:51 +0100 Subject: [PATCH] Allow to add `none` and node --- src/eval/ops.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/eval/ops.rs b/src/eval/ops.rs index 94e577182..649b8467e 100644 --- a/src/eval/ops.rs +++ b/src/eval/ops.rs @@ -84,6 +84,9 @@ pub fn add(lhs: Value, rhs: Value) -> StrResult { (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),