2010-06-16 06:44:59 +08:00
|
|
|
(function (tree) {
|
2010-03-02 04:32:21 +08:00
|
|
|
|
2010-06-19 13:51:26 +08:00
|
|
|
tree.Expression = function (value) { this.value = value };
|
2010-03-08 12:38:10 +08:00
|
|
|
tree.Expression.prototype = {
|
|
|
|
eval: function (env) {
|
|
|
|
if (this.value.length > 1) {
|
|
|
|
return new(tree.Expression)(this.value.map(function (e) {
|
|
|
|
return e.eval(env);
|
|
|
|
}));
|
|
|
|
} else {
|
|
|
|
return this.value[0].eval(env);
|
2010-02-24 02:39:05 +08:00
|
|
|
}
|
2010-03-08 12:38:10 +08:00
|
|
|
},
|
2010-05-08 11:21:16 +08:00
|
|
|
toCSS: function () {
|
|
|
|
return this.value.map(function (e) {
|
|
|
|
return e.toCSS();
|
|
|
|
}).join(' ');
|
2010-03-08 12:38:10 +08:00
|
|
|
}
|
2010-02-24 02:39:05 +08:00
|
|
|
};
|
2010-06-16 06:44:59 +08:00
|
|
|
|
|
|
|
})(require('less/tree'));
|