Skip to content

Commit

Permalink
Merge pull request sass#2990 from jquense/parse-unknown-psuedos
Browse files Browse the repository at this point in the history
unrecognized psuedos with arguments parse as declaration-values
  • Loading branch information
mgreter authored Oct 4, 2019
2 parents 23cabbe + 4f22bee commit 04a234a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,23 @@ namespace Sass {
if (peek_css< exactly<')'>>() && Util::equalsLiteral("nth-", name.substr(0, 4))) {
css_error("Invalid CSS", " after ", ": expected An+B expression, was ");
}
if (SelectorListObj wrapped = parseSelectorList(true)) {
if (wrapped && lex_css< exactly<')'> >()) {
Pseudo_Selector* pseudo = SASS_MEMORY_NEW(Pseudo_Selector, p, name, element);
pseudo->selector(wrapped);

std::string unvendored = Util::unvendor(name);

if (unvendored == "not" || unvendored == "matches" || unvendored == "current" || unvendored == "any" || unvendored == "has" || unvendored == "host" || unvendored == "host-context" || unvendored == "slotted") {
if (SelectorListObj wrapped = parseSelectorList(true)) {
if (wrapped && lex_css< exactly<')'> >()) {
Pseudo_Selector* pseudo = SASS_MEMORY_NEW(Pseudo_Selector, p, name, element);
pseudo->selector(wrapped);
return pseudo;
}
}
} else {
String_Schema_Obj arg = parse_css_variable_value();
Pseudo_Selector* pseudo = SASS_MEMORY_NEW(Pseudo_Selector, p, name, element);
pseudo->argument(arg);

if (lex_css< exactly<')'> >()) {
return pseudo;
}
}
Expand Down

0 comments on commit 04a234a

Please sign in to comment.