MediaQueryList.js 628 B

12345678910111213141516171819202122232425262728293031323334
  1. import { Comma } from '../../tokenizer/index.js';
  2. export const name = 'MediaQueryList';
  3. export const structure = {
  4. children: [[
  5. 'MediaQuery'
  6. ]]
  7. };
  8. export function parse() {
  9. const children = this.createList();
  10. this.skipSC();
  11. while (!this.eof) {
  12. children.push(this.MediaQuery());
  13. if (this.tokenType !== Comma) {
  14. break;
  15. }
  16. this.next();
  17. }
  18. return {
  19. type: 'MediaQueryList',
  20. loc: this.getLocationFromList(children),
  21. children
  22. };
  23. }
  24. export function generate(node) {
  25. this.children(node, () => this.token(Comma, ','));
  26. }