@@ -122,7 +122,7 @@ namespace Sass {
122
122
virtual operator bool () { return true ; }
123
123
virtual ~Expression () { }
124
124
virtual string type () { return " " ; /* TODO: raise an error? */ }
125
- virtual bool is_invisible () { return false ; }
125
+ virtual bool is_invisible () const { return false ; }
126
126
static string type_name () { return " " ; }
127
127
virtual bool is_false () { return false ; }
128
128
virtual bool operator ==( Expression& rhs) const { return false ; }
@@ -177,7 +177,7 @@ namespace Sass {
177
177
size_t length () const { return elements_.size (); }
178
178
bool empty () const { return elements_.empty (); }
179
179
T last () { return elements_.back (); }
180
- T first () { return elements_.front (); }
180
+ T first () { return elements_.front (); }
181
181
T& operator [](size_t i) { return elements_[i]; }
182
182
const T& operator [](size_t i) const { return elements_[i]; }
183
183
Vectorized& operator <<(T element)
@@ -259,6 +259,12 @@ namespace Sass {
259
259
}
260
260
const unordered_map<Expression*, Expression*>& pairs () const { return elements_; }
261
261
const vector<Expression*>& keys () const { return list_; }
262
+
263
+ unordered_map<Expression*, Expression*>::iterator end () { return elements_.end (); }
264
+ unordered_map<Expression*, Expression*>::iterator begin () { return elements_.begin (); }
265
+ unordered_map<Expression*, Expression*>::const_iterator end () const { return elements_.end (); }
266
+ unordered_map<Expression*, Expression*>::const_iterator begin () const { return elements_.begin (); }
267
+
262
268
};
263
269
inline Hashed::~Hashed () { }
264
270
@@ -292,7 +298,7 @@ namespace Sass {
292
298
virtual ~Statement () = 0 ;
293
299
// needed for rearranging nested rulesets during CSS emission
294
300
virtual bool is_hoistable () { return false ; }
295
- virtual bool is_invisible () { return false ; }
301
+ virtual bool is_invisible () const { return false ; }
296
302
virtual bool bubbles () { return false ; }
297
303
virtual Block* block () { return 0 ; }
298
304
};
@@ -347,7 +353,7 @@ namespace Sass {
347
353
Ruleset (ParserState pstate, Selector* s = 0 , Block* b = 0 )
348
354
: Has_Block(pstate, b), selector_(s), at_root_(false )
349
355
{ statement_type (RULESET); }
350
- bool is_invisible ();
356
+ bool is_invisible () const ;
351
357
// nested rulesets need to be hoisted out of their enclosing blocks
352
358
bool is_hoistable () { return true ; }
353
359
ATTACH_OPERATIONS ()
@@ -393,7 +399,7 @@ namespace Sass {
393
399
{ statement_type (MEDIA); }
394
400
bool bubbles () { return true ; }
395
401
bool is_hoistable () { return true ; }
396
- bool is_invisible () {
402
+ bool is_invisible () const {
397
403
bool is_invisible = true ;
398
404
for (size_t i = 0 , L = block ()->length (); i < L && is_invisible; i++)
399
405
is_invisible &= (*block ())[i]->is_invisible ();
@@ -766,7 +772,7 @@ namespace Sass {
766
772
{ concrete_type (LIST); }
767
773
string type () { return is_arglist_ ? " arglist" : " list" ; }
768
774
static string type_name () { return " list" ; }
769
- bool is_invisible () { return ! length (); }
775
+ bool is_invisible () const { return empty (); }
770
776
Expression* value_at_index (size_t i);
771
777
772
778
virtual size_t size () const ;
@@ -807,7 +813,7 @@ namespace Sass {
807
813
{ concrete_type (MAP); }
808
814
string type () { return " map" ; }
809
815
static string type_name () { return " map" ; }
810
- bool is_invisible () { return ! length (); }
816
+ bool is_invisible () const { return empty (); }
811
817
812
818
virtual bool operator ==(Expression& rhs) const
813
819
{
@@ -1553,7 +1559,7 @@ namespace Sass {
1553
1559
Null (ParserState pstate) : Expression(pstate) { concrete_type (NULL_VAL); }
1554
1560
string type () { return " null" ; }
1555
1561
static string type_name () { return " null" ; }
1556
- bool is_invisible () { return true ; }
1562
+ bool is_invisible () const { return true ; }
1557
1563
operator bool () { return false ; }
1558
1564
bool is_false () { return true ; }
1559
1565
@@ -2133,7 +2139,7 @@ namespace Sass {
2133
2139
ATTACH_OPERATIONS ()
2134
2140
};
2135
2141
2136
- inline bool Ruleset::is_invisible () {
2142
+ inline bool Ruleset::is_invisible () const {
2137
2143
bool is_invisible = true ;
2138
2144
Selector_List* sl = static_cast <Selector_List*>(selector ());
2139
2145
for (size_t i = 0 , L = sl->length (); i < L && is_invisible; ++i)
0 commit comments