2010-03-13 16:34:48 +08:00
|
|
|
if (typeof(require) !== 'undefined') { var tree = require('less/tree') }
|
2010-02-24 02:39:05 +08:00
|
|
|
|
2010-03-02 04:32:21 +08:00
|
|
|
tree.Call = function Call(name, args) {
|
2010-02-24 02:39:05 +08:00
|
|
|
this.name = name;
|
|
|
|
this.args = args;
|
|
|
|
};
|
2010-03-02 08:47:32 +08:00
|
|
|
tree.Call.prototype = {
|
2010-03-12 04:36:50 +08:00
|
|
|
eval: function (env) { return this },
|
2010-03-02 08:47:32 +08:00
|
|
|
toCSS: function (context, env) {
|
2010-03-02 10:48:46 +08:00
|
|
|
var args = this.args.map(function (a) { return a.eval() });
|
2010-03-05 05:13:19 +08:00
|
|
|
if (this.name in tree.functions) {
|
|
|
|
return tree.functions[this.name].apply(tree.functions, args).toCSS();
|
|
|
|
} else {
|
|
|
|
return this.name +
|
|
|
|
"(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")";
|
|
|
|
}
|
2010-03-02 08:47:32 +08:00
|
|
|
}
|
|
|
|
};
|