@@ -201,7 +201,7 @@ namespace Sass {
201
201
{ }
202
202
virtual operator bool () { return true ; }
203
203
virtual ~Expression () { }
204
- virtual std::string type () { return " " ; /* TODO: raise an error? */ }
204
+ virtual std::string type () const { return " " ; /* TODO: raise an error? */ }
205
205
virtual bool is_invisible () const { return false ; }
206
206
static std::string type_name () { return " " ; }
207
207
virtual bool is_false () { return false ; }
@@ -1073,7 +1073,7 @@ namespace Sass {
1073
1073
is_bracketed_(ptr->is_bracketed_),
1074
1074
from_selector_(ptr->from_selector_)
1075
1075
{ concrete_type (LIST); }
1076
- std::string type () { return is_arglist_ ? " arglist" : " list" ; }
1076
+ std::string type () const { return is_arglist_ ? " arglist" : " list" ; }
1077
1077
static std::string type_name () { return " list" ; }
1078
1078
const char * sep_string (bool compressed = false ) const {
1079
1079
return separator () == SASS_SPACE ?
@@ -1122,7 +1122,7 @@ namespace Sass {
1122
1122
: Value(ptr),
1123
1123
Hashed(*ptr)
1124
1124
{ concrete_type (MAP); }
1125
- std::string type () { return " map" ; }
1125
+ std::string type () const { return " map" ; }
1126
1126
static std::string type_name () { return " map" ; }
1127
1127
bool is_invisible () const { return empty (); }
1128
1128
List_Obj to_list (Context& ctx, ParserState& pstate);
@@ -1190,7 +1190,7 @@ namespace Sass {
1190
1190
hash_(ptr->hash_)
1191
1191
{ }
1192
1192
const std::string type_name () {
1193
- switch (type ()) {
1193
+ switch (optype ()) {
1194
1194
case AND: return " and" ; break ;
1195
1195
case OR: return " or" ; break ;
1196
1196
case EQ: return " eq" ; break ;
@@ -1210,7 +1210,7 @@ namespace Sass {
1210
1210
}
1211
1211
}
1212
1212
const std::string separator () {
1213
- switch (type ()) {
1213
+ switch (optype ()) {
1214
1214
case AND: return " &&" ; break ;
1215
1215
case OR: return " ||" ; break ;
1216
1216
case EQ: return " ==" ; break ;
@@ -1261,13 +1261,13 @@ namespace Sass {
1261
1261
virtual size_t hash ()
1262
1262
{
1263
1263
if (hash_ == 0 ) {
1264
- hash_ = std::hash<size_t >()(type ());
1264
+ hash_ = std::hash<size_t >()(optype ());
1265
1265
hash_combine (hash_, left ()->hash ());
1266
1266
hash_combine (hash_, right ()->hash ());
1267
1267
}
1268
1268
return hash_;
1269
1269
}
1270
- enum Sass_OP type () const { return op_.operand ; }
1270
+ enum Sass_OP optype () const { return op_.operand ; }
1271
1271
ATTACH_AST_OPERATIONS (Binary_Expression)
1272
1272
ATTACH_OPERATIONS ()
1273
1273
};
@@ -1279,21 +1279,21 @@ namespace Sass {
1279
1279
public:
1280
1280
enum Type { PLUS, MINUS, NOT };
1281
1281
private:
1282
- HASH_PROPERTY (Type, type )
1282
+ HASH_PROPERTY (Type, optype )
1283
1283
HASH_PROPERTY (Expression_Obj, operand)
1284
1284
size_t hash_;
1285
1285
public:
1286
1286
Unary_Expression (ParserState pstate, Type t, Expression_Obj o)
1287
- : Expression(pstate), type_ (t), operand_(o), hash_(0 )
1287
+ : Expression(pstate), optype_ (t), operand_(o), hash_(0 )
1288
1288
{ }
1289
1289
Unary_Expression (const Unary_Expression* ptr)
1290
1290
: Expression(ptr),
1291
- type_ (ptr->type_ ),
1291
+ optype_ (ptr->optype_ ),
1292
1292
operand_(ptr->operand_),
1293
1293
hash_(ptr->hash_)
1294
1294
{ }
1295
1295
const std::string type_name () {
1296
- switch (type_ ) {
1296
+ switch (optype_ ) {
1297
1297
case PLUS: return " plus" ; break ;
1298
1298
case MINUS: return " minus" ; break ;
1299
1299
case NOT: return " not" ; break ;
@@ -1318,7 +1318,7 @@ namespace Sass {
1318
1318
virtual size_t hash ()
1319
1319
{
1320
1320
if (hash_ == 0 ) {
1321
- hash_ = std::hash<size_t >()(type_ );
1321
+ hash_ = std::hash<size_t >()(optype_ );
1322
1322
hash_combine (hash_, operand ()->hash ());
1323
1323
};
1324
1324
return hash_;
@@ -1541,17 +1541,17 @@ namespace Sass {
1541
1541
public:
1542
1542
enum Type { NUMBER, PERCENTAGE, DIMENSION, HEX };
1543
1543
private:
1544
- HASH_PROPERTY (Type, type )
1544
+ HASH_PROPERTY (Type, valtype )
1545
1545
HASH_CONSTREF (std::string, value)
1546
1546
size_t hash_;
1547
1547
public:
1548
1548
Textual (ParserState pstate, Type t, std::string val)
1549
- : Expression(pstate, DELAYED), type_ (t), value_(val),
1549
+ : Expression(pstate, DELAYED), valtype_ (t), value_(val),
1550
1550
hash_ (0 )
1551
1551
{ }
1552
1552
Textual (const Textual* ptr)
1553
1553
: Expression(ptr),
1554
- type_ (ptr->type_ ),
1554
+ valtype_ (ptr->valtype_ ),
1555
1555
value_(ptr->value_),
1556
1556
hash_(ptr->hash_)
1557
1557
{ }
@@ -1574,7 +1574,7 @@ namespace Sass {
1574
1574
{
1575
1575
if (hash_ == 0 ) {
1576
1576
hash_ = std::hash<std::string>()(value_);
1577
- hash_combine (hash_, std::hash<int >()(type_ ));
1577
+ hash_combine (hash_, std::hash<int >()(valtype_ ));
1578
1578
}
1579
1579
return hash_;
1580
1580
}
@@ -1609,7 +1609,7 @@ namespace Sass {
1609
1609
std::vector<std::string>& denominator_units () { return denominator_units_; }
1610
1610
const std::vector<std::string>& numerator_units () const { return numerator_units_; }
1611
1611
const std::vector<std::string>& denominator_units () const { return denominator_units_; }
1612
- std::string type () { return " number" ; }
1612
+ std::string type () const { return " number" ; }
1613
1613
static std::string type_name () { return " number" ; }
1614
1614
std::string unit () const ;
1615
1615
@@ -1662,7 +1662,7 @@ namespace Sass {
1662
1662
disp_(ptr->disp_),
1663
1663
hash_(ptr->hash_)
1664
1664
{ concrete_type (COLOR); }
1665
- std::string type () { return " color" ; }
1665
+ std::string type () const { return " color" ; }
1666
1666
static std::string type_name () { return " color" ; }
1667
1667
1668
1668
virtual size_t hash ()
@@ -1733,7 +1733,7 @@ namespace Sass {
1733
1733
hash_(ptr->hash_)
1734
1734
{ concrete_type (BOOLEAN); }
1735
1735
virtual operator bool () { return value_; }
1736
- std::string type () { return " bool" ; }
1736
+ std::string type () const { return " bool" ; }
1737
1737
static std::string type_name () { return " bool" ; }
1738
1738
virtual bool is_false () { return !value_; }
1739
1739
@@ -1792,7 +1792,7 @@ namespace Sass {
1792
1792
hash_ (ptr->hash_)
1793
1793
{ concrete_type (STRING); }
1794
1794
1795
- std::string type () { return " string" ; }
1795
+ std::string type () const { return " string" ; }
1796
1796
static std::string type_name () { return " string" ; }
1797
1797
1798
1798
bool is_left_interpolant (void ) const ;
@@ -1853,7 +1853,7 @@ namespace Sass {
1853
1853
String_Constant (ParserState pstate, const Token& tok)
1854
1854
: String(pstate), quote_mark_(0 ), can_compress_whitespace_(false ), value_(read_css_string(std::string(tok.begin, tok.end))), hash_(0 )
1855
1855
{ }
1856
- std::string type () { return " string" ; }
1856
+ std::string type () const { return " string" ; }
1857
1857
static std::string type_name () { return " string" ; }
1858
1858
virtual bool is_invisible () const ;
1859
1859
virtual void rtrim ();
@@ -2142,7 +2142,7 @@ namespace Sass {
2142
2142
public:
2143
2143
Null (ParserState pstate) : Value(pstate) { concrete_type (NULL_VAL); }
2144
2144
Null (const Null* ptr) : Value(ptr) { concrete_type (NULL_VAL); }
2145
- std::string type () { return " null" ; }
2145
+ std::string type () const { return " null" ; }
2146
2146
static std::string type_name () { return " null" ; }
2147
2147
bool is_invisible () const { return true ; }
2148
2148
operator bool () { return false ; }
@@ -2296,10 +2296,10 @@ namespace Sass {
2296
2296
virtual void set_media_block (Media_Block_Ptr mb) {
2297
2297
media_block (mb);
2298
2298
}
2299
- virtual bool has_parent_ref () {
2299
+ virtual bool has_parent_ref () const {
2300
2300
return false ;
2301
2301
}
2302
- virtual bool has_real_parent_ref () {
2302
+ virtual bool has_real_parent_ref () const {
2303
2303
return false ;
2304
2304
}
2305
2305
// dispatch to correct handlers
@@ -2334,8 +2334,8 @@ namespace Sass {
2334
2334
connect_parent_(ptr->connect_parent_),
2335
2335
media_block_(ptr->media_block_)
2336
2336
{ }
2337
- virtual bool has_parent_ref ();
2338
- virtual bool has_real_parent_ref ();
2337
+ virtual bool has_parent_ref () const ;
2338
+ virtual bool has_real_parent_ref () const ;
2339
2339
virtual bool operator <(const Selector& rhs) const ;
2340
2340
virtual bool operator ==(const Selector& rhs) const ;
2341
2341
// selector schema is not yet a final selector, so we do not
@@ -2429,8 +2429,8 @@ namespace Sass {
2429
2429
2430
2430
virtual ~Simple_Selector () = 0 ;
2431
2431
virtual Compound_Selector_Ptr unify_with (Compound_Selector_Ptr, Context&);
2432
- virtual bool has_parent_ref () { return false ; };
2433
- virtual bool has_real_parent_ref () { return false ; };
2432
+ virtual bool has_parent_ref () const { return false ; };
2433
+ virtual bool has_real_parent_ref () const { return false ; };
2434
2434
virtual bool is_pseudo_element () const { return false ; }
2435
2435
2436
2436
virtual bool is_superselector_of (Compound_Selector_Obj sub) { return false ; }
@@ -2463,14 +2463,14 @@ namespace Sass {
2463
2463
Parent_Selector (const Parent_Selector* ptr)
2464
2464
: Simple_Selector(ptr), real_(ptr->real_)
2465
2465
{ /* has_reference(true); */ }
2466
- bool is_real_parent_ref () { return real (); };
2467
- virtual bool has_parent_ref () { return true ; };
2468
- virtual bool has_real_parent_ref () { return is_real_parent_ref (); };
2466
+ bool is_real_parent_ref () const { return real (); };
2467
+ virtual bool has_parent_ref () const { return true ; };
2468
+ virtual bool has_real_parent_ref () const { return is_real_parent_ref (); };
2469
2469
virtual unsigned long specificity () const
2470
2470
{
2471
2471
return 0 ;
2472
2472
}
2473
- std::string type () { return " selector" ; }
2473
+ std::string type () const { return " selector" ; }
2474
2474
static std::string type_name () { return " selector" ; }
2475
2475
ATTACH_AST_OPERATIONS (Parent_Selector)
2476
2476
ATTACH_OPERATIONS ()
@@ -2676,8 +2676,8 @@ namespace Sass {
2676
2676
// Selectors inside the negation pseudo-class are counted like any
2677
2677
// other, but the negation itself does not count as a pseudo-class.
2678
2678
virtual size_t hash ();
2679
- virtual bool has_parent_ref ();
2680
- virtual bool has_real_parent_ref ();
2679
+ virtual bool has_parent_ref () const ;
2680
+ virtual bool has_real_parent_ref () const ;
2681
2681
virtual unsigned long specificity () const ;
2682
2682
virtual bool operator ==(const Simple_Selector& rhs) const ;
2683
2683
virtual bool operator ==(const Wrapped_Selector& rhs) const ;
@@ -2733,8 +2733,8 @@ namespace Sass {
2733
2733
Complex_Selector_Obj to_complex ();
2734
2734
Compound_Selector_Ptr unify_with (Compound_Selector_Ptr rhs, Context& ctx);
2735
2735
// virtual Placeholder_Selector_Ptr find_placeholder();
2736
- virtual bool has_parent_ref ();
2737
- virtual bool has_real_parent_ref ();
2736
+ virtual bool has_parent_ref () const ;
2737
+ virtual bool has_real_parent_ref () const ;
2738
2738
Simple_Selector_Ptr base () const {
2739
2739
if (length () == 0 ) return 0 ;
2740
2740
// ToDo: why is this needed?
@@ -2827,8 +2827,8 @@ namespace Sass {
2827
2827
head_(ptr->head_), tail_(ptr->tail_),
2828
2828
reference_(ptr->reference_)
2829
2829
{};
2830
- virtual bool has_parent_ref ();
2831
- virtual bool has_real_parent_ref ();
2830
+ virtual bool has_parent_ref () const ;
2831
+ virtual bool has_real_parent_ref () const ;
2832
2832
2833
2833
Complex_Selector_Obj skip_empty_reference ()
2834
2834
{
@@ -2977,11 +2977,11 @@ namespace Sass {
2977
2977
schema_(ptr->schema_),
2978
2978
wspace_(ptr->wspace_)
2979
2979
{ }
2980
- std::string type () { return " list" ; }
2980
+ std::string type () const { return " list" ; }
2981
2981
// remove parent selector references
2982
2982
// basically unwraps parsed selectors
2983
- virtual bool has_parent_ref ();
2984
- virtual bool has_real_parent_ref ();
2983
+ virtual bool has_parent_ref () const ;
2984
+ virtual bool has_real_parent_ref () const ;
2985
2985
void remove_parent_selectors ();
2986
2986
Selector_List_Ptr resolve_parent_refs (Context& ctx, std::vector<Selector_List_Obj>& pstack, bool implicit_parent = true );
2987
2987
virtual bool is_superselector_of (Compound_Selector_Obj sub, std::string wrapping = " " );
0 commit comments