carto/lib/less/tree.js
2010-03-01 20:03:43 -05:00

25 lines
594 B
JavaScript

var path = require('path');
var tree = exports;
require.paths.unshift(__dirname);
['color', 'directive', 'operation', 'dimension',
'keyword', 'variable', 'ruleset', 'element',
'selector', 'quoted', 'expression', 'rule',
'call', 'url', 'alpha', 'mixin'
].forEach(function (n) {
process.mixin(tree, require(path.join('less', 'node', n)));
});
require('functions');
tree.operate = function (op, a, b) {
switch (op) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
case '/': return a / b;
}
};