summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/value.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index 5d32f8b7..1c2541b8 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -811,6 +811,26 @@ bool value_t::is_less_than(const value_t& val) const
return as_string() < val.as_string();
break;
+ case SEQUENCE:
+ switch (val.type()) {
+ case INTEGER:
+ case AMOUNT: {
+ if (val.is_nonzero())
+ break;
+
+ bool no_amounts = true;
+ foreach (const value_t& value, as_sequence()) {
+ if (value >= 0L)
+ return false;
+ no_amounts = false;
+ }
+ return ! no_amounts;
+ }
+ default:
+ break;
+ }
+ break;
+
default:
break;
}
@@ -881,6 +901,26 @@ bool value_t::is_greater_than(const value_t& val) const
return as_string() > val.as_string();
break;
+ case SEQUENCE:
+ switch (val.type()) {
+ case INTEGER:
+ case AMOUNT: {
+ if (val.is_nonzero())
+ break;
+
+ bool no_amounts = true;
+ foreach (const value_t& value, as_sequence()) {
+ if (value <= 0L)
+ return false;
+ no_amounts = false;
+ }
+ return ! no_amounts;
+ }
+ default:
+ break;
+ }
+ break;
+
default:
break;
}