@@ -62,15 +62,15 @@ namespace Sass {
62
62
: PreValue(ptr)
63
63
{ }
64
64
ATTACH_VIRTUAL_AST_OPERATIONS (Value);
65
- virtual bool operator == (const Expression& rhs) const = 0 ;
65
+ virtual bool operator == (const Expression& rhs) const override = 0 ;
66
66
};
67
67
68
68
// /////////////////////////////////////////////////////////////////////
69
69
// Lists of values, both comma- and space-separated (distinguished by a
70
70
// type-tag.) Also used to represent variable-length argument lists.
71
71
// /////////////////////////////////////////////////////////////////////
72
72
class List : public Value , public Vectorized <Expression_Obj> {
73
- void adjust_after_pushing (Expression_Obj e) { is_expanded (false ); }
73
+ void adjust_after_pushing (Expression_Obj e) override { is_expanded (false ); }
74
74
private:
75
75
ADD_PROPERTY (enum Sass_Separator, separator)
76
76
ADD_PROPERTY (bool , is_arglist)
@@ -94,18 +94,18 @@ namespace Sass {
94
94
is_bracketed_(ptr->is_bracketed_),
95
95
from_selector_(ptr->from_selector_)
96
96
{ concrete_type (LIST); }
97
- std::string type () const { return is_arglist_ ? " arglist" : " list" ; }
97
+ std::string type () const override { return is_arglist_ ? " arglist" : " list" ; }
98
98
static std::string type_name () { return " list" ; }
99
99
const char * sep_string (bool compressed = false ) const {
100
100
return separator () == SASS_SPACE ?
101
101
" " : (compressed ? " ," : " , " );
102
102
}
103
- bool is_invisible () const { return empty () && !is_bracketed (); }
103
+ bool is_invisible () const override { return empty () && !is_bracketed (); }
104
104
Expression_Obj value_at_index (size_t i);
105
105
106
106
virtual size_t size () const ;
107
107
108
- virtual size_t hash ()
108
+ virtual size_t hash () const override
109
109
{
110
110
if (hash_ == 0 ) {
111
111
hash_ = std::hash<std::string>()(sep_string ());
@@ -116,13 +116,13 @@ namespace Sass {
116
116
return hash_;
117
117
}
118
118
119
- virtual void set_delayed (bool delayed)
119
+ virtual void set_delayed (bool delayed) override
120
120
{
121
121
is_delayed (delayed);
122
122
// don't set children
123
123
}
124
124
125
- virtual bool operator == (const Expression& rhs) const ;
125
+ virtual bool operator == (const Expression& rhs) const override ;
126
126
127
127
ATTACH_AST_OPERATIONS (List)
128
128
ATTACH_CRTP_PERFORM_METHODS()
@@ -132,7 +132,7 @@ namespace Sass {
132
132
// Key value paris.
133
133
// /////////////////////////////////////////////////////////////////////
134
134
class Map : public Value , public Hashed {
135
- void adjust_after_pushing (std::pair<Expression_Obj, Expression_Obj> p) { is_expanded (false ); }
135
+ void adjust_after_pushing (std::pair<Expression_Obj, Expression_Obj> p) override { is_expanded (false ); }
136
136
public:
137
137
Map (ParserState pstate,
138
138
size_t size = 0 )
@@ -143,12 +143,12 @@ namespace Sass {
143
143
: Value(ptr),
144
144
Hashed(*ptr)
145
145
{ concrete_type (MAP); }
146
- std::string type () const { return " map" ; }
146
+ std::string type () const override { return " map" ; }
147
147
static std::string type_name () { return " map" ; }
148
- bool is_invisible () const { return empty (); }
148
+ bool is_invisible () const override { return empty (); }
149
149
List_Obj to_list (ParserState& pstate);
150
150
151
- virtual size_t hash ()
151
+ virtual size_t hash () const override
152
152
{
153
153
if (hash_ == 0 ) {
154
154
for (auto key : keys ()) {
@@ -160,7 +160,7 @@ namespace Sass {
160
160
return hash_;
161
161
}
162
162
163
- virtual bool operator == (const Expression& rhs) const ;
163
+ virtual bool operator == (const Expression& rhs) const override ;
164
164
165
165
ATTACH_AST_OPERATIONS (Map)
166
166
ATTACH_CRTP_PERFORM_METHODS()
@@ -177,7 +177,7 @@ namespace Sass {
177
177
HASH_PROPERTY (Operand, op)
178
178
HASH_PROPERTY (Expression_Obj, left)
179
179
HASH_PROPERTY (Expression_Obj, right)
180
- size_t hash_;
180
+ mutable size_t hash_;
181
181
public:
182
182
Binary_Expression (ParserState pstate,
183
183
Operand op, Expression_Obj lhs, Expression_Obj rhs)
@@ -196,20 +196,20 @@ namespace Sass {
196
196
const std::string separator () {
197
197
return sass_op_separator (optype ());
198
198
}
199
- bool is_left_interpolant (void ) const ;
200
- bool is_right_interpolant (void ) const ;
201
- bool has_interpolant () const
199
+ bool is_left_interpolant (void ) const override ;
200
+ bool is_right_interpolant (void ) const override ;
201
+ bool has_interpolant () const override
202
202
{
203
203
return is_left_interpolant () ||
204
204
is_right_interpolant ();
205
205
}
206
- virtual void set_delayed (bool delayed)
206
+ virtual void set_delayed (bool delayed) override
207
207
{
208
208
right ()->set_delayed (delayed);
209
209
left ()->set_delayed (delayed);
210
210
is_delayed (delayed);
211
211
}
212
- virtual bool operator ==(const Expression& rhs) const
212
+ virtual bool operator ==(const Expression& rhs) const override
213
213
{
214
214
try
215
215
{
@@ -225,7 +225,7 @@ namespace Sass {
225
225
}
226
226
catch (...) { throw ; }
227
227
}
228
- virtual size_t hash ()
228
+ virtual size_t hash () const override
229
229
{
230
230
if (hash_ == 0 ) {
231
231
hash_ = std::hash<size_t >()(optype ());
@@ -709,4 +709,4 @@ namespace Sass {
709
709
710
710
}
711
711
712
- #endif
712
+ #endif
0 commit comments