mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
tree.js init
This commit is contained in:
20
lib/less/tree.js
Normal file
20
lib/less/tree.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var path = require('path');
|
||||
var tree = exports;
|
||||
|
||||
['color', 'directive', 'operation', 'dimension',
|
||||
'keyword', 'variable', 'ruleset', 'element',
|
||||
'selector', 'quoted', 'expression', 'rule',
|
||||
'call', 'url', 'alpha'
|
||||
].forEach(function (n) {
|
||||
process.mixin(tree, require(path.join('less', 'node', n)));
|
||||
});
|
||||
|
||||
tree.operate = function (op, a, b) {
|
||||
switch (op) {
|
||||
case '+': return a + b;
|
||||
case '-': return a - b;
|
||||
case '*': return a * b;
|
||||
case '/': return a / b;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user