Skip to content

Commit

Permalink
Fix selector parsing to allow hyphen after other tokens
Browse files Browse the repository at this point in the history
Fixes sass#922
  • Loading branch information
mgreter committed Mar 6, 2015
1 parent b76ea94 commit d1fa699
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,7 @@ namespace Sass {
(q = peek< exactly<'~'> >(p)) ||
(q = peek< exactly<'>'> >(p)) ||
(q = peek< exactly<','> >(p)) ||
(saw_stuff && (q = peek< exactly<'-'> >(p))) ||
(q = peek< binomial >(p)) ||
(q = peek< sequence< optional<sign>,
optional<digits>,
Expand All @@ -1927,8 +1928,8 @@ namespace Sass {
(q = peek< sequence< pseudo_prefix, interpolant > >(p)) ||
(q = peek< interpolant >(p))) {
saw_stuff = true;
if (*(p) == '#' && *(p + 1) == '{' && *(q - 1) == '}') saw_interpolant = true;
p = q;
if (*(p - 1) == '}') saw_interpolant = true;
}

Selector_Lookahead result;
Expand Down Expand Up @@ -1962,6 +1963,7 @@ namespace Sass {
(q = peek< exactly<'~'> >(p)) ||
(q = peek< exactly<'>'> >(p)) ||
(q = peek< exactly<','> >(p)) ||
(saw_stuff && (q = peek< exactly<'-'> >(p))) ||
(q = peek< binomial >(p)) ||
(q = peek< sequence< optional<sign>,
optional<digits>,
Expand All @@ -1985,8 +1987,8 @@ namespace Sass {
(q = peek< sequence< pseudo_prefix, interpolant > >(p)) ||
(q = peek< interpolant >(p)) ||
(q = peek< optional >(p))) {
if (*(p) == '#' && *(p + 1) == '{' && *(q - 1) == '}') saw_interpolant = true;
p = q;
if (*(p - 1) == '}') saw_interpolant = true;
saw_stuff = true;
}

Expand Down

0 comments on commit d1fa699

Please sign in to comment.