LayerNameList.cjs 754 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. const types = require('../../tokenizer/types.cjs');
  3. const name = 'LayerNameList';
  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.LayerName());
  14. if (this.tokenType !== types.Comma) {
  15. break;
  16. }
  17. this.next();
  18. this.skipSC();
  19. }
  20. return {
  21. type: 'LayerNameList',
  22. loc: this.getLocationFromList(children),
  23. children
  24. };
  25. }
  26. function generate(node) {
  27. this.children(node, () => this.token(types.Comma, ','));
  28. }
  29. exports.generate = generate;
  30. exports.name = name;
  31. exports.parse = parse;
  32. exports.structure = structure;