Skip to content

Commit 2d1a051

Browse files
committed
Adjust a few error messages
1 parent d941f96 commit 2d1a051

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/eval.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ namespace Sass {
175175
// check if units are valid for sequence
176176
if (sass_start->unit() != sass_end->unit()) {
177177
std::stringstream msg; msg << "Incompatible units: '"
178-
<< sass_start->unit() << "' and '"
179-
<< sass_end->unit() << "'.";
178+
<< sass_end->unit() << "' and '"
179+
<< sass_start->unit() << "'.";
180180
error(msg.str(), low->pstate(), backtrace());
181181
}
182182
double start = sass_start->value();

src/functions.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ namespace Sass {
685685
bool hsl = h || s || l;
686686

687687
if (rgb && hsl) {
688-
error("cannot specify both RGB and HSL values for `adjust-color`", pstate);
688+
error("Cannot specify HSL and RGB values for a color at the same time for `adjust-color'", pstate);
689689
}
690690
if (rgb) {
691691
double rr = r ? ARGR("$red", Number, -255, 255)->value() : 0;
@@ -719,7 +719,7 @@ namespace Sass {
719719
color->b(),
720720
color->a() + (a ? a->value() : 0));
721721
}
722-
error("not enough arguments for `adjust-color`", pstate);
722+
error("not enough arguments for `adjust-color'", pstate);
723723
// unreachable
724724
return color;
725725
}
@@ -740,7 +740,7 @@ namespace Sass {
740740
bool hsl = h || s || l;
741741

742742
if (rgb && hsl) {
743-
error("cannot specify both RGB and HSL values for `scale-color`", pstate);
743+
error("Cannot specify HSL and RGB values for a color at the same time for `scale-color'", pstate);
744744
}
745745
if (rgb) {
746746
double rscale = (r ? ARGR("$red", Number, -100.0, 100.0)->value() : 0.0) / 100.0;
@@ -775,7 +775,7 @@ namespace Sass {
775775
color->b(),
776776
color->a() + ascale * (ascale > 0.0 ? 1.0 - color->a() : color->a()));
777777
}
778-
error("not enough arguments for `scale-color`", pstate);
778+
error("not enough arguments for `scale-color'", pstate);
779779
// unreachable
780780
return color;
781781
}
@@ -796,7 +796,7 @@ namespace Sass {
796796
bool hsl = h || s || l;
797797

798798
if (rgb && hsl) {
799-
error("cannot specify both RGB and HSL values for `change-color`", pstate);
799+
error("Cannot specify HSL and RGB values for a color at the same time for `change-color'", pstate);
800800
}
801801
if (rgb) {
802802
return SASS_MEMORY_NEW(Color,
@@ -823,7 +823,7 @@ namespace Sass {
823823
color->b(),
824824
alpha);
825825
}
826-
error("not enough arguments for `change-color`", pstate);
826+
error("not enough arguments for `change-color'", pstate);
827827
// unreachable
828828
return color;
829829
}
@@ -1184,13 +1184,13 @@ namespace Sass {
11841184
double v = l->value();
11851185
if (v < 1) {
11861186
stringstream err;
1187-
err << "$limit " << v << " must be greater than or equal to 1 for `random`";
1187+
err << "$limit " << v << " must be greater than or equal to 1 for `random'";
11881188
error(err.str(), pstate);
11891189
}
11901190
bool eq_int = std::fabs(trunc(v) - v) < NUMBER_EPSILON;
11911191
if (!eq_int) {
11921192
stringstream err;
1193-
err << "Expected $limit to be an integer but got `" << v << "` for `random`";
1193+
err << "Expected $limit to be an integer but got " << v << " for `random'";
11941194
error(err.str(), pstate);
11951195
}
11961196
std::uniform_real_distribution<> distributor(1, v + 1);
@@ -1754,7 +1754,7 @@ namespace Sass {
17541754

17551755
// Not enough parameters
17561756
if( arglist->length() == 0 )
1757-
error("$selectors: At least one selector must be passed", pstate);
1757+
error("$selectors: At least one selector must be passed for `selector-nest'", pstate);
17581758

17591759
// Parse args into vector of selectors
17601760
std::vector<Selector_List_Obj> parsedSelectors;
@@ -1807,7 +1807,7 @@ namespace Sass {
18071807

18081808
// Not enough parameters
18091809
if( arglist->length() == 0 )
1810-
error("$selectors: At least one selector must be passed", pstate);
1810+
error("$selectors: At least one selector must be passed for `selector-append'", pstate);
18111811

18121812
// Parse args into vector of selectors
18131813
std::vector<Selector_List_Obj> parsedSelectors;
@@ -1856,22 +1856,22 @@ namespace Sass {
18561856

18571857
// Must be a simple sequence
18581858
if( childSeq->combinator() != Complex_Selector::Combinator::ANCESTOR_OF ) {
1859-
std::string msg("Can't append `");
1859+
std::string msg("Can't append \"");
18601860
msg += childSeq->to_string();
1861-
msg += "` to `";
1861+
msg += "\" to \"";
18621862
msg += parentSeqClone->to_string();
1863-
msg += "`";
1863+
msg += "\" for `selector-append'";
18641864
error(msg, pstate, backtrace);
18651865
}
18661866

18671867
// Cannot be a Universal selector
18681868
Element_Selector_Obj pType = SASS_MEMORY_CAST(Element_Selector, childSeq->head()->first());
18691869
if(pType && pType->name() == "*") {
1870-
std::string msg("Can't append `");
1870+
std::string msg("Can't append \"");
18711871
msg += childSeq->to_string();
1872-
msg += "` to `";
1872+
msg += "\" to \"";
18731873
msg += parentSeqClone->to_string();
1874-
msg += "`";
1874+
msg += "\" for `selector-append'";
18751875
error(msg, pstate, backtrace);
18761876
}
18771877

0 commit comments

Comments
 (0)