You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
595 B
JavaScript

const Input = require('postcss/lib/input');
const LessParser = require('./LessParser');
const LessStringifier = require('./LessStringifier');
module.exports = {
parse(less, options) {
const input = new Input(less, options);
const parser = new LessParser(input);
parser.parse();
return parser.root;
},
stringify(node, builder) {
const stringifier = new LessStringifier(builder);
stringifier.stringify(node);
},
nodeToString(node) {
let result = '';
module.exports.stringify(node, (bit) => {
result += bit;
});
return result;
}
};