LayerList.js 663 B

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