MediaQueryList.js 789 B

123456789101112131415161718192021222324252627282930313233343536
  1. var COMMA = require('../../tokenizer').TYPE.Comma;
  2. module.exports = {
  3. name: 'MediaQueryList',
  4. structure: {
  5. children: [[
  6. 'MediaQuery'
  7. ]]
  8. },
  9. parse: function(relative) {
  10. var children = this.createList();
  11. this.scanner.skipSC();
  12. while (!this.scanner.eof) {
  13. children.push(this.MediaQuery(relative));
  14. if (this.scanner.tokenType !== COMMA) {
  15. break;
  16. }
  17. this.scanner.next();
  18. }
  19. return {
  20. type: 'MediaQueryList',
  21. loc: this.getLocationFromList(children),
  22. children: children
  23. };
  24. },
  25. generate: function(node) {
  26. this.children(node, function() {
  27. this.chunk(',');
  28. });
  29. }
  30. };