Urara-Blog/node_modules/.pnpm-store/v3/files/8d/7f5e8b708b35ea3b630abc498fe8b949b684c95a7f96f1c51866610cdbfed18d35f5f7e205e1ecd05f3633506121086384605560060ebb01f27b9fae54dd52
2022-08-14 01:14:53 +08:00

32 lines
689 B
Text

export const name = 'Selector';
export const structure = {
children: [[
'TypeSelector',
'IdSelector',
'ClassSelector',
'AttributeSelector',
'PseudoClassSelector',
'PseudoElementSelector',
'Combinator',
'WhiteSpace'
]]
};
export function parse() {
const children = this.readSequence(this.scope.Selector);
// nothing were consumed
if (this.getFirstListNode(children) === null) {
this.error('Selector is expected');
}
return {
type: 'Selector',
loc: this.getLocationFromList(children),
children
};
}
export function generate(node) {
this.children(node);
}