Skip to content

Commit

Permalink
add support for explicit descendant combinator
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 7, 2016
1 parent 53e2fef commit 16e0e95
Show file tree
Hide file tree
Showing 3 changed files with 460 additions and 378 deletions.
14 changes: 12 additions & 2 deletions lib/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,15 +804,25 @@ function getShash() {
};
}

// + | > | ~ | /deep/
// + | > | ~ | /deep/ | >>
function getCombinator() {
var info = getInfo();
var combinator;

switch (scanner.tokenType) {
case GREATERTHANSIGN:
scanner.next();

if (scanner.tokenType === GREATERTHANSIGN) {
combinator = '>>';
scanner.next();
} else {
combinator = '>';
}
break;

case PLUSSIGN:
case TILDE:
case GREATERTHANSIGN:
combinator = scanner.getTokenValue();
scanner.next();
break;
Expand Down
Loading

0 comments on commit 16e0e95

Please sign in to comment.