Skip to content

Commit ca5749d

Browse files
committed
Fixup more messages
1 parent cb32304 commit ca5749d

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/bind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace Sass {
5858
}
5959
std::stringstream msg;
6060
msg << "Only " << LP << " ";
61-
msg << (LP <= 1 ? "argument" : "arguments");
61+
msg << (LP == 1 ? "argument" : "arguments");
6262
msg << " allowed, but " << LA << " ";
6363
msg << (LA <= 1 ? "was" : "were");
6464
msg << " passed.";

src/error_handling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace Sass {
4949
MissingArgument::MissingArgument(ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string fntype)
5050
: Base(pstate, def_msg, traces), fn(fn), arg(arg), fntype(fntype)
5151
{
52-
msg = fntype + " " + fn + " is missing argument " + arg + ".";
52+
msg = "Missing argument " + arg + ".";
5353
}
5454

5555
InvalidCss::InvalidCss(ParserState pstate, Backtraces traces, std::string msg)

src/fn_colors.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace Sass {
88
namespace Functions {
99

1010
// macros for common ranges (u mean unsigned or upper, r for full range)
11-
#define DARG_U_FACT(argname) get_arg_r(argname, env, sig, pstate, traces, - 0.0, 1.0) // double
11+
#define DARG_U_FACT(argname) get_arg_r(argname, env, sig, pstate, traces, 0.0, 1.0) // double
1212
#define DARG_R_FACT(argname) get_arg_r(argname, env, sig, pstate, traces, - 1.0, 1.0) // double
13-
#define DARG_U_BYTE(argname) get_arg_r(argname, env, sig, pstate, traces, - 0.0, 255.0) // double
13+
#define DARG_U_BYTE(argname) get_arg_r(argname, env, sig, pstate, traces, 0.0, 255.0) // double
1414
#define DARG_R_BYTE(argname) get_arg_r(argname, env, sig, pstate, traces, - 255.0, 255.0) // double
15-
#define DARG_U_PRCT(argname) get_arg_r(argname, env, sig, pstate, traces, - 0.0, 100.0) // double
15+
#define DARG_U_PRCT(argname) get_arg_r(argname, env, sig, pstate, traces, 0.0, 100.0) // double
1616
#define DARG_R_PRCT(argname) get_arg_r(argname, env, sig, pstate, traces, - 100.0, 100.0) // double
1717

1818
// macros for color related inputs (rbg and alpha/opacity values)

src/fn_miscs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace Sass {
5050
{
5151
String_Constant* ss = Cast<String_Constant>(env["$name"]);
5252
if (!ss) {
53-
error("$name: " + (env["$name"]->to_string()) + " is not a string for `function-exists'", pstate, traces);
53+
error("$name: " + (env["$name"]->to_string()) + " is not a string.", pstate, traces);
5454
}
5555

5656
std::string name = unquote(ss->value());

src/fn_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ namespace Sass {
6161
double v = tmpnr.value();
6262
if (!(lo <= v && v <= hi)) {
6363
std::stringstream msg;
64-
msg << "argument `" << argname << "` of `" << sig << "` must be between ";
65-
msg << lo << " and " << hi;
64+
msg << "Expected " << v << " to be within ";
65+
msg << lo << " and " << hi << ".";
6666
error(msg.str(), pstate, traces);
6767
}
6868
return v;

src/fn_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace Sass {
4141
{
4242
T* val = Cast<T>(env[argname]);
4343
if (!val) {
44-
error(argname + " is not a " + T::type_name(), pstate, traces);
44+
error(argname + ": " + env[argname]->to_string() + " is not a " + T::type_name() + ".", pstate, traces);
4545
}
4646
return val;
4747
}

0 commit comments

Comments
 (0)