Skip to content

Commit

Permalink
parse SelectorList as balanced Raw when parseSelector is false
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Feb 5, 2017
1 parent 43e8193 commit 1695f8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
6 changes: 5 additions & 1 deletion lib/parser/type/Rule.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
var TYPE = require('../../tokenizer').TYPE;
var LEFTCURLYBRACKET = TYPE.LeftCurlyBracket;
var BALANCED = true;

module.exports = function Rule() {
var start = this.scanner.tokenStart;
var selector = this.SelectorList();
var selector = this.parseSelector ? this.SelectorList() : this.Raw(BALANCED, LEFTCURLYBRACKET, 0);
var block = this.Block(this.Declaration);

return {
Expand Down
13 changes: 2 additions & 11 deletions test/fixture/parse/rule/Rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -1001,17 +1001,8 @@
"ast": {
"type": "Rule",
"selector": {
"type": "SelectorList",
"children": [
{
"type": "Raw",
"value": ".foo"
},
{
"type": "Raw",
"value": " a:not(a = b) "
}
]
"type": "Raw",
"value": ".foo, a:not(a = b) "
},
"block": {
"type": "Block",
Expand Down

0 comments on commit 1695f8c

Please sign in to comment.