@@ -700,22 +700,22 @@ namespace Sass {
700700 if (l_type == Expression::NUMBER && r_type == Expression::NUMBER) {
701701 Number_Ptr l_n = Cast<Number>(lhs);
702702 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);
704704 }
705705 else if (l_type == Expression::NUMBER && r_type == Expression::COLOR) {
706706 Number_Ptr l_n = Cast<Number>(lhs);
707707 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);
709709 }
710710 else if (l_type == Expression::COLOR && r_type == Expression::NUMBER) {
711711 Color_Ptr l_c = Cast<Color>(lhs);
712712 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);
714714 }
715715 else if (l_type == Expression::COLOR && r_type == Expression::COLOR) {
716716 Color_Ptr l_c = Cast<Color>(lhs);
717717 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);
719719 }
720720 else {
721721 To_Value to_value (ctx);
@@ -734,7 +734,7 @@ namespace Sass {
734734 if (r_type == Expression::MAP) {
735735 throw Exception::InvalidValue (*v_r);
736736 }
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
738738 if (String_Constant_Ptr str = Cast<String_Constant>(ex))
739739 {
740740 if (str->concrete_type () == Expression::STRING)
@@ -1380,13 +1380,13 @@ namespace Sass {
13801380 return *l < *r;
13811381 }
13821382
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)
13841384 {
13851385 double lv = l.value ();
13861386 double rv = r.value ();
13871387 if (op == Sass_OP::DIV && rv == 0 ) {
13881388 // 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" );
13901390 }
13911391 if (op == Sass_OP::MOD && !rv) {
13921392 // XXX: this is never hit via spec tests
@@ -1399,7 +1399,7 @@ namespace Sass {
13991399 std::string l_unit (l.unit ());
14001400 std::string r_unit (tmp.unit ());
14011401 Number_Obj v = SASS_MEMORY_COPY (&l); // copy
1402- v->pstate (pstate ? *pstate : l. pstate () );
1402+ v->pstate (pstate);
14031403 if (l_unit.empty () && (op == Sass_OP::ADD || op == Sass_OP::SUB || op == Sass_OP::MOD)) {
14041404 v->numerator_units () = r.numerator_units ();
14051405 v->denominator_units () = r.denominator_units ();
@@ -1431,14 +1431,14 @@ namespace Sass {
14311431 return v.detach ();
14321432 }
14331433
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)
14351435 {
14361436 double lv = l.value ();
14371437 switch (op) {
14381438 case Sass_OP::ADD:
14391439 case Sass_OP::MUL: {
14401440 return SASS_MEMORY_NEW (Color,
1441- pstate ? *pstate : l. pstate () ,
1441+ pstate,
14421442 ops[op](lv, r.r ()),
14431443 ops[op](lv, r.g ()),
14441444 ops[op](lv, r.b ()),
@@ -1449,7 +1449,7 @@ namespace Sass {
14491449 std::string sep (op == Sass_OP::SUB ? " -" : " /" );
14501450 std::string color (r.to_string (opt));
14511451 return SASS_MEMORY_NEW (String_Quoted,
1452- pstate ? *pstate : l. pstate () ,
1452+ pstate,
14531453 l.to_string (opt)
14541454 + sep
14551455 + color);
@@ -1463,22 +1463,22 @@ namespace Sass {
14631463 return NULL ;
14641464 }
14651465
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)
14671467 {
14681468 double rv = r.value ();
14691469 if (op == Sass_OP::DIV && !rv) {
14701470 // comparison of Fixnum with Float failed?
14711471 throw Exception::ZeroDivisionError (l, r);
14721472 }
14731473 return SASS_MEMORY_NEW (Color,
1474- pstate ? *pstate : l. pstate () ,
1474+ pstate,
14751475 ops[op](l.r (), rv),
14761476 ops[op](l.g (), rv),
14771477 ops[op](l.b (), rv),
14781478 l.a ());
14791479 }
14801480
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)
14821482 {
14831483 if (l.a () != r.a ()) {
14841484 throw Exception::AlphaChannelsNotEqual (&l, &r, " +" );
@@ -1488,14 +1488,14 @@ namespace Sass {
14881488 throw Exception::ZeroDivisionError (l, r);
14891489 }
14901490 return SASS_MEMORY_NEW (Color,
1491- pstate ? *pstate : l. pstate () ,
1491+ pstate,
14921492 ops[op](l.r (), r.r ()),
14931493 ops[op](l.g (), r.g ()),
14941494 ops[op](l.b (), r.b ()),
14951495 l.a ());
14961496 }
14971497
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)
14991499 {
15001500 Expression::Concrete_Type ltype = lhs.concrete_type ();
15011501 Expression::Concrete_Type rtype = rhs.concrete_type ();
@@ -1529,7 +1529,7 @@ namespace Sass {
15291529 (sep != "/" || !rqstr || !rqstr->quote_mark()) */
15301530 ) {
15311531 // 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 );
15331533 }
15341534
15351535 if (sep != " " && !delayed) {
@@ -1542,7 +1542,7 @@ namespace Sass {
15421542 if (rqstr && rqstr->quote_mark ()) rstr = quote (rstr);
15431543 }
15441544
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);
15461546 }
15471547
15481548 Expression_Ptr cval_to_astnode (union Sass_Value* v, Backtrace* backtrace, ParserState pstate)
0 commit comments