@@ -94,7 +94,7 @@ namespace Sass {
94
94
return os;
95
95
}
96
96
97
- // Print a string representation of a SimpleSequence_Selector
97
+ // Print a string representation of a Compound_Selector
98
98
static void printSimpleSelector (Simple_Selector* pSimpleSelector, const char * message=NULL , bool newline=true ) {
99
99
100
100
if (message) {
@@ -112,12 +112,12 @@ namespace Sass {
112
112
}
113
113
}
114
114
115
- // Print a string representation of a SimpleSequence_Selector
115
+ // Print a string representation of a Compound_Selector
116
116
typedef std::pair<SimpleSequence_Selector*, Sequence_Selector*> SelsNewSeqPair;
117
117
typedef std::vector<SelsNewSeqPair> SelsNewSeqPairCollection;
118
118
119
119
120
- // Print a string representation of a SimpleSequence_Selector
120
+ // Print a string representation of a Compound_Selector
121
121
static void printCompoundSelector (SimpleSequence_Selector* pCompoundSelector, const char * message=NULL , bool newline=true ) {
122
122
123
123
if (message) {
@@ -169,7 +169,7 @@ namespace Sass {
169
169
}
170
170
171
171
172
- // Print a string representation of a Sequence_Selector
172
+ // Print a string representation of a Complex_Selector
173
173
static void printComplexSelector (Sequence_Selector* pComplexSelector, const char * message=NULL , bool newline=true ) {
174
174
175
175
if (message) {
@@ -288,7 +288,7 @@ namespace Sass {
288
288
#endif
289
289
290
290
static bool parentSuperselector (Sequence_Selector* pOne, Sequence_Selector* pTwo, Context& ctx) {
291
- // TODO: figure out a better way to create a Sequence_Selector from scratch
291
+ // TODO: figure out a better way to create a Complex_Selector from scratch
292
292
// TODO: There's got to be a better way. This got ugly quick...
293
293
Position noPosition (-1 , -1 , -1 );
294
294
Element_Selector fakeParent (ParserState (" [FAKE]" ), " temp" );
@@ -651,7 +651,7 @@ namespace Sass {
651
651
652
652
653
653
static bool parentSuperselector (const Node& one, const Node& two, Context& ctx) {
654
- // TODO: figure out a better way to create a Sequence_Selector from scratch
654
+ // TODO: figure out a better way to create a Complex_Selector from scratch
655
655
// TODO: There's got to be a better way. This got ugly quick...
656
656
Position noPosition (-1 , -1 , -1 );
657
657
Element_Selector fakeParent (ParserState (" [FAKE]" ), " temp" );
@@ -1588,7 +1588,7 @@ namespace Sass {
1588
1588
Sequence_Selector* pExtComplexSelector = &seq; // The selector up to where the @extend is (ie, the thing to merge)
1589
1589
SimpleSequence_Selector* pExtCompoundSelector = pSels; // All the simple selectors to be replaced from the current compound selector from all extensions
1590
1590
1591
- // TODO: This can return a SimpleSequence_Selector with no elements. Should that just be returning NULL?
1591
+ // TODO: This can return a Compound_Selector with no elements. Should that just be returning NULL?
1592
1592
// RUBY: self_without_sel = Sass::Util.array_minus(members, sels)
1593
1593
SimpleSequence_Selector* pSelectorWithoutExtendSelectors = pSelector->minus (pExtCompoundSelector, ctx);
1594
1594
@@ -1618,8 +1618,8 @@ namespace Sass {
1618
1618
// next if group.map {|e, _| check_directives_match!(e, parent_directives)}.none?
1619
1619
1620
1620
// TODO: This seems a little fishy to me. See if it causes any problems. From the ruby, we should be able to just
1621
- // get rid of the last SimpleSequence_Selector and replace it with this one. I think the reason this code is more
1622
- // complex is that Sequence_Selector contains a combinator, but in ruby combinators have already been filtered
1621
+ // get rid of the last Compound_Selector and replace it with this one. I think the reason this code is more
1622
+ // complex is that Complex_Selector contains a combinator, but in ruby combinators have already been filtered
1623
1623
// out and aren't operated on.
1624
1624
Sequence_Selector* pNewSelector = pExtComplexSelector->cloneFully (ctx); // ->first();
1625
1625
@@ -1642,7 +1642,7 @@ namespace Sass {
1642
1642
1643
1643
1644
1644
// if (pSelector && pSelector->has_line_feed()) pNewInnerMost->has_line_feed(true);
1645
- // Set the sources on our new Sequence_Selector to the sources of this simple sequence plus the thing we're extending.
1645
+ // Set the sources on our new Complex_Selector to the sources of this simple sequence plus the thing we're extending.
1646
1646
DEBUG_PRINTLN (EXTEND_COMPOUND, " SOURCES SETTING ON NEW SEQ: " << complexSelectorToNode (pNewSelector, ctx))
1647
1647
1648
1648
DEBUG_EXEC (EXTEND_COMPOUND, SourcesSet oldSet = pNewSelector->sources (); printSourcesSet (oldSet, ctx, " SOURCES NEW SEQ BEGIN: " ))
@@ -1723,7 +1723,7 @@ namespace Sass {
1723
1723
1724
1724
if (pHead) {
1725
1725
if (seen.find (*pHead) == seen.end ()) {
1726
- for (Simple_Selector* pSimple : * pHead) {
1726
+ for (Simple_Selector* pSimple : pHead-> elements () ) {
1727
1727
if (Wrapped_Selector* ws = dynamic_cast <Wrapped_Selector*>(pSimple)) {
1728
1728
if (CommaSequence_Selector* sl = dynamic_cast <CommaSequence_Selector*>(ws->selector ())) {
1729
1729
for (Sequence_Selector* cs : sl->elements ()) {
@@ -1809,7 +1809,7 @@ namespace Sass {
1809
1809
// RUBY: next [[sseq_or_op]] unless sseq_or_op.is_a?(SimpleSequence)
1810
1810
if (!sseqOrOp.isSelector ()) {
1811
1811
// Wrap our Combinator in two collections to match ruby. This is essentially making a collection Node
1812
- // with one collection child. The collection child represents a Sequence_Selector that is only a combinator.
1812
+ // with one collection child. The collection child represents a Complex_Selector that is only a combinator.
1813
1813
Node outer = Node::createCollection ();
1814
1814
Node inner = Node::createCollection ();
1815
1815
outer.collection ()->push_back (inner);
@@ -1826,7 +1826,7 @@ namespace Sass {
1826
1826
DEBUG_PRINTLN (EXTEND_COMPLEX, " EXTENDED: " << extended)
1827
1827
1828
1828
1829
- // Prepend the SimpleSequence_Selector based on the choices logic; choices seems to be extend but with an ruby Array instead of a Sequence
1829
+ // Prepend the Compound_Selector based on the choices logic; choices seems to be extend but with an ruby Array instead of a Sequence
1830
1830
// due to the member mapping: choices = extended.map {|seq| seq.members}
1831
1831
Sequence_Selector* pJustCurrentCompoundSelector = sseqOrOp.selector ();
1832
1832
@@ -1961,7 +1961,7 @@ namespace Sass {
1961
1961
pNewSelectors = remove_placeholders.remove_placeholders (pNewSelectors);
1962
1962
1963
1963
// unwrap all wrapped selectors with inner lists
1964
- for (Sequence_Selector* cur : * pNewSelectors) {
1964
+ for (Sequence_Selector* cur : pNewSelectors-> elements () ) {
1965
1965
// process tails
1966
1966
while (cur) {
1967
1967
// process header
@@ -1970,7 +1970,7 @@ namespace Sass {
1970
1970
recseen.insert (*cur->head ());
1971
1971
// create a copy since we add multiple items if stuff get unwrapped
1972
1972
SimpleSequence_Selector* cpy_head = SASS_MEMORY_NEW (ctx.mem , SimpleSequence_Selector, cur->pstate ());
1973
- for (Simple_Selector* hs : * cur->head ()) {
1973
+ for (Simple_Selector* hs : cur->head ()-> elements ()) {
1974
1974
if (Wrapped_Selector* ws = dynamic_cast <Wrapped_Selector*>(hs)) {
1975
1975
if (CommaSequence_Selector* sl = dynamic_cast <CommaSequence_Selector*>(ws->selector ())) {
1976
1976
// special case for ruby ass
@@ -2092,7 +2092,8 @@ namespace Sass {
2092
2092
// we set `extended` flag on extended selectors
2093
2093
if (b->is_root ()) {
2094
2094
// debug_subset_map(subset_map);
2095
- for (auto const &it : subset_map.values ()) {
2095
+ auto values = subset_map.values ();
2096
+ for (auto it : values) {
2096
2097
Sequence_Selector* sel = it.first ? it.first ->first () : NULL ;
2097
2098
SimpleSequence_Selector* ext = it.second ? it.second : NULL ;
2098
2099
if (ext && (ext->extended () || ext->is_optional ())) continue ;
@@ -2127,7 +2128,7 @@ namespace Sass {
2127
2128
2128
2129
void Extend::operator ()(Directive* a)
2129
2130
{
2130
- // CommaSequence_Selector * ls = dynamic_cast<CommaSequence_Selector *>(a->selector());
2131
+ // Selector_List * ls = dynamic_cast<Selector_List *>(a->selector());
2131
2132
// selector_stack.push_back(ls);
2132
2133
if (a->block ()) a->block ()->perform (this );
2133
2134
// exp.selector_stack.pop_back();
0 commit comments