@@ -154,7 +154,7 @@ namespace Sass {
154
154
{ }
155
155
Block::Block (const Block* ptr)
156
156
: Statement(ptr),
157
- Vectorized<Statement_Obj>(* ptr),
157
+ Vectorized<Statement_Obj>(ptr),
158
158
is_root_(ptr->is_root_)
159
159
{ }
160
160
@@ -166,7 +166,7 @@ namespace Sass {
166
166
167
167
bool Block::isInvisible () const
168
168
{
169
- for (auto & item : elements ()) {
169
+ for (auto & item : this -> elements ()) {
170
170
if (!item->is_invisible ()) return false ;
171
171
}
172
172
return true ;
@@ -198,22 +198,16 @@ namespace Sass {
198
198
// ///////////////////////////////////////////////////////////////////////
199
199
// ///////////////////////////////////////////////////////////////////////
200
200
201
- Ruleset::Ruleset (ParserState pstate, SelectorListObj s, Block_Obj b)
202
- : Has_Block(pstate, b), selector_(s), interpolation_(), is_root_( false )
201
+ StyleRule::StyleRule (ParserState pstate, Interpolation* s, Block_Obj b)
202
+ : Has_Block(pstate, b), interpolation_(s )
203
203
{ statement_type (RULESET); }
204
204
205
- Ruleset::Ruleset (ParserState pstate, Interpolation* s, Block_Obj b)
206
- : Has_Block(pstate, b), selector_(), interpolation_(s), is_root_(false )
207
- { statement_type (RULESET); }
208
-
209
- Ruleset::Ruleset (const Ruleset* ptr)
205
+ StyleRule::StyleRule (const StyleRule* ptr)
210
206
: Has_Block(ptr),
211
- selector_(ptr->selector_),
212
- interpolation_(ptr->interpolation_),
213
- is_root_(ptr->is_root_)
207
+ interpolation_(ptr->interpolation_)
214
208
{ statement_type (RULESET); }
215
209
216
- bool Ruleset ::is_invisible () const {
210
+ bool CssStyleRule ::is_invisible () const {
217
211
bool sel_invisible = true ;
218
212
bool els_invisible = true ;
219
213
if (const SelectorList * sl = Cast<SelectorList>(selector ())) {
@@ -692,17 +686,11 @@ namespace Sass {
692
686
693
687
Expression::Expression (ParserState pstate, bool d, bool e, bool i, Type ct)
694
688
: AST_Node(pstate),
695
- is_delayed_(d),
696
- is_expanded_(e),
697
- is_interpolant_(i),
698
689
concrete_type_(ct)
699
690
{ }
700
691
701
692
Expression::Expression (const Expression* ptr)
702
693
: AST_Node(ptr),
703
- is_delayed_(ptr->is_delayed_),
704
- is_expanded_(ptr->is_expanded_),
705
- is_interpolant_(ptr->is_interpolant_),
706
694
concrete_type_(ptr->concrete_type_)
707
695
{ }
708
696
@@ -722,34 +710,17 @@ namespace Sass {
722
710
expression_(ptr->expression ())
723
711
{}
724
712
725
- size_t ParenthesizedExpression::hash () const
726
- {
727
- if (expression ()) {
728
- return expression ()->hash ();
729
- }
730
- return 0 ;
731
- }
732
-
733
713
// ///////////////////////////////////////////////////////////////////////
734
714
// ///////////////////////////////////////////////////////////////////////
735
715
736
716
Unary_Expression::Unary_Expression (ParserState pstate, Type t, Expression_Obj o)
737
- : Expression(pstate), optype_(t), operand_(o), hash_( 0 )
717
+ : Expression(pstate), optype_(t), operand_(o)
738
718
{ }
739
719
Unary_Expression::Unary_Expression (const Unary_Expression* ptr)
740
720
: Expression(ptr),
741
721
optype_(ptr->optype_),
742
- operand_(ptr->operand_),
743
- hash_(ptr->hash_)
722
+ operand_(ptr->operand_)
744
723
{ }
745
- size_t Unary_Expression::hash () const
746
- {
747
- if (hash_ == 0 ) {
748
- hash_ = std::hash<size_t >()(optype_);
749
- hash_combine (hash_, operand ()->hash ());
750
- };
751
- return hash_;
752
- }
753
724
754
725
// ///////////////////////////////////////////////////////////////////////
755
726
// ///////////////////////////////////////////////////////////////////////
@@ -768,12 +739,6 @@ namespace Sass {
768
739
{
769
740
}
770
741
771
- void Argument::set_delayed (bool delayed)
772
- {
773
- if (value_) value_->set_delayed (delayed);
774
- is_delayed (delayed);
775
- }
776
-
777
742
size_t Argument::hash () const
778
743
{
779
744
if (hash_ == 0 ) {
@@ -788,62 +753,58 @@ namespace Sass {
788
753
789
754
Arguments::Arguments (ParserState pstate)
790
755
: Expression(pstate),
791
- Vectorized<Argument_Obj>(),
792
- has_named_arguments_(false ),
793
- has_rest_argument_(false ),
794
- has_keyword_argument_(false )
756
+ Vectorized<Argument_Obj>()
795
757
{ }
796
758
Arguments::Arguments (const Arguments* ptr)
797
759
: Expression(ptr),
798
- Vectorized<Argument_Obj>(*ptr),
799
- has_named_arguments_(ptr->has_named_arguments_),
800
- has_rest_argument_(ptr->has_rest_argument_),
801
- has_keyword_argument_(ptr->has_keyword_argument_)
760
+ Vectorized<Argument_Obj>(*ptr)
802
761
{ }
803
762
804
- void Arguments::set_delayed ( bool delayed )
763
+ ArgumentObj Arguments::get_rest_argument ( )
805
764
{
806
- for (Argument_Obj arg : elements ()) {
807
- if (arg) arg->set_delayed (delayed);
765
+ for (Argument* arg : elements ()) {
766
+ if (arg->is_rest_argument ()) {
767
+ return arg;
768
+ }
808
769
}
809
- is_delayed (delayed );
770
+ return ArgumentObj ( );
810
771
}
811
772
812
- Argument_Obj Arguments::get_rest_argument ()
773
+ ArgumentObj Arguments::get_keyword_argument ()
813
774
{
814
- if (this ->has_rest_argument ()) {
815
- for (Argument_Obj arg : this ->elements ()) {
816
- if (arg->is_rest_argument ()) {
817
- return arg;
818
- }
775
+ for (Argument* arg : elements ()) {
776
+ if (arg->is_keyword_argument ()) {
777
+ return arg;
819
778
}
820
779
}
821
- return {} ;
780
+ return ArgumentObj () ;
822
781
}
823
782
824
- Argument_Obj Arguments::get_keyword_argument ()
825
- {
826
- if (this ->has_keyword_argument ()) {
827
- for (Argument_Obj arg : this ->elements ()) {
828
- if (arg->is_keyword_argument ()) {
829
- return arg;
830
- }
783
+ bool Arguments::hasRestArgument () const {
784
+ for (const Argument* arg : elements ()) {
785
+ if (arg->is_rest_argument ()) {
786
+ return true ;
831
787
}
832
788
}
833
- return {} ;
789
+ return false ;
834
790
}
835
791
836
- void Arguments::adjust_after_pushing (Argument_Obj a)
837
- {
838
- if (!a->name ().empty ()) {
839
- has_named_arguments (true );
840
- }
841
- else if (a->is_rest_argument ()) {
842
- has_rest_argument (true );
792
+ bool Arguments::hasNamedArgument () const {
793
+ for (const Argument* arg : elements ()) {
794
+ if (!arg->name ().empty ()) {
795
+ return true ;
796
+ }
843
797
}
844
- else if (a->is_keyword_argument ()) {
845
- has_keyword_argument (true );
798
+ return false ;
799
+ }
800
+
801
+ bool Arguments::hasKeywordArgument () const {
802
+ for (const Argument* arg : elements ()) {
803
+ if (arg->is_keyword_argument ()) {
804
+ return true ;
805
+ }
846
806
}
807
+ return false ;
847
808
}
848
809
849
810
// ///////////////////////////////////////////////////////////////////////
@@ -965,23 +926,13 @@ namespace Sass {
965
926
has_rest_parameter_(ptr->has_rest_parameter_)
966
927
{ }
967
928
968
- void Parameters::adjust_after_pushing (Parameter_Obj p)
969
- {
970
- if (p->default_value ()) {
971
- has_optional_parameters (true );
972
- }
973
- else if (p->is_rest_parameter ()) {
974
- has_rest_parameter (true );
975
- }
976
- }
977
-
978
929
// ///////////////////////////////////////////////////////////////////////
979
930
// ///////////////////////////////////////////////////////////////////////
980
931
981
932
// If you forget to add a class here you will get
982
933
// undefined reference to `vtable for Sass::Class'
983
934
984
- IMPLEMENT_AST_OPERATORS (Ruleset );
935
+ IMPLEMENT_AST_OPERATORS (StyleRule );
985
936
IMPLEMENT_AST_OPERATORS (MediaRule);
986
937
IMPLEMENT_AST_OPERATORS (Import);
987
938
IMPLEMENT_AST_OPERATORS (Import_Stub);
0 commit comments