@@ -700,22 +700,22 @@ namespace Sass {
700
700
if (l_type == Expression::NUMBER && r_type == Expression::NUMBER) {
701
701
Number_Ptr l_n = Cast<Number>(lhs);
702
702
Number_Ptr r_n = Cast<Number>(rhs);
703
- rv = op_numbers (op_type, *l_n, *r_n, ctx.c_options , & pstate);
703
+ rv = op_numbers (op_type, *l_n, *r_n, ctx.c_options , pstate);
704
704
}
705
705
else if (l_type == Expression::NUMBER && r_type == Expression::COLOR) {
706
706
Number_Ptr l_n = Cast<Number>(lhs);
707
707
Color_Ptr r_c = Cast<Color>(rhs);
708
- rv = op_number_color (op_type, *l_n, *r_c, ctx.c_options , & pstate);
708
+ rv = op_number_color (op_type, *l_n, *r_c, ctx.c_options , pstate);
709
709
}
710
710
else if (l_type == Expression::COLOR && r_type == Expression::NUMBER) {
711
711
Color_Ptr l_c = Cast<Color>(lhs);
712
712
Number_Ptr r_n = Cast<Number>(rhs);
713
- rv = op_color_number (op_type, *l_c, *r_n, ctx.c_options , & pstate);
713
+ rv = op_color_number (op_type, *l_c, *r_n, ctx.c_options , pstate);
714
714
}
715
715
else if (l_type == Expression::COLOR && r_type == Expression::COLOR) {
716
716
Color_Ptr l_c = Cast<Color>(lhs);
717
717
Color_Ptr r_c = Cast<Color>(rhs);
718
- rv = op_colors (op_type, *l_c, *r_c, ctx.c_options , & pstate);
718
+ rv = op_colors (op_type, *l_c, *r_c, ctx.c_options , pstate);
719
719
}
720
720
else {
721
721
To_Value to_value (ctx);
@@ -734,7 +734,7 @@ namespace Sass {
734
734
if (r_type == Expression::MAP) {
735
735
throw Exception::InvalidValue (*v_r);
736
736
}
737
- Value_Ptr ex = op_strings (b->op (), *v_l, *v_r, ctx.c_options , & pstate, !interpolant); // pass true to compress
737
+ Value_Ptr ex = op_strings (b->op (), *v_l, *v_r, ctx.c_options , pstate, !interpolant); // pass true to compress
738
738
if (String_Constant_Ptr str = Cast<String_Constant>(ex))
739
739
{
740
740
if (str->concrete_type () == Expression::STRING)
@@ -1380,13 +1380,13 @@ namespace Sass {
1380
1380
return *l < *r;
1381
1381
}
1382
1382
1383
- Value_Ptr Eval::op_numbers (enum Sass_OP op, const Number& l, const Number& r, struct Sass_Inspect_Options opt, ParserState* pstate)
1383
+ Value_Ptr Eval::op_numbers (enum Sass_OP op, const Number& l, const Number& r, struct Sass_Inspect_Options opt, const ParserState& pstate)
1384
1384
{
1385
1385
double lv = l.value ();
1386
1386
double rv = r.value ();
1387
1387
if (op == Sass_OP::DIV && rv == 0 ) {
1388
1388
// XXX: this is never hit via spec tests
1389
- return SASS_MEMORY_NEW (String_Quoted, pstate ? *pstate : l. pstate () , lv ? " Infinity" : " NaN" );
1389
+ return SASS_MEMORY_NEW (String_Quoted, pstate, lv ? " Infinity" : " NaN" );
1390
1390
}
1391
1391
if (op == Sass_OP::MOD && !rv) {
1392
1392
// XXX: this is never hit via spec tests
@@ -1399,7 +1399,7 @@ namespace Sass {
1399
1399
std::string l_unit (l.unit ());
1400
1400
std::string r_unit (tmp.unit ());
1401
1401
Number_Obj v = SASS_MEMORY_COPY (&l); // copy
1402
- v->pstate (pstate ? *pstate : l. pstate () );
1402
+ v->pstate (pstate);
1403
1403
if (l_unit.empty () && (op == Sass_OP::ADD || op == Sass_OP::SUB || op == Sass_OP::MOD)) {
1404
1404
v->numerator_units () = r.numerator_units ();
1405
1405
v->denominator_units () = r.denominator_units ();
@@ -1431,14 +1431,14 @@ namespace Sass {
1431
1431
return v.detach ();
1432
1432
}
1433
1433
1434
- Value_Ptr Eval::op_number_color (enum Sass_OP op, const Number& l, const Color& r, struct Sass_Inspect_Options opt, ParserState* pstate)
1434
+ Value_Ptr Eval::op_number_color (enum Sass_OP op, const Number& l, const Color& r, struct Sass_Inspect_Options opt, const ParserState& pstate)
1435
1435
{
1436
1436
double lv = l.value ();
1437
1437
switch (op) {
1438
1438
case Sass_OP::ADD:
1439
1439
case Sass_OP::MUL: {
1440
1440
return SASS_MEMORY_NEW (Color,
1441
- pstate ? *pstate : l. pstate () ,
1441
+ pstate,
1442
1442
ops[op](lv, r.r ()),
1443
1443
ops[op](lv, r.g ()),
1444
1444
ops[op](lv, r.b ()),
@@ -1449,7 +1449,7 @@ namespace Sass {
1449
1449
std::string sep (op == Sass_OP::SUB ? " -" : " /" );
1450
1450
std::string color (r.to_string (opt));
1451
1451
return SASS_MEMORY_NEW (String_Quoted,
1452
- pstate ? *pstate : l. pstate () ,
1452
+ pstate,
1453
1453
l.to_string (opt)
1454
1454
+ sep
1455
1455
+ color);
@@ -1463,22 +1463,22 @@ namespace Sass {
1463
1463
return NULL ;
1464
1464
}
1465
1465
1466
- Value_Ptr Eval::op_color_number (enum Sass_OP op, const Color& l, const Number& r, struct Sass_Inspect_Options opt, ParserState* pstate)
1466
+ Value_Ptr Eval::op_color_number (enum Sass_OP op, const Color& l, const Number& r, struct Sass_Inspect_Options opt, const ParserState& pstate)
1467
1467
{
1468
1468
double rv = r.value ();
1469
1469
if (op == Sass_OP::DIV && !rv) {
1470
1470
// comparison of Fixnum with Float failed?
1471
1471
throw Exception::ZeroDivisionError (l, r);
1472
1472
}
1473
1473
return SASS_MEMORY_NEW (Color,
1474
- pstate ? *pstate : l. pstate () ,
1474
+ pstate,
1475
1475
ops[op](l.r (), rv),
1476
1476
ops[op](l.g (), rv),
1477
1477
ops[op](l.b (), rv),
1478
1478
l.a ());
1479
1479
}
1480
1480
1481
- Value_Ptr Eval::op_colors (enum Sass_OP op, const Color& l, const Color& r, struct Sass_Inspect_Options opt, ParserState* pstate)
1481
+ Value_Ptr Eval::op_colors (enum Sass_OP op, const Color& l, const Color& r, struct Sass_Inspect_Options opt, const ParserState& pstate)
1482
1482
{
1483
1483
if (l.a () != r.a ()) {
1484
1484
throw Exception::AlphaChannelsNotEqual (&l, &r, " +" );
@@ -1488,14 +1488,14 @@ namespace Sass {
1488
1488
throw Exception::ZeroDivisionError (l, r);
1489
1489
}
1490
1490
return SASS_MEMORY_NEW (Color,
1491
- pstate ? *pstate : l. pstate () ,
1491
+ pstate,
1492
1492
ops[op](l.r (), r.r ()),
1493
1493
ops[op](l.g (), r.g ()),
1494
1494
ops[op](l.b (), r.b ()),
1495
1495
l.a ());
1496
1496
}
1497
1497
1498
- Value_Ptr Eval::op_strings (Sass::Operand operand, Value& lhs, Value& rhs, struct Sass_Inspect_Options opt, ParserState* pstate, bool delayed)
1498
+ Value_Ptr Eval::op_strings (Sass::Operand operand, Value& lhs, Value& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
1499
1499
{
1500
1500
Expression::Concrete_Type ltype = lhs.concrete_type ();
1501
1501
Expression::Concrete_Type rtype = rhs.concrete_type ();
@@ -1529,7 +1529,7 @@ namespace Sass {
1529
1529
(sep != "/" || !rqstr || !rqstr->quote_mark()) */
1530
1530
) {
1531
1531
// create a new string that might be quoted on output (but do not unquote what we pass)
1532
- return SASS_MEMORY_NEW (String_Quoted, pstate ? *pstate : lhs. pstate () , lstr + rstr, 0 , false , true );
1532
+ return SASS_MEMORY_NEW (String_Quoted, pstate, lstr + rstr, 0 , false , true );
1533
1533
}
1534
1534
1535
1535
if (sep != " " && !delayed) {
@@ -1542,7 +1542,7 @@ namespace Sass {
1542
1542
if (rqstr && rqstr->quote_mark ()) rstr = quote (rstr);
1543
1543
}
1544
1544
1545
- return SASS_MEMORY_NEW (String_Constant, pstate ? *pstate : lhs. pstate () , lstr + sep + rstr);
1545
+ return SASS_MEMORY_NEW (String_Constant, pstate, lstr + sep + rstr);
1546
1546
}
1547
1547
1548
1548
Expression_Ptr cval_to_astnode (union Sass_Value* v, Backtrace* backtrace, ParserState pstate)
0 commit comments