Urara-Blog/node_modules/.pnpm-store/v3/files/65/5d584b5c893086e260d24963294ecd2cd9c8f0343a90fa7ec61cecb3c5f022c4e25e26d34df935de14ab818791d01f4dc66b1e30d24b1f36712b8e5d323f56
2022-08-14 01:14:53 +08:00

39 lines
781 B
Text

'use strict';
const name = 'Selector';
const structure = {
children: [[
'TypeSelector',
'IdSelector',
'ClassSelector',
'AttributeSelector',
'PseudoClassSelector',
'PseudoElementSelector',
'Combinator',
'WhiteSpace'
]]
};
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
};
}
function generate(node) {
this.children(node);
}
exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;