parse.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. exports.__esModule = true;
  3. exports.default = parse;
  4. var _input = require('postcss/lib/input');
  5. var _input2 = _interopRequireDefault(_input);
  6. var _preprocess = require('./preprocess');
  7. var _preprocess2 = _interopRequireDefault(_preprocess);
  8. var _tokenize = require('./tokenize');
  9. var _tokenize2 = _interopRequireDefault(_tokenize);
  10. var _parser = require('./parser');
  11. var _parser2 = _interopRequireDefault(_parser);
  12. var _liner = require('./liner');
  13. var _liner2 = _interopRequireDefault(_liner);
  14. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15. function parse(source, opts) {
  16. var input = new _input2.default(source, opts);
  17. var parser = new _parser2.default(input);
  18. parser.tokens = (0, _tokenize2.default)(input);
  19. parser.parts = (0, _preprocess2.default)(input, (0, _liner2.default)(parser.tokens));
  20. parser.loop();
  21. return parser.root;
  22. }
  23. module.exports = exports['default'];
  24. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlLmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsInNvdXJjZSIsIm9wdHMiLCJpbnB1dCIsIklucHV0IiwicGFyc2VyIiwiUGFyc2VyIiwidG9rZW5zIiwicGFydHMiLCJsb29wIiwicm9vdCJdLCJtYXBwaW5ncyI6Ijs7O2tCQU93QkEsSzs7QUFQeEI7Ozs7QUFFQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7O0FBRWUsU0FBU0EsS0FBVCxDQUFnQkMsTUFBaEIsRUFBd0JDLElBQXhCLEVBQThCO0FBQzNDLE1BQUlDLFFBQVEsSUFBSUMsZUFBSixDQUFVSCxNQUFWLEVBQWtCQyxJQUFsQixDQUFaOztBQUVBLE1BQUlHLFNBQVMsSUFBSUMsZ0JBQUosQ0FBV0gsS0FBWCxDQUFiO0FBQ0FFLFNBQU9FLE1BQVAsR0FBZ0Isd0JB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