Skip to content

Commit 5624b9b

Browse files
committed
Merge pull request #2098 from xzyfer/feat/selector-unique
Implement the unique? method on Simple_Selectors
2 parents 05fa158 + f5c0250 commit 5624b9b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ast.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,10 @@ namespace Sass {
19441944
name_ = n.substr(pos + 1);
19451945
}
19461946
}
1947+
virtual bool unique() const
1948+
{
1949+
return false;
1950+
}
19471951
virtual std::string ns_name() const
19481952
{
19491953
std::string name("");
@@ -2066,6 +2070,11 @@ namespace Sass {
20662070
Selector_Qualifier(ParserState pstate, std::string n)
20672071
: Simple_Selector(pstate, n)
20682072
{ }
2073+
virtual bool unique() const
2074+
{
2075+
if (name()[0] == '#') return true;
2076+
else return false;
2077+
}
20692078
virtual unsigned long specificity()
20702079
{
20712080
if (name()[0] == '#') return Constants::Specificity_ID;

0 commit comments

Comments
 (0)