github
2680 of 2741 branches covered (97.77%)
51 of 53 new or added lines in 7 files covered. (96.23%)
4 existing lines in 1 file now uncovered.10596 of 10716 relevant lines covered (98.88%)
3218.41 hits per line
|
export const name = 'CompoundSelector'; |
|
|
export const structure = {
|
1✔ |
|
children: [[
|
1✔ |
|
'TypeSelector',
|
1✔ |
|
'IdSelector',
|
1✔ |
|
'ClassSelector',
|
1✔ |
|
'AttributeSelector',
|
1✔ |
|
'PseudoClassSelector',
|
1✔ |
|
'PseudoElementSelector',
|
1✔ |
|
'Combinator',
|
1✔ |
|
'WhiteSpace'
|
1✔ |
|
]] |
1✔ |
|
}; |
1✔ |
|
|
1✔ |
|
export function parse() { |
|
|
const children = this.readSequence(this.scope.Selector); |
44✔ |
|
|
44✔ |
|
// nothing were consumed
|
44✔ |
|
if (this.getFirstListNode(children) === null) { |
|
|
this.error('Selector is expected'); |
4✔ |
|
} |
4✔ |
|
|
|
|
// Selector Contains Combinator
|
40✔ |
|
children.forEach((entry) => { |
|
|
if (entry.type === 'Combinator') { |
|
|
this.error('CompoundSelector is expected'); |
2✔ |
|
} |
2✔ |
|
}); |
40✔ |
|
|
40✔ |
|
return {
|
40✔ |
|
type: 'Selector', // Report as Selector |
40✔ |
|
loc: this.getLocationFromList(children), |
40✔ |
|
children |
40✔ |
|
}; |
40✔ |
|
} |
44✔ |
|
|
1✔ |
|
export function generate(node) { |
1✔ |
NEW
|
this.children(node);
|
× |
NEW
|
} |
× |