@@ -296,14 +296,14 @@ namespace Sass {
296
296
return false ;
297
297
}
298
298
299
- Compound_Selector_Ptr Compound_Selector::unify_with (Compound_Selector_Ptr rhs, Context& ctx )
299
+ Compound_Selector_Ptr Compound_Selector::unify_with (Compound_Selector_Ptr rhs)
300
300
{
301
301
if (empty ()) return rhs;
302
302
Compound_Selector_Obj unified = SASS_MEMORY_COPY (rhs);
303
303
for (size_t i = 0 , L = length (); i < L; ++i)
304
304
{
305
305
if (unified.isNull ()) break ;
306
- unified = at (i)->unify_with (unified, ctx );
306
+ unified = at (i)->unify_with (unified);
307
307
}
308
308
return unified.detach ();
309
309
}
@@ -472,10 +472,10 @@ namespace Sass {
472
472
return false ;
473
473
}
474
474
475
- Compound_Selector_Ptr Simple_Selector::unify_with (Compound_Selector_Ptr rhs, Context& ctx )
475
+ Compound_Selector_Ptr Simple_Selector::unify_with (Compound_Selector_Ptr rhs)
476
476
{
477
477
for (size_t i = 0 , L = rhs->length (); i < L; ++i)
478
- { if (to_string (ctx. c_options ) == rhs->at (i)->to_string (ctx. c_options )) return rhs; }
478
+ { if (to_string () == rhs->at (i)->to_string ()) return rhs; }
479
479
480
480
// check for pseudo elements because they are always last
481
481
size_t i, L;
@@ -505,7 +505,7 @@ namespace Sass {
505
505
return rhs;
506
506
}
507
507
508
- Simple_Selector_Ptr Element_Selector::unify_with (Simple_Selector_Ptr rhs, Context& ctx )
508
+ Simple_Selector_Ptr Element_Selector::unify_with (Simple_Selector_Ptr rhs)
509
509
{
510
510
// check if ns can be extended
511
511
// true for no ns or universal
@@ -536,7 +536,7 @@ namespace Sass {
536
536
return this ;
537
537
}
538
538
539
- Compound_Selector_Ptr Element_Selector::unify_with (Compound_Selector_Ptr rhs, Context& ctx )
539
+ Compound_Selector_Ptr Element_Selector::unify_with (Compound_Selector_Ptr rhs)
540
540
{
541
541
// TODO: handle namespaces
542
542
@@ -554,7 +554,7 @@ namespace Sass {
554
554
{
555
555
// if rhs is universal, just return this tagname + rhs's qualifiers
556
556
Element_Selector_Ptr ts = Cast<Element_Selector>(rhs_0);
557
- rhs->at (0 ) = this ->unify_with (ts, ctx );
557
+ rhs->at (0 ) = this ->unify_with (ts);
558
558
return rhs;
559
559
}
560
560
else if (Cast<Class_Selector>(rhs_0) || Cast<Id_Selector>(rhs_0)) {
@@ -574,7 +574,7 @@ namespace Sass {
574
574
// if rhs is universal, just return this tagname + rhs's qualifiers
575
575
if (rhs_0->name () != " *" && rhs_0->ns () != " *" && rhs_0->name () != name ()) return 0 ;
576
576
// otherwise create new compound and unify first simple selector
577
- rhs->at (0 ) = this ->unify_with (rhs_0, ctx );
577
+ rhs->at (0 ) = this ->unify_with (rhs_0);
578
578
return rhs;
579
579
580
580
}
@@ -583,13 +583,13 @@ namespace Sass {
583
583
return rhs;
584
584
}
585
585
586
- Compound_Selector_Ptr Class_Selector::unify_with (Compound_Selector_Ptr rhs, Context& ctx )
586
+ Compound_Selector_Ptr Class_Selector::unify_with (Compound_Selector_Ptr rhs)
587
587
{
588
588
rhs->has_line_break (has_line_break ());
589
- return Simple_Selector::unify_with (rhs, ctx );
589
+ return Simple_Selector::unify_with (rhs);
590
590
}
591
591
592
- Compound_Selector_Ptr Id_Selector::unify_with (Compound_Selector_Ptr rhs, Context& ctx )
592
+ Compound_Selector_Ptr Id_Selector::unify_with (Compound_Selector_Ptr rhs)
593
593
{
594
594
for (size_t i = 0 , L = rhs->length (); i < L; ++i)
595
595
{
@@ -598,10 +598,10 @@ namespace Sass {
598
598
}
599
599
}
600
600
rhs->has_line_break (has_line_break ());
601
- return Simple_Selector::unify_with (rhs, ctx );
601
+ return Simple_Selector::unify_with (rhs);
602
602
}
603
603
604
- Compound_Selector_Ptr Pseudo_Selector::unify_with (Compound_Selector_Ptr rhs, Context& ctx )
604
+ Compound_Selector_Ptr Pseudo_Selector::unify_with (Compound_Selector_Ptr rhs)
605
605
{
606
606
if (is_pseudo_element ())
607
607
{
@@ -612,7 +612,7 @@ namespace Sass {
612
612
}
613
613
}
614
614
}
615
- return Simple_Selector::unify_with (rhs, ctx );
615
+ return Simple_Selector::unify_with (rhs);
616
616
}
617
617
618
618
bool Attribute_Selector::operator < (const Attribute_Selector& rhs) const
@@ -913,7 +913,7 @@ namespace Sass {
913
913
0 );
914
914
}
915
915
916
- Selector_List_Ptr Complex_Selector::unify_with (Complex_Selector_Ptr other, Context& ctx )
916
+ Selector_List_Ptr Complex_Selector::unify_with (Complex_Selector_Ptr other)
917
917
{
918
918
919
919
// get last tails (on the right side)
@@ -939,7 +939,7 @@ namespace Sass {
939
939
SASS_ASSERT (r_last_head, " rhs head is null" );
940
940
941
941
// get the unification of the last compound selectors
942
- Compound_Selector_Obj unified = r_last_head->unify_with (l_last_head, ctx );
942
+ Compound_Selector_Obj unified = r_last_head->unify_with (l_last_head);
943
943
944
944
// abort if we could not unify heads
945
945
if (unified == 0 ) return 0 ;
@@ -956,25 +956,25 @@ namespace Sass {
956
956
}
957
957
958
958
// create nodes from both selectors
959
- Node lhsNode = complexSelectorToNode (this , ctx );
960
- Node rhsNode = complexSelectorToNode (other, ctx );
959
+ Node lhsNode = complexSelectorToNode (this );
960
+ Node rhsNode = complexSelectorToNode (other);
961
961
962
962
// overwrite universal base
963
963
if (!is_universal)
964
964
{
965
965
// create some temporaries to convert to node
966
966
Complex_Selector_Obj fake = unified->to_complex ();
967
- Node unified_node = complexSelectorToNode (fake, ctx );
967
+ Node unified_node = complexSelectorToNode (fake);
968
968
// add to permutate the list?
969
969
rhsNode.plus (unified_node);
970
970
}
971
971
972
972
// do some magic we inherit from node and extend
973
- Node node = Extend:: subweave (lhsNode, rhsNode, ctx );
973
+ Node node = subweave (lhsNode, rhsNode);
974
974
Selector_List_Ptr result = SASS_MEMORY_NEW (Selector_List, pstate ());
975
975
NodeDequePtr col = node.collection (); // move from collection to list
976
976
for (NodeDeque::iterator it = col->begin (), end = col->end (); it != end; it++)
977
- { result->append (nodeToComplexSelector (Node::naiveTrim (*it, ctx), ctx )); }
977
+ { result->append (nodeToComplexSelector (Node::naiveTrim (*it) )); }
978
978
979
979
// only return if list has some entries
980
980
return result->length () ? result : 0 ;
@@ -1110,7 +1110,7 @@ namespace Sass {
1110
1110
// check if we need to append some headers
1111
1111
// then we need to check for the combinator
1112
1112
// only then we can safely set the new tail
1113
- void Complex_Selector::append (Context& ctx, Complex_Selector_Obj ss)
1113
+ void Complex_Selector::append (Complex_Selector_Obj ss)
1114
1114
{
1115
1115
1116
1116
Complex_Selector_Obj t = ss->tail ();
@@ -1196,21 +1196,21 @@ namespace Sass {
1196
1196
return list;
1197
1197
}
1198
1198
1199
- Selector_List_Ptr Selector_List::resolve_parent_refs (Context& ctx, std::vector<Selector_List_Obj>& pstack, bool implicit_parent)
1199
+ Selector_List_Ptr Selector_List::resolve_parent_refs (std::vector<Selector_List_Obj>& pstack, bool implicit_parent)
1200
1200
{
1201
1201
if (!this ->has_parent_ref ()) return this ;
1202
1202
Selector_List_Ptr ss = SASS_MEMORY_NEW (Selector_List, pstate ());
1203
1203
Selector_List_Ptr ps = pstack.back ();
1204
1204
for (size_t pi = 0 , pL = ps->length (); pi < pL; ++pi) {
1205
1205
for (size_t si = 0 , sL = this ->length (); si < sL ; ++si) {
1206
- Selector_List_Obj rv = at (si)->resolve_parent_refs (ctx, pstack, implicit_parent);
1206
+ Selector_List_Obj rv = at (si)->resolve_parent_refs (pstack, implicit_parent);
1207
1207
ss->concat (rv);
1208
1208
}
1209
1209
}
1210
1210
return ss;
1211
1211
}
1212
1212
1213
- Selector_List_Ptr Complex_Selector::resolve_parent_refs (Context& ctx, std::vector<Selector_List_Obj>& pstack, bool implicit_parent)
1213
+ Selector_List_Ptr Complex_Selector::resolve_parent_refs (std::vector<Selector_List_Obj>& pstack, bool implicit_parent)
1214
1214
{
1215
1215
Complex_Selector_Obj tail = this ->tail ();
1216
1216
Compound_Selector_Obj head = this ->head ();
@@ -1223,7 +1223,7 @@ namespace Sass {
1223
1223
}
1224
1224
1225
1225
// first resolve_parent_refs the tail (which may return an expanded list)
1226
- Selector_List_Obj tails = tail ? tail->resolve_parent_refs (ctx, pstack, implicit_parent) : 0 ;
1226
+ Selector_List_Obj tails = tail ? tail->resolve_parent_refs (pstack, implicit_parent) : 0 ;
1227
1227
1228
1228
if (head && head->length () > 0 ) {
1229
1229
@@ -1269,7 +1269,7 @@ namespace Sass {
1269
1269
// keep old parser state
1270
1270
s->pstate (pstate ());
1271
1271
// append new tail
1272
- s->append (ctx, ss);
1272
+ s->append (ss);
1273
1273
retval->append (s);
1274
1274
}
1275
1275
}
@@ -1307,7 +1307,7 @@ namespace Sass {
1307
1307
// keep old parser state
1308
1308
s->pstate (pstate ());
1309
1309
// append new tail
1310
- s->append (ctx, ss);
1310
+ s->append (ss);
1311
1311
retval->append (s);
1312
1312
}
1313
1313
}
@@ -1338,13 +1338,13 @@ namespace Sass {
1338
1338
}
1339
1339
// no parent selector in head
1340
1340
else {
1341
- retval = this ->tails (ctx, tails);
1341
+ retval = this ->tails (tails);
1342
1342
}
1343
1343
1344
1344
for (Simple_Selector_Obj ss : head->elements ()) {
1345
1345
if (Wrapped_Selector_Ptr ws = Cast<Wrapped_Selector>(ss)) {
1346
1346
if (Selector_List_Ptr sl = Cast<Selector_List>(ws->selector ())) {
1347
- if (parents) ws->selector (sl->resolve_parent_refs (ctx, pstack, implicit_parent));
1347
+ if (parents) ws->selector (sl->resolve_parent_refs (pstack, implicit_parent));
1348
1348
}
1349
1349
}
1350
1350
}
@@ -1354,14 +1354,14 @@ namespace Sass {
1354
1354
}
1355
1355
// has no head
1356
1356
else {
1357
- return this ->tails (ctx, tails);
1357
+ return this ->tails (tails);
1358
1358
}
1359
1359
1360
1360
// unreachable
1361
1361
return 0 ;
1362
1362
}
1363
1363
1364
- Selector_List_Ptr Complex_Selector::tails (Context& ctx, Selector_List_Ptr tails)
1364
+ Selector_List_Ptr Complex_Selector::tails (Selector_List_Ptr tails)
1365
1365
{
1366
1366
Selector_List_Ptr rv = SASS_MEMORY_NEW (Selector_List, pstate_);
1367
1367
if (tails && tails->length ()) {
@@ -1586,15 +1586,15 @@ namespace Sass {
1586
1586
return false ;
1587
1587
}
1588
1588
1589
- Selector_List_Ptr Selector_List::unify_with (Selector_List_Ptr rhs, Context& ctx ) {
1589
+ Selector_List_Ptr Selector_List::unify_with (Selector_List_Ptr rhs) {
1590
1590
std::vector<Complex_Selector_Obj> unified_complex_selectors;
1591
1591
// Unify all of children with RHS's children, storing the results in `unified_complex_selectors`
1592
1592
for (size_t lhs_i = 0 , lhs_L = length (); lhs_i < lhs_L; ++lhs_i) {
1593
1593
Complex_Selector_Obj seq1 = (*this )[lhs_i];
1594
1594
for (size_t rhs_i = 0 , rhs_L = rhs->length (); rhs_i < rhs_L; ++rhs_i) {
1595
1595
Complex_Selector_Ptr seq2 = rhs->at (rhs_i);
1596
1596
1597
- Selector_List_Obj result = seq1->unify_with (seq2, ctx );
1597
+ Selector_List_Obj result = seq1->unify_with (seq2);
1598
1598
if ( result ) {
1599
1599
for (size_t i = 0 , L = result->length (); i < L; ++i) {
1600
1600
unified_complex_selectors.push_back ( (*result)[i] );
@@ -1611,7 +1611,7 @@ namespace Sass {
1611
1611
return final_result;
1612
1612
}
1613
1613
1614
- void Selector_List::populate_extends (Selector_List_Obj extendee, Context& ctx, Subset_Map& extends)
1614
+ void Selector_List::populate_extends (Selector_List_Obj extendee, Subset_Map& extends)
1615
1615
{
1616
1616
1617
1617
Selector_List_Ptr extender = this ;
@@ -1650,7 +1650,7 @@ namespace Sass {
1650
1650
pstate_.offset += element->pstate ().offset ;
1651
1651
}
1652
1652
1653
- Compound_Selector_Ptr Compound_Selector::minus (Compound_Selector_Ptr rhs, Context& ctx )
1653
+ Compound_Selector_Ptr Compound_Selector::minus (Compound_Selector_Ptr rhs)
1654
1654
{
1655
1655
Compound_Selector_Ptr result = SASS_MEMORY_NEW (Compound_Selector, pstate ());
1656
1656
// result->has_parent_reference(has_parent_reference());
@@ -1659,10 +1659,10 @@ namespace Sass {
1659
1659
for (size_t i = 0 , L = length (); i < L; ++i)
1660
1660
{
1661
1661
bool found = false ;
1662
- std::string thisSelector ((*this )[i]->to_string (ctx. c_options ));
1662
+ std::string thisSelector ((*this )[i]->to_string ());
1663
1663
for (size_t j = 0 , M = rhs->length (); j < M; ++j)
1664
1664
{
1665
- if (thisSelector == (*rhs)[j]->to_string (ctx. c_options ))
1665
+ if (thisSelector == (*rhs)[j]->to_string ())
1666
1666
{
1667
1667
found = true ;
1668
1668
break ;
@@ -1674,7 +1674,7 @@ namespace Sass {
1674
1674
return result;
1675
1675
}
1676
1676
1677
- void Compound_Selector::mergeSources (ComplexSelectorSet& sources, Context& ctx )
1677
+ void Compound_Selector::mergeSources (ComplexSelectorSet& sources)
1678
1678
{
1679
1679
for (ComplexSelectorSet::iterator iterator = sources.begin (), endIterator = sources.end (); iterator != endIterator; ++iterator) {
1680
1680
this ->sources_ .insert (SASS_MEMORY_CLONE (*iterator));
@@ -2343,7 +2343,7 @@ namespace Sass {
2343
2343
// ////////////////////////////////////////////////////////////////////////////////////////
2344
2344
// Convert map to (key, value) list.
2345
2345
// ////////////////////////////////////////////////////////////////////////////////////////
2346
- List_Obj Map::to_list (Context& ctx, ParserState& pstate) {
2346
+ List_Obj Map::to_list (ParserState& pstate) {
2347
2347
List_Obj ret = SASS_MEMORY_NEW (List, pstate, length (), SASS_COMMA);
2348
2348
2349
2349
for (auto key : keys ()) {
0 commit comments