Urara-Blog/node_modules/.pnpm-store/v3/files/1c/7e05e2769903a85160c96f3787df9fe275725f5b7bc2e04483598a6786c955c51d2812f86b12069180bfd635bea62fb07f1d4b287d129d7d828576203947cd
2022-08-14 01:14:53 +08:00

35 lines
676 B
Text

import { Comma } from '../../tokenizer/index.js';
export const name = 'SelectorList';
export const walkContext = 'selector';
export const structure = {
children: [[
'Selector',
'Raw'
]]
};
export function parse() {
const children = this.createList();
while (!this.eof) {
children.push(this.Selector());
if (this.tokenType === Comma) {
this.next();
continue;
}
break;
}
return {
type: 'SelectorList',
loc: this.getLocationFromList(children),
children
};
}
export function generate(node) {
this.children(node, () => this.token(Comma, ','));
}