Files
less.js/lib/less/tree/value.js
Daniel Katz ff029c34bd Syntax changed to !merge(space | comma)
* Syntax changed to !merge(space | comma)
* !merge(space) implemented by Expression instead of Value.
* Added test for lonely property with !merge directive
2013-07-05 06:51:40 +01:00

28 lines
657 B
JavaScript

(function (tree) {
tree.Value = function (value) {
this.value = value;
};
tree.Value.prototype = {
type: "Value",
accept: function (visitor) {
this.value = visitor.visit(this.value);
},
eval: function (env) {
if (this.value.length === 1) {
return this.value[0].eval(env);
} else {
return new(tree.Value)(this.value.map(function (v) {
return v.eval(env);
}));
}
},
toCSS: function (env) {
return this.value.map(function (e) {
return e.toCSS(env);
}).join(env.compress ? ',' : ', ');
}
};
})(require('../tree'));