MediaQueryList.cjs 734 B

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