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

36 lines
789 B

4 years ago
  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. };