2011-01-18 03:46:22 +08:00
|
|
|
(function(tree) {
|
2010-12-02 04:33:17 +08:00
|
|
|
|
2011-01-18 03:46:22 +08:00
|
|
|
tree.Comparison = function(str) {
|
2010-12-02 04:33:17 +08:00
|
|
|
this.value = str;
|
|
|
|
};
|
2011-01-21 01:28:59 +08:00
|
|
|
|
2010-12-02 04:33:17 +08:00
|
|
|
tree.Comparison.prototype = {
|
2011-01-18 03:46:22 +08:00
|
|
|
toCSS: function() {
|
2010-12-02 04:33:17 +08:00
|
|
|
return {
|
|
|
|
'<': '<',
|
|
|
|
'>': '>',
|
|
|
|
'=': '=',
|
2011-01-21 01:28:59 +08:00
|
|
|
'!=': '!=',
|
2011-01-20 07:01:30 +08:00
|
|
|
'<=': '<=',
|
|
|
|
'>=': '>='}[this.value];
|
2010-12-02 04:33:17 +08:00
|
|
|
},
|
2011-01-21 01:28:59 +08:00
|
|
|
negate: function() {
|
2011-01-22 05:17:52 +08:00
|
|
|
return new tree.Comparison({
|
2011-01-21 01:28:59 +08:00
|
|
|
'<': '>=',
|
|
|
|
'<=': '>',
|
|
|
|
'>': '<=',
|
|
|
|
'>=': '<',
|
|
|
|
'=': '!=',
|
|
|
|
'!=': '='
|
2011-01-21 04:34:19 +08:00
|
|
|
}[this.value]);
|
2011-01-21 01:28:59 +08:00
|
|
|
},
|
2011-01-18 03:46:22 +08:00
|
|
|
eval: function() {
|
2010-12-02 04:33:17 +08:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-01-06 03:23:28 +08:00
|
|
|
})(require('mess/tree'));
|