1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| module.exports = {
| name: 'Selector',
| structure: {
| children: [[
| 'TypeSelector',
| 'IdSelector',
| 'ClassSelector',
| 'AttributeSelector',
| 'PseudoClassSelector',
| 'PseudoElementSelector',
| 'Combinator',
| 'WhiteSpace'
| ]]
| },
| parse: function() {
| var 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: children
| };
| },
| generate: function(node) {
| this.children(node);
| }
| };
|
|