@@ -159,11 +159,11 @@ namespace Sass {
159
159
std::string variable (f->variable ());
160
160
Expression* low = f->lower_bound ()->perform (this );
161
161
if (low->concrete_type () != Expression::NUMBER) {
162
- error ( " lower bound of `@for` directive must be numeric " , low-> pstate () );
162
+ throw Exception::TypeMismatch (*low, " integer " );
163
163
}
164
164
Expression* high = f->upper_bound ()->perform (this );
165
165
if (high->concrete_type () != Expression::NUMBER) {
166
- error ( " upper bound of `@for` directive must be numeric " , high-> pstate () );
166
+ throw Exception::TypeMismatch (*high, " integer " );
167
167
}
168
168
Number* sass_start = static_cast <Number*>(low);
169
169
Number* sass_end = static_cast <Number*>(high);
@@ -268,6 +268,7 @@ namespace Sass {
268
268
Expression* var = scalars;
269
269
env.set_local (variables[0 ], var);
270
270
} else {
271
+ // XXX: this is never hit via spec tests
271
272
for (size_t j = 0 , K = variables.size (); j < K; ++j) {
272
273
Expression* res = j >= scalars->length ()
273
274
? SASS_MEMORY_NEW (ctx.mem , Null, expr->pstate ())
@@ -279,6 +280,7 @@ namespace Sass {
279
280
if (variables.size () > 0 ) {
280
281
env.set_local (variables[0 ], e);
281
282
for (size_t j = 1 , K = variables.size (); j < K; ++j) {
283
+ // XXX: this is never hit via spec tests
282
284
Expression* res = SASS_MEMORY_NEW (ctx.mem , Null, expr->pstate ());
283
285
env.set_local (variables[j], res);
284
286
}
@@ -683,6 +685,7 @@ namespace Sass {
683
685
Textual* front = dynamic_cast <Textual*>(s2->elements ().front ());
684
686
if (front && !front->is_interpolant ())
685
687
{
688
+ // XXX: this is never hit via spec tests
686
689
schema_op = true ;
687
690
rhs = front->perform (this );
688
691
}
@@ -781,6 +784,7 @@ namespace Sass {
781
784
782
785
if (rv) {
783
786
if (schema_op) {
787
+ // XXX: this is never hit via spec tests
784
788
(*s2)[0 ] = rv;
785
789
rv = s2->perform (this );
786
790
}
@@ -823,6 +827,7 @@ namespace Sass {
823
827
Expression* Eval::operator ()(Function_Call* c)
824
828
{
825
829
if (backtrace ()->parent != NULL && backtrace ()->depth () > Constants::MaxCallStack) {
830
+ // XXX: this is never hit via spec tests
826
831
std::ostringstream stm;
827
832
stm << " Stack depth exceeded max of " << Constants::MaxCallStack;
828
833
error (stm.str (), c->pstate (), backtrace ());
@@ -1079,18 +1084,6 @@ namespace Sass {
1079
1084
return b;
1080
1085
}
1081
1086
1082
- char is_quoted (std::string str)
1083
- {
1084
- size_t len = str.length ();
1085
- if (len < 2 ) return 0 ;
1086
- if ((str[0 ] == ' "' && str[len-1 ] == ' "' ) || (str[0 ] == ' \' ' && str[len-1 ] == ' \' ' )) {
1087
- return str[0 ];
1088
- }
1089
- else {
1090
- return 0 ;
1091
- }
1092
- }
1093
-
1094
1087
void Eval::interpolation (Context& ctx, std::string& res, Expression* ex, bool into_quotes, bool was_itpl) {
1095
1088
1096
1089
bool needs_closing_brace = false ;
@@ -1113,7 +1106,7 @@ namespace Sass {
1113
1106
if (Argument* arg = dynamic_cast <Argument*>(ex)) {
1114
1107
ex = arg->value ();
1115
1108
}
1116
- if (String_Constant * sq = dynamic_cast <String_Quoted*>(ex)) {
1109
+ if (String_Quoted * sq = dynamic_cast <String_Quoted*>(ex)) {
1117
1110
if (was_itpl) {
1118
1111
bool was_interpolant = ex->is_interpolant ();
1119
1112
ex = SASS_MEMORY_NEW (ctx.mem , String_Constant, sq->pstate (), sq->value ());
@@ -1125,6 +1118,7 @@ namespace Sass {
1125
1118
1126
1119
// parent selector needs another go
1127
1120
if (dynamic_cast <Parent_Selector*>(ex)) {
1121
+ // XXX: this is never hit via spec tests
1128
1122
ex = ex->perform (this );
1129
1123
}
1130
1124
@@ -1300,6 +1294,7 @@ namespace Sass {
1300
1294
Expression* value = e->value ();
1301
1295
value = (value ? value->perform (this ) : 0 );
1302
1296
if (value && dynamic_cast <String_Quoted*>(value)) {
1297
+ // XXX: this is never hit via spec tests
1303
1298
value = SASS_MEMORY_NEW (ctx.mem , String_Quoted,
1304
1299
value->pstate (),
1305
1300
dynamic_cast <String_Quoted*>(value)->value ());
@@ -1432,9 +1427,11 @@ namespace Sass {
1432
1427
double lv = l.value ();
1433
1428
double rv = r.value ();
1434
1429
if (op == Sass_OP::DIV && rv == 0 ) {
1430
+ // XXX: this is never hit via spec tests
1435
1431
return SASS_MEMORY_NEW (mem, String_Quoted, pstate ? *pstate : l.pstate (), lv ? " Infinity" : " NaN" );
1436
1432
}
1437
1433
if (op == Sass_OP::MOD && !rv) {
1434
+ // XXX: this is never hit via spec tests
1438
1435
throw Exception::ZeroDivisionError (l, r);
1439
1436
}
1440
1437
@@ -1687,6 +1684,7 @@ namespace Sass {
1687
1684
1688
1685
}
1689
1686
1687
+ // XXX: this is never hit via spec tests
1690
1688
Attribute_Selector* Eval::operator ()(Attribute_Selector* s)
1691
1689
{
1692
1690
String* attr = s->value ();
0 commit comments