LayerList.cjs 769 B

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