Skip to content

Commit 79732ae

Browse files
committed
Create aliases for used stl containers
To prepare to add a custom allocator later.
1 parent e1c16e0 commit 79732ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1311
-1301
lines changed

docs/api-doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ with the short description:
182182
* 1: normal errors like parsing or `eval` errors
183183
* 2: bad allocation error (memory error)
184184
* 3: "untranslated" C++ exception (`throw std::exception`)
185-
* 4: legacy string exceptions ( `throw const char*` or `std::string` )
185+
* 4: legacy string exceptions ( `throw const char*` or `sass::string` )
186186
* 5: Some other unknown exception
187187

188188
Although for the API consumer, error codes do not offer much value except

src/ast.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace Sass {
5858
pstate_.offset += pstate - pstate_ + pstate.offset;
5959
}
6060

61-
std::string AST_Node::to_string(Sass_Inspect_Options opt) const
61+
sass::string AST_Node::to_string(Sass_Inspect_Options opt) const
6262
{
6363
Sass_Output_Options out(opt);
6464
Emitter emitter(out);
@@ -69,7 +69,7 @@ namespace Sass {
6969
return i.get_buffer();
7070
}
7171

72-
std::string AST_Node::to_css(Sass_Inspect_Options opt) const
72+
sass::string AST_Node::to_css(Sass_Inspect_Options opt) const
7373
{
7474
opt.output_style = TO_CSS;
7575
Sass_Output_Options out(opt);
@@ -81,7 +81,7 @@ namespace Sass {
8181
return i.get_buffer();
8282
}
8383

84-
std::string AST_Node::to_string() const
84+
sass::string AST_Node::to_string() const
8585
{
8686
return to_string({ NESTED, 5 });
8787
}
@@ -200,7 +200,7 @@ namespace Sass {
200200
/////////////////////////////////////////////////////////////////////////
201201
/////////////////////////////////////////////////////////////////////////
202202

203-
Trace::Trace(ParserState pstate, std::string n, Block_Obj b, char type)
203+
Trace::Trace(ParserState pstate, sass::string n, Block_Obj b, char type)
204204
: Has_Block(pstate, b), type_(type), name_(n)
205205
{ }
206206
Trace::Trace(const Trace* ptr)
@@ -212,7 +212,7 @@ namespace Sass {
212212
/////////////////////////////////////////////////////////////////////////
213213
/////////////////////////////////////////////////////////////////////////
214214

215-
Directive::Directive(ParserState pstate, std::string kwd, SelectorListObj sel, Block_Obj b, Expression_Obj val)
215+
Directive::Directive(ParserState pstate, sass::string kwd, SelectorListObj sel, Block_Obj b, Expression_Obj val)
216216
: Has_Block(pstate, b), keyword_(kwd), selector_(sel), value_(val) // set value manually if needed
217217
{ statement_type(DIRECTIVE); }
218218
Directive::Directive(const Directive* ptr)
@@ -271,7 +271,7 @@ namespace Sass {
271271
/////////////////////////////////////////////////////////////////////////
272272
/////////////////////////////////////////////////////////////////////////
273273

274-
Assignment::Assignment(ParserState pstate, std::string var, Expression_Obj val, bool is_default, bool is_global)
274+
Assignment::Assignment(ParserState pstate, sass::string var, Expression_Obj val, bool is_default, bool is_global)
275275
: Statement(pstate), variable_(var), value_(val), is_default_(is_default), is_global_(is_global)
276276
{ statement_type(ASSIGNMENT); }
277277
Assignment::Assignment(const Assignment* ptr)
@@ -287,8 +287,8 @@ namespace Sass {
287287

288288
Import::Import(ParserState pstate)
289289
: Statement(pstate),
290-
urls_(std::vector<Expression_Obj>()),
291-
incs_(std::vector<Include>()),
290+
urls_(sass::vector<Expression_Obj>()),
291+
incs_(sass::vector<Include>()),
292292
import_queries_()
293293
{ statement_type(IMPORT); }
294294
Import::Import(const Import* ptr)
@@ -298,8 +298,8 @@ namespace Sass {
298298
import_queries_(ptr->import_queries_)
299299
{ statement_type(IMPORT); }
300300

301-
std::vector<Include>& Import::incs() { return incs_; }
302-
std::vector<Expression_Obj>& Import::urls() { return urls_; }
301+
sass::vector<Include>& Import::incs() { return incs_; }
302+
sass::vector<Expression_Obj>& Import::urls() { return urls_; }
303303

304304
/////////////////////////////////////////////////////////////////////////
305305
/////////////////////////////////////////////////////////////////////////
@@ -311,8 +311,8 @@ namespace Sass {
311311
: Statement(ptr), resource_(ptr->resource_)
312312
{ statement_type(IMPORT_STUB); }
313313
Include Import_Stub::resource() { return resource_; };
314-
std::string Import_Stub::imp_path() { return resource_.imp_path; };
315-
std::string Import_Stub::abs_path() { return resource_.abs_path; };
314+
sass::string Import_Stub::imp_path() { return resource_.imp_path; };
315+
sass::string Import_Stub::abs_path() { return resource_.abs_path; };
316316

317317
/////////////////////////////////////////////////////////////////////////
318318
/////////////////////////////////////////////////////////////////////////
@@ -382,7 +382,7 @@ namespace Sass {
382382
/////////////////////////////////////////////////////////////////////////
383383

384384
For::For(ParserState pstate,
385-
std::string var, Expression_Obj lo, Expression_Obj hi, Block_Obj b, bool inc)
385+
sass::string var, Expression_Obj lo, Expression_Obj hi, Block_Obj b, bool inc)
386386
: Has_Block(pstate, b),
387387
variable_(var), lower_bound_(lo), upper_bound_(hi), is_inclusive_(inc)
388388
{ statement_type(FOR); }
@@ -397,7 +397,7 @@ namespace Sass {
397397
/////////////////////////////////////////////////////////////////////////
398398
/////////////////////////////////////////////////////////////////////////
399399

400-
Each::Each(ParserState pstate, std::vector<std::string> vars, Expression_Obj lst, Block_Obj b)
400+
Each::Each(ParserState pstate, sass::vector<sass::string> vars, Expression_Obj lst, Block_Obj b)
401401
: Has_Block(pstate, b), variables_(vars), list_(lst)
402402
{ statement_type(EACH); }
403403
Each::Each(const Each* ptr)
@@ -459,7 +459,7 @@ namespace Sass {
459459
{ }
460460

461461
Definition::Definition(ParserState pstate,
462-
std::string n,
462+
sass::string n,
463463
Parameters_Obj params,
464464
Block_Obj b,
465465
Type t)
@@ -477,7 +477,7 @@ namespace Sass {
477477

478478
Definition::Definition(ParserState pstate,
479479
Signature sig,
480-
std::string n,
480+
sass::string n,
481481
Parameters_Obj params,
482482
Native_Function func_ptr,
483483
bool overload_stub)
@@ -495,7 +495,7 @@ namespace Sass {
495495

496496
Definition::Definition(ParserState pstate,
497497
Signature sig,
498-
std::string n,
498+
sass::string n,
499499
Parameters_Obj params,
500500
Sass_Function_Entry c_func)
501501
: Has_Block(pstate, {}),
@@ -513,7 +513,7 @@ namespace Sass {
513513
/////////////////////////////////////////////////////////////////////////
514514
/////////////////////////////////////////////////////////////////////////
515515

516-
Mixin_Call::Mixin_Call(ParserState pstate, std::string n, Arguments_Obj args, Parameters_Obj b_params, Block_Obj b)
516+
Mixin_Call::Mixin_Call(ParserState pstate, sass::string n, Arguments_Obj args, Parameters_Obj b_params, Block_Obj b)
517517
: Has_Block(pstate, b), name_(n), arguments_(args), block_parameters_(b_params)
518518
{ }
519519
Mixin_Call::Mixin_Call(const Mixin_Call* ptr)
@@ -566,7 +566,7 @@ namespace Sass {
566566
operand_(ptr->operand_),
567567
hash_(ptr->hash_)
568568
{ }
569-
const std::string Unary_Expression::type_name() {
569+
const sass::string Unary_Expression::type_name() {
570570
switch (optype_) {
571571
case PLUS: return "plus";
572572
case MINUS: return "minus";
@@ -602,7 +602,7 @@ namespace Sass {
602602
/////////////////////////////////////////////////////////////////////////
603603
/////////////////////////////////////////////////////////////////////////
604604

605-
Argument::Argument(ParserState pstate, Expression_Obj val, std::string n, bool rest, bool keyword)
605+
Argument::Argument(ParserState pstate, Expression_Obj val, sass::string n, bool rest, bool keyword)
606606
: Expression(pstate), value_(val), name_(n), is_rest_argument_(rest), is_keyword_argument_(keyword), hash_(0)
607607
{
608608
if (!name_.empty() && is_rest_argument_) {
@@ -646,7 +646,7 @@ namespace Sass {
646646
size_t Argument::hash() const
647647
{
648648
if (hash_ == 0) {
649-
hash_ = std::hash<std::string>()(name());
649+
hash_ = std::hash<sass::string>()(name());
650650
hash_combine(hash_, value()->hash());
651651
}
652652
return hash_;
@@ -776,11 +776,11 @@ namespace Sass {
776776
value_(ptr->value_)
777777
{ }
778778

779-
bool At_Root_Query::exclude(std::string str)
779+
bool At_Root_Query::exclude(sass::string str)
780780
{
781781
bool with = feature() && unquote(feature()->to_string()).compare("with") == 0;
782782
List* l = static_cast<List*>(value().ptr());
783-
std::string v;
783+
sass::string v;
784784

785785
if (with)
786786
{
@@ -828,7 +828,7 @@ namespace Sass {
828828
{
829829
if (Directive_Obj dir = Cast<Directive>(s))
830830
{
831-
std::string keyword(dir->keyword());
831+
sass::string keyword(dir->keyword());
832832
if (keyword.length() > 0) keyword.erase(0, 1);
833833
return expression()->exclude(keyword);
834834
}
@@ -855,7 +855,7 @@ namespace Sass {
855855
/////////////////////////////////////////////////////////////////////////
856856
/////////////////////////////////////////////////////////////////////////
857857

858-
Parameter::Parameter(ParserState pstate, std::string n, Expression_Obj def, bool rest)
858+
Parameter::Parameter(ParserState pstate, sass::string n, Expression_Obj def, bool rest)
859859
: AST_Node(pstate), name_(n), default_value_(def), is_rest_parameter_(rest)
860860
{ }
861861
Parameter::Parameter(const Parameter* ptr)

0 commit comments

Comments
 (0)