summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-30 01:41:52 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-30 01:41:52 (GMT)
commit9259d57659f61e9e56942bb36125f605f8f3c338 (patch)
tree7affbbd5f524887c715fc2ecc7e8a3aaacb55ac8 /src/value.cc
parent8c94c31dd2e5e85fc13d39fcd57b26df7afefe1e (diff)
parentf3b3eaac687f0ba9a2a9b9382e7b605f106bf2b0 (diff)
Merge branch 'master' into visitortests
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index 53fd6dc..685bf81 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -193,6 +193,9 @@ Value Value::operator < (const Value &v) const
if (this->type == NUMBER && v.type == NUMBER) {
return Value(this->num < v.num);
}
+ else if (this->type == STRING && v.type == STRING) {
+ return Value(this->text < v.text);
+ }
return Value();
}
@@ -201,6 +204,9 @@ Value Value::operator <= (const Value &v) const
if (this->type == NUMBER && v.type == NUMBER) {
return Value(this->num <= v.num);
}
+ else if (this->type == STRING && v.type == STRING) {
+ return Value(this->text <= v.text);
+ }
return Value();
}
@@ -240,6 +246,9 @@ Value Value::operator >= (const Value &v) const
if (this->type == NUMBER && v.type == NUMBER) {
return Value(this->num >= v.num);
}
+ else if (this->type == STRING && v.type == STRING) {
+ return Value(this->text >= v.text);
+ }
return Value();
}
@@ -248,6 +257,9 @@ Value Value::operator > (const Value &v) const
if (this->type == NUMBER && v.type == NUMBER) {
return Value(this->num > v.num);
}
+ else if (this->type == STRING && v.type == STRING) {
+ return Value(this->text > v.text);
+ }
return Value();
}
contact: Jan Huwald // Impressum