Skip to content

Commit 57639ac

Browse files
committed
Rename Has_Block to ParentStatement
1 parent 79732ae commit 57639ac

13 files changed

+81
-81
lines changed

src/ast.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ namespace Sass {
147147
/////////////////////////////////////////////////////////////////////////
148148
/////////////////////////////////////////////////////////////////////////
149149

150-
Has_Block::Has_Block(ParserState pstate, Block_Obj b)
150+
ParentStatement::ParentStatement(ParserState pstate, Block_Obj b)
151151
: Statement(pstate), block_(b)
152152
{ }
153-
Has_Block::Has_Block(const Has_Block* ptr)
153+
ParentStatement::ParentStatement(const ParentStatement* ptr)
154154
: Statement(ptr), block_(ptr->block_)
155155
{ }
156156

157-
bool Has_Block::has_content()
157+
bool ParentStatement::has_content()
158158
{
159159
return (block_ && block_->has_content()) || Statement::has_content();
160160
}
@@ -163,10 +163,10 @@ namespace Sass {
163163
/////////////////////////////////////////////////////////////////////////
164164

165165
Ruleset::Ruleset(ParserState pstate, SelectorListObj s, Block_Obj b)
166-
: Has_Block(pstate, b), selector_(s), schema_(), is_root_(false)
166+
: ParentStatement(pstate, b), selector_(s), schema_(), is_root_(false)
167167
{ statement_type(RULESET); }
168168
Ruleset::Ruleset(const Ruleset* ptr)
169-
: Has_Block(ptr),
169+
: ParentStatement(ptr),
170170
selector_(ptr->selector_),
171171
schema_(ptr->schema_),
172172
is_root_(ptr->is_root_)
@@ -201,10 +201,10 @@ namespace Sass {
201201
/////////////////////////////////////////////////////////////////////////
202202

203203
Trace::Trace(ParserState pstate, sass::string n, Block_Obj b, char type)
204-
: Has_Block(pstate, b), type_(type), name_(n)
204+
: ParentStatement(pstate, b), type_(type), name_(n)
205205
{ }
206206
Trace::Trace(const Trace* ptr)
207-
: Has_Block(ptr),
207+
: ParentStatement(ptr),
208208
type_(ptr->type_),
209209
name_(ptr->name_)
210210
{ }
@@ -213,10 +213,10 @@ namespace Sass {
213213
/////////////////////////////////////////////////////////////////////////
214214

215215
Directive::Directive(ParserState pstate, sass::string kwd, SelectorListObj sel, Block_Obj b, Expression_Obj val)
216-
: Has_Block(pstate, b), keyword_(kwd), selector_(sel), value_(val) // set value manually if needed
216+
: ParentStatement(pstate, b), keyword_(kwd), selector_(sel), value_(val) // set value manually if needed
217217
{ statement_type(DIRECTIVE); }
218218
Directive::Directive(const Directive* ptr)
219-
: Has_Block(ptr),
219+
: ParentStatement(ptr),
220220
keyword_(ptr->keyword_),
221221
selector_(ptr->selector_),
222222
value_(ptr->value_) // set value manually if needed
@@ -241,20 +241,20 @@ namespace Sass {
241241
/////////////////////////////////////////////////////////////////////////
242242

243243
Keyframe_Rule::Keyframe_Rule(ParserState pstate, Block_Obj b)
244-
: Has_Block(pstate, b), name_()
244+
: ParentStatement(pstate, b), name_()
245245
{ statement_type(KEYFRAMERULE); }
246246
Keyframe_Rule::Keyframe_Rule(const Keyframe_Rule* ptr)
247-
: Has_Block(ptr), name_(ptr->name_)
247+
: ParentStatement(ptr), name_(ptr->name_)
248248
{ statement_type(KEYFRAMERULE); }
249249

250250
/////////////////////////////////////////////////////////////////////////
251251
/////////////////////////////////////////////////////////////////////////
252252

253253
Declaration::Declaration(ParserState pstate, String_Obj prop, Expression_Obj val, bool i, bool c, Block_Obj b)
254-
: Has_Block(pstate, b), property_(prop), value_(val), is_important_(i), is_custom_property_(c), is_indented_(false)
254+
: ParentStatement(pstate, b), property_(prop), value_(val), is_important_(i), is_custom_property_(c), is_indented_(false)
255255
{ statement_type(DECLARATION); }
256256
Declaration::Declaration(const Declaration* ptr)
257-
: Has_Block(ptr),
257+
: ParentStatement(ptr),
258258
property_(ptr->property_),
259259
value_(ptr->value_),
260260
is_important_(ptr->is_important_),
@@ -365,29 +365,29 @@ namespace Sass {
365365
/////////////////////////////////////////////////////////////////////////
366366

367367
If::If(ParserState pstate, Expression_Obj pred, Block_Obj con, Block_Obj alt)
368-
: Has_Block(pstate, con), predicate_(pred), alternative_(alt)
368+
: ParentStatement(pstate, con), predicate_(pred), alternative_(alt)
369369
{ statement_type(IF); }
370370
If::If(const If* ptr)
371-
: Has_Block(ptr),
371+
: ParentStatement(ptr),
372372
predicate_(ptr->predicate_),
373373
alternative_(ptr->alternative_)
374374
{ statement_type(IF); }
375375

376376
bool If::has_content()
377377
{
378-
return Has_Block::has_content() || (alternative_ && alternative_->has_content());
378+
return ParentStatement::has_content() || (alternative_ && alternative_->has_content());
379379
}
380380

381381
/////////////////////////////////////////////////////////////////////////
382382
/////////////////////////////////////////////////////////////////////////
383383

384384
For::For(ParserState pstate,
385385
sass::string var, Expression_Obj lo, Expression_Obj hi, Block_Obj b, bool inc)
386-
: Has_Block(pstate, b),
386+
: ParentStatement(pstate, b),
387387
variable_(var), lower_bound_(lo), upper_bound_(hi), is_inclusive_(inc)
388388
{ statement_type(FOR); }
389389
For::For(const For* ptr)
390-
: Has_Block(ptr),
390+
: ParentStatement(ptr),
391391
variable_(ptr->variable_),
392392
lower_bound_(ptr->lower_bound_),
393393
upper_bound_(ptr->upper_bound_),
@@ -398,20 +398,20 @@ namespace Sass {
398398
/////////////////////////////////////////////////////////////////////////
399399

400400
Each::Each(ParserState pstate, sass::vector<sass::string> vars, Expression_Obj lst, Block_Obj b)
401-
: Has_Block(pstate, b), variables_(vars), list_(lst)
401+
: ParentStatement(pstate, b), variables_(vars), list_(lst)
402402
{ statement_type(EACH); }
403403
Each::Each(const Each* ptr)
404-
: Has_Block(ptr), variables_(ptr->variables_), list_(ptr->list_)
404+
: ParentStatement(ptr), variables_(ptr->variables_), list_(ptr->list_)
405405
{ statement_type(EACH); }
406406

407407
/////////////////////////////////////////////////////////////////////////
408408
/////////////////////////////////////////////////////////////////////////
409409

410410
While::While(ParserState pstate, Expression_Obj pred, Block_Obj b)
411-
: Has_Block(pstate, b), predicate_(pred)
411+
: ParentStatement(pstate, b), predicate_(pred)
412412
{ statement_type(WHILE); }
413413
While::While(const While* ptr)
414-
: Has_Block(ptr), predicate_(ptr->predicate_)
414+
: ParentStatement(ptr), predicate_(ptr->predicate_)
415415
{ statement_type(WHILE); }
416416

417417
/////////////////////////////////////////////////////////////////////////
@@ -446,7 +446,7 @@ namespace Sass {
446446
/////////////////////////////////////////////////////////////////////////
447447

448448
Definition::Definition(const Definition* ptr)
449-
: Has_Block(ptr),
449+
: ParentStatement(ptr),
450450
name_(ptr->name_),
451451
parameters_(ptr->parameters_),
452452
environment_(ptr->environment_),
@@ -463,7 +463,7 @@ namespace Sass {
463463
Parameters_Obj params,
464464
Block_Obj b,
465465
Type t)
466-
: Has_Block(pstate, b),
466+
: ParentStatement(pstate, b),
467467
name_(n),
468468
parameters_(params),
469469
environment_(0),
@@ -481,7 +481,7 @@ namespace Sass {
481481
Parameters_Obj params,
482482
Native_Function func_ptr,
483483
bool overload_stub)
484-
: Has_Block(pstate, {}),
484+
: ParentStatement(pstate, {}),
485485
name_(n),
486486
parameters_(params),
487487
environment_(0),
@@ -498,7 +498,7 @@ namespace Sass {
498498
sass::string n,
499499
Parameters_Obj params,
500500
Sass_Function_Entry c_func)
501-
: Has_Block(pstate, {}),
501+
: ParentStatement(pstate, {}),
502502
name_(n),
503503
parameters_(params),
504504
environment_(0),
@@ -514,10 +514,10 @@ namespace Sass {
514514
/////////////////////////////////////////////////////////////////////////
515515

516516
Mixin_Call::Mixin_Call(ParserState pstate, sass::string n, Arguments_Obj args, Parameters_Obj b_params, Block_Obj b)
517-
: Has_Block(pstate, b), name_(n), arguments_(args), block_parameters_(b_params)
517+
: ParentStatement(pstate, b), name_(n), arguments_(args), block_parameters_(b_params)
518518
{ }
519519
Mixin_Call::Mixin_Call(const Mixin_Call* ptr)
520-
: Has_Block(ptr),
520+
: ParentStatement(ptr),
521521
name_(ptr->name_),
522522
arguments_(ptr->arguments_),
523523
block_parameters_(ptr->block_parameters_)
@@ -808,10 +808,10 @@ namespace Sass {
808808
/////////////////////////////////////////////////////////////////////////
809809

810810
At_Root_Block::At_Root_Block(ParserState pstate, Block_Obj b, At_Root_Query_Obj e)
811-
: Has_Block(pstate, b), expression_(e)
811+
: ParentStatement(pstate, b), expression_(e)
812812
{ statement_type(ATROOT); }
813813
At_Root_Block::At_Root_Block(const At_Root_Block* ptr)
814-
: Has_Block(ptr), expression_(ptr->expression_)
814+
: ParentStatement(ptr), expression_(ptr->expression_)
815815
{ statement_type(ATROOT); }
816816

817817
bool At_Root_Block::bubbles() {

src/ast.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -515,21 +515,21 @@ namespace Sass {
515515
////////////////////////////////////////////////////////////////////////
516516
// Abstract base class for statements that contain blocks of statements.
517517
////////////////////////////////////////////////////////////////////////
518-
class Has_Block : public Statement {
518+
class ParentStatement : public Statement {
519519
ADD_PROPERTY(Block_Obj, block)
520520
public:
521-
Has_Block(ParserState pstate, Block_Obj b);
522-
Has_Block(const Has_Block* ptr); // copy constructor
523-
virtual ~Has_Block() = 0; // virtual destructor
521+
ParentStatement(ParserState pstate, Block_Obj b);
522+
ParentStatement(const ParentStatement* ptr); // copy constructor
523+
virtual ~ParentStatement() = 0; // virtual destructor
524524
virtual bool has_content() override;
525525
};
526-
inline Has_Block::~Has_Block() { }
526+
inline ParentStatement::~ParentStatement() { }
527527

528528
/////////////////////////////////////////////////////////////////////////////
529529
// Rulesets (i.e., sets of styles headed by a selector and containing a block
530530
// of style declarations.
531531
/////////////////////////////////////////////////////////////////////////////
532-
class Ruleset final : public Has_Block {
532+
class Ruleset final : public ParentStatement {
533533
ADD_PROPERTY(SelectorListObj, selector)
534534
ADD_PROPERTY(Selector_Schema_Obj, schema)
535535
ADD_PROPERTY(bool, is_root);
@@ -556,7 +556,7 @@ namespace Sass {
556556
/////////////////
557557
// Trace.
558558
/////////////////
559-
class Trace final : public Has_Block {
559+
class Trace final : public ParentStatement {
560560
ADD_CONSTREF(char, type)
561561
ADD_CONSTREF(sass::string, name)
562562
public:
@@ -569,7 +569,7 @@ namespace Sass {
569569
// At-rules -- arbitrary directives beginning with "@" that may have an
570570
// optional statement block.
571571
///////////////////////////////////////////////////////////////////////
572-
class Directive final : public Has_Block {
572+
class Directive final : public ParentStatement {
573573
ADD_CONSTREF(sass::string, keyword)
574574
ADD_PROPERTY(SelectorListObj, selector)
575575
ADD_PROPERTY(Expression_Obj, value)
@@ -585,7 +585,7 @@ namespace Sass {
585585
///////////////////////////////////////////////////////////////////////
586586
// Keyframe-rules -- the child blocks of "@keyframes" nodes.
587587
///////////////////////////////////////////////////////////////////////
588-
class Keyframe_Rule final : public Has_Block {
588+
class Keyframe_Rule final : public ParentStatement {
589589
// according to css spec, this should be <keyframes-name>
590590
// <keyframes-name> = <custom-ident> | <string>
591591
ADD_PROPERTY(SelectorListObj, name)
@@ -598,7 +598,7 @@ namespace Sass {
598598
////////////////////////////////////////////////////////////////////////
599599
// Declarations -- style rules consisting of a property name and values.
600600
////////////////////////////////////////////////////////////////////////
601-
class Declaration final : public Has_Block {
601+
class Declaration final : public ParentStatement {
602602
ADD_PROPERTY(String_Obj, property)
603603
ADD_PROPERTY(Expression_Obj, value)
604604
ADD_PROPERTY(bool, is_important)
@@ -703,7 +703,7 @@ namespace Sass {
703703
////////////////////////////////////
704704
// The Sass `@if` control directive.
705705
////////////////////////////////////
706-
class If final : public Has_Block {
706+
class If final : public ParentStatement {
707707
ADD_PROPERTY(Expression_Obj, predicate)
708708
ADD_PROPERTY(Block_Obj, alternative)
709709
public:
@@ -716,7 +716,7 @@ namespace Sass {
716716
/////////////////////////////////////
717717
// The Sass `@for` control directive.
718718
/////////////////////////////////////
719-
class For final : public Has_Block {
719+
class For final : public ParentStatement {
720720
ADD_CONSTREF(sass::string, variable)
721721
ADD_PROPERTY(Expression_Obj, lower_bound)
722722
ADD_PROPERTY(Expression_Obj, upper_bound)
@@ -730,7 +730,7 @@ namespace Sass {
730730
//////////////////////////////////////
731731
// The Sass `@each` control directive.
732732
//////////////////////////////////////
733-
class Each final : public Has_Block {
733+
class Each final : public ParentStatement {
734734
ADD_PROPERTY(sass::vector<sass::string>, variables)
735735
ADD_PROPERTY(Expression_Obj, list)
736736
public:
@@ -742,7 +742,7 @@ namespace Sass {
742742
///////////////////////////////////////
743743
// The Sass `@while` control directive.
744744
///////////////////////////////////////
745-
class While final : public Has_Block {
745+
class While final : public ParentStatement {
746746
ADD_PROPERTY(Expression_Obj, predicate)
747747
public:
748748
While(ParserState pstate, Expression_Obj pred, Block_Obj b);
@@ -765,7 +765,7 @@ namespace Sass {
765765
// Definitions for both mixins and functions. The two cases are distinguished
766766
// by a type tag.
767767
/////////////////////////////////////////////////////////////////////////////
768-
class Definition final : public Has_Block {
768+
class Definition final : public ParentStatement {
769769
public:
770770
enum Type { MIXIN, FUNCTION };
771771
ADD_CONSTREF(sass::string, name)
@@ -801,7 +801,7 @@ namespace Sass {
801801
//////////////////////////////////////
802802
// Mixin calls (i.e., `@include ...`).
803803
//////////////////////////////////////
804-
class Mixin_Call final : public Has_Block {
804+
class Mixin_Call final : public ParentStatement {
805805
ADD_CONSTREF(sass::string, name)
806806
ADD_PROPERTY(Arguments_Obj, arguments)
807807
ADD_PROPERTY(Parameters_Obj, block_parameters)
@@ -882,7 +882,7 @@ namespace Sass {
882882

883883
// A Media Ruleset before it has been evaluated
884884
// Could be already final or an interpolation
885-
class MediaRule final : public Has_Block {
885+
class MediaRule final : public ParentStatement {
886886
ADD_PROPERTY(List_Obj, schema)
887887
public:
888888
MediaRule(ParserState pstate, Block_Obj block = {});
@@ -895,7 +895,7 @@ namespace Sass {
895895

896896
// A Media Ruleset after it has been evaluated
897897
// Representing the static or resulting css
898-
class CssMediaRule final : public Has_Block,
898+
class CssMediaRule final : public ParentStatement,
899899
public Vectorized<CssMediaQuery_Obj> {
900900
public:
901901
CssMediaRule(ParserState pstate, Block_Obj b);
@@ -1011,7 +1011,7 @@ namespace Sass {
10111011
///////////
10121012
// At-root.
10131013
///////////
1014-
class At_Root_Block final : public Has_Block {
1014+
class At_Root_Block final : public ParentStatement {
10151015
ADD_PROPERTY(At_Root_Query_Obj, expression)
10161016
public:
10171017
At_Root_Block(ParserState pstate, Block_Obj b = {}, At_Root_Query_Obj e = {});

src/ast_fwd_decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Sass {
1616
IMPLEMENT_BASE_CAST(AST_Node)
1717
IMPLEMENT_BASE_CAST(Expression)
1818
IMPLEMENT_BASE_CAST(Statement)
19-
IMPLEMENT_BASE_CAST(Has_Block)
19+
IMPLEMENT_BASE_CAST(ParentStatement)
2020
IMPLEMENT_BASE_CAST(PreValue)
2121
IMPLEMENT_BASE_CAST(Value)
2222
IMPLEMENT_BASE_CAST(Color)

src/ast_fwd_decl.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Sass {
1515

1616
class AST_Node;
1717

18-
class Has_Block;
18+
class ParentStatement;
1919

2020
class SimpleSelector;
2121

@@ -150,7 +150,7 @@ namespace Sass {
150150
IMPL_MEM_OBJ(Debug);
151151
IMPL_MEM_OBJ(Comment);
152152
IMPL_MEM_OBJ(PreValue);
153-
IMPL_MEM_OBJ(Has_Block);
153+
IMPL_MEM_OBJ(ParentStatement);
154154
IMPL_MEM_OBJ(If);
155155
IMPL_MEM_OBJ(For);
156156
IMPL_MEM_OBJ(Each);
@@ -248,7 +248,7 @@ namespace Sass {
248248
DECLARE_BASE_CAST(AST_Node)
249249
DECLARE_BASE_CAST(Expression)
250250
DECLARE_BASE_CAST(Statement)
251-
DECLARE_BASE_CAST(Has_Block)
251+
DECLARE_BASE_CAST(ParentStatement)
252252
DECLARE_BASE_CAST(PreValue)
253253
DECLARE_BASE_CAST(Value)
254254
DECLARE_BASE_CAST(List)

0 commit comments

Comments
 (0)