@@ -23,35 +23,30 @@ namespace Sass {
23
23
InvalidParent::InvalidParent (Selector_Ptr parent, Backtraces traces, Selector_Ptr selector)
24
24
: Base(selector->pstate (), def_msg, traces), parent(parent), selector(selector)
25
25
{
26
- msg = " Invalid parent selector for \" " ;
27
- msg += selector->to_string (Sass_Inspect_Options ());
28
- msg += " \" : \" " ;
29
- msg += parent->to_string (Sass_Inspect_Options ());
30
- msg += " \" " ;
26
+ msg = " Invalid parent selector for "
27
+ " \" " + selector->to_string (Sass_Inspect_Options ()) + " \" : "
28
+ " \" " + parent->to_string (Sass_Inspect_Options ()) + " \" " ;
31
29
}
32
30
33
31
InvalidVarKwdType::InvalidVarKwdType (ParserState pstate, Backtraces traces, std::string name, const Argument_Ptr arg)
34
32
: Base(pstate, def_msg, traces), name(name), arg(arg)
35
33
{
36
- msg = " Variable keyword argument map must have string keys.\n " ;
37
- msg += name + " is not a string in " + arg->to_string () + " ." ;
34
+ msg = " Variable keyword argument map must have string keys.\n " +
35
+ name + " is not a string in " + arg->to_string () + " ." ;
38
36
}
39
37
40
38
InvalidArgumentType::InvalidArgumentType (ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string type, const Value_Ptr value)
41
39
: Base(pstate, def_msg, traces), fn(fn), arg(arg), type(type), value(value)
42
40
{
43
- msg = arg + " : \" " ;
41
+ msg = arg + " : \" " ;
44
42
if (value) msg += value->to_string (Sass_Inspect_Options ());
45
- msg += " \" is not a " + type;
46
- msg += " for `" + fn + " '" ;
43
+ msg += " \" is not a " + type + " for `" + fn + " '" ;
47
44
}
48
45
49
46
MissingArgument::MissingArgument (ParserState pstate, Backtraces traces, std::string fn, std::string arg, std::string fntype)
50
47
: Base(pstate, def_msg, traces), fn(fn), arg(arg), fntype(fntype)
51
48
{
52
- msg = fntype + " " + fn;
53
- msg += " is missing argument " ;
54
- msg += arg + " ." ;
49
+ msg = fntype + " " + fn + " is missing argument " + arg + " ." ;
55
50
}
56
51
57
52
InvalidSyntax::InvalidSyntax (ParserState pstate, Backtraces traces, std::string msg)
@@ -65,87 +60,66 @@ namespace Sass {
65
60
DuplicateKeyError::DuplicateKeyError (Backtraces traces, const Map& dup, const Expression& org)
66
61
: Base(org.pstate(), def_msg, traces), dup(dup), org(org)
67
62
{
68
- msg = " Duplicate key " ;
69
- msg += dup.get_duplicate_key ()->inspect ();
70
- msg += " in map (" ;
71
- msg += org.inspect ();
72
- msg += " )." ;
63
+ msg = " Duplicate key " + dup.get_duplicate_key ()->inspect () + " in map (" + org.inspect () + " )." ;
73
64
}
74
65
75
66
TypeMismatch::TypeMismatch (Backtraces traces, const Expression& var, const std::string type)
76
67
: Base(var.pstate(), def_msg, traces), var(var), type(type)
77
68
{
78
- msg = var.to_string ();
79
- msg += " is not an " ;
80
- msg += type;
81
- msg += " ." ;
69
+ msg = var.to_string () + " is not an " + type + " ." ;
82
70
}
83
71
84
72
InvalidValue::InvalidValue (Backtraces traces, const Expression& val)
85
73
: Base(val.pstate(), def_msg, traces), val(val)
86
74
{
87
- msg = val.to_string ();
88
- msg += " isn't a valid CSS value." ;
75
+ msg = val.to_string () + " isn't a valid CSS value." ;
89
76
}
90
77
91
78
StackError::StackError (Backtraces traces, const AST_Node& node)
92
79
: Base(node.pstate(), def_msg, traces), node(node)
93
80
{
94
- msg = " stack level too deep" ;
81
+ msg = " stack level too deep" ;
95
82
}
96
83
97
84
IncompatibleUnits::IncompatibleUnits (const Units& lhs, const Units& rhs)
98
85
{
99
- msg = " Incompatible units: '" ;
100
- msg += rhs.unit ();
101
- msg += " ' and '" ;
102
- msg += lhs.unit ();
103
- msg += " '." ;
86
+ msg = " Incompatible units: '" + rhs.unit () + " ' and '" + lhs.unit () + " '." ;
104
87
}
105
88
106
89
IncompatibleUnits::IncompatibleUnits (const UnitType lhs, const UnitType rhs)
107
90
{
108
- msg = " Incompatible units: '" ;
109
- msg += unit_to_string (rhs);
110
- msg += " ' and '" ;
111
- msg += unit_to_string (lhs);
112
- msg += " '." ;
91
+ msg = std::string (" Incompatible units: '" ) + unit_to_string (rhs) + " ' and '" + unit_to_string (lhs) + " '." ;
113
92
}
114
93
115
94
AlphaChannelsNotEqual::AlphaChannelsNotEqual (Expression_Ptr_Const lhs, Expression_Ptr_Const rhs, enum Sass_OP op)
116
95
: OperationError(), lhs(lhs), rhs(rhs), op(op)
117
96
{
118
- msg = " Alpha channels must be equal: " ;
119
- msg += lhs->to_string ({ NESTED, 5 });
120
- msg += " " + sass_op_to_name (op) + " " ;
121
- msg += rhs->to_string ({ NESTED, 5 });
122
- msg += " ." ;
97
+ msg = " Alpha channels must be equal: " +
98
+ lhs->to_string ({ NESTED, 5 }) +
99
+ " " + sass_op_to_name (op) + " " +
100
+ rhs->to_string ({ NESTED, 5 }) + " ." ;
123
101
}
124
102
125
103
ZeroDivisionError::ZeroDivisionError (const Expression& lhs, const Expression& rhs)
126
104
: OperationError(), lhs(lhs), rhs(rhs)
127
105
{
128
- msg = " divided by 0" ;
106
+ msg = " divided by 0" ;
129
107
}
130
108
131
109
UndefinedOperation::UndefinedOperation (Expression_Ptr_Const lhs, Expression_Ptr_Const rhs, enum Sass_OP op)
132
110
: OperationError(), lhs(lhs), rhs(rhs), op(op)
133
111
{
134
- msg = def_op_msg + " : \" " ;
135
- msg += lhs->to_string ({ NESTED, 5 });
136
- msg += " " + sass_op_to_name (op) + " " ;
137
- msg += rhs->to_string ({ TO_SASS, 5 });
138
- msg += " \" ." ;
112
+ msg = def_op_msg + " : \" " +
113
+ lhs->to_string ({ NESTED, 5 }) +
114
+ " " + sass_op_to_name (op) + " " +
115
+ rhs->to_string ({ TO_SASS, 5 }) +
116
+ " \" ." ;
139
117
}
140
118
141
119
InvalidNullOperation::InvalidNullOperation (Expression_Ptr_Const lhs, Expression_Ptr_Const rhs, enum Sass_OP op)
142
120
: UndefinedOperation(lhs, rhs, op)
143
121
{
144
- msg = def_op_null_msg + " : \" " ;
145
- msg += lhs->inspect ();
146
- msg += " " + sass_op_to_name (op) + " " ;
147
- msg += rhs->inspect ();
148
- msg += " \" ." ;
122
+ msg = def_op_null_msg + " : \" " + lhs->inspect () + " " + sass_op_to_name (op) + " " + rhs->inspect () + " \" ." ;
149
123
}
150
124
151
125
SassValueError::SassValueError (Backtraces traces, ParserState pstate, OperationError& err)
0 commit comments