@@ -52,25 +52,6 @@ namespace Sass {
5252 }
5353 }
5454
55- Sass_OP sass_name_to_op (std::string op)
56- {
57- if (op == " &&" ) return AND;
58- if (op == " ||" ) return OR;
59- if (op == " ==" ) return EQ;
60- if (op == " !=" ) return NEQ;
61- if (op == " >" ) return GT;
62- if (op == " >=" ) return GTE;
63- if (op == " <" ) return LT;
64- if (op == " <=" ) return LTE;
65- if (op == " +" ) return ADD;
66- if (op == " ." ) return SUB;
67- if (op == " *" ) return MUL;
68- if (op == " /" ) return DIV;
69- if (op == " &" ) return MOD;
70- if (op == " =" ) return IESEQ;
71- return NUM_OPS;
72- }
73-
7455 const char * sass_op_separator (enum Sass_OP op) {
7556 switch (op) {
7657 case AND: return " &&" ;
@@ -285,36 +266,34 @@ namespace Sass {
285266 // ///////////////////////////////////////////////////////////////////////
286267 // ///////////////////////////////////////////////////////////////////////
287268
288- Directive::Directive (ParserState pstate, std::string kwd, SelectorListObj sel , Block_Obj b, Expression_Obj val)
289- : Has_Block(pstate, b), keyword_(kwd), selector_(sel), interpolation_(), selSchema_ (), value_(val), name2_(), value2_() // set value manually if needed
269+ AtRule::AtRule (ParserState pstate, std::string kwd, Block_Obj b, Expression_Obj val)
270+ : Has_Block(pstate, b), keyword_(kwd), interpolation_(), value_(val), name2_(), value2_() // set value manually if needed
290271 { statement_type (DIRECTIVE); }
291272
292- Directive::Directive (ParserState pstate, InterpolationObj itpl, SelectorListObj sel , Block_Obj b, Expression_Obj val)
293- : Has_Block(pstate, b), keyword_(), selector_(sel), interpolation_(itpl), selSchema_( ), value_(val), name2_(), value2_() // set value manually if needed
273+ AtRule::AtRule (ParserState pstate, InterpolationObj itpl, Block_Obj b, Expression_Obj val)
274+ : Has_Block(pstate, b), keyword_(), interpolation_(itpl), value_(val), name2_(), value2_() // set value manually if needed
294275 {
295276 statement_type (DIRECTIVE);
296277 }
297278
298- Directive::Directive (const Directive * ptr)
279+ AtRule::AtRule (const AtRule * ptr)
299280 : Has_Block(ptr),
300281 keyword_(ptr->keyword_),
301- selector_(ptr->selector_),
302282 interpolation_(ptr->interpolation_),
303- selSchema_(ptr->selSchema_),
304283 value_(ptr->value_),
305284 name2_(ptr->name2_),
306285 value2_(ptr->value2_) // set value manually if needed
307286 { statement_type (DIRECTIVE); }
308287
309- bool Directive ::bubbles () { return is_keyframes () || is_media (); }
288+ bool AtRule ::bubbles () { return is_keyframes () || is_media (); }
310289
311- bool Directive ::is_media () {
290+ bool AtRule ::is_media () {
312291 return keyword_.compare (" @-webkit-media" ) == 0 ||
313292 keyword_.compare (" @-moz-media" ) == 0 ||
314293 keyword_.compare (" @-o-media" ) == 0 ||
315294 keyword_.compare (" @media" ) == 0 ;
316295 }
317- bool Directive ::is_keyframes () {
296+ bool AtRule ::is_keyframes () {
318297 return keyword_.compare (" @-webkit-keyframes" ) == 0 ||
319298 keyword_.compare (" @-moz-keyframes" ) == 0 ||
320299 keyword_.compare (" @-o-keyframes" ) == 0 ||
@@ -354,22 +333,6 @@ namespace Sass {
354333 }
355334
356335
357- Declaration2::Declaration2 (const Declaration2* ptr) :
358- Has_Block(ptr),
359- name_(ptr->name_),
360- value_(ptr->value_)
361- {
362- statement_type (DECLARATION);
363- }
364-
365- CssDeclaration::CssDeclaration (const CssDeclaration* ptr) :
366- Statement(ptr),
367- name_(ptr->name_),
368- value_(ptr->value_)
369- {
370- statement_type (DECLARATION);
371- }
372-
373336 // ///////////////////////////////////////////////////////////////////////
374337 // ///////////////////////////////////////////////////////////////////////
375338
@@ -408,15 +371,17 @@ namespace Sass {
408371 ImportBase(pstate),
409372 url_(url),
410373 supports_(supports),
411- media_(media)
374+ media_(media),
375+ outOfOrder_(true )
412376 {}
413377
414378 StaticImport::StaticImport (
415379 const StaticImport* ptr) :
416380 ImportBase(ptr),
417381 url_(ptr->url_),
418382 supports_(ptr->supports_),
419- media_(ptr->media_)
383+ media_(ptr->media_),
384+ outOfOrder_(ptr->outOfOrder_)
420385 {}
421386
422387 // ///////////////////////////////////////////////////////////////////////
@@ -482,13 +447,14 @@ namespace Sass {
482447 // ///////////////////////////////////////////////////////////////////////
483448 // ///////////////////////////////////////////////////////////////////////
484449
485- Import_Stub::Import_Stub (ParserState pstate, Include res)
486- : ImportBase(pstate), resource_(res)
450+ Import_Stub::Import_Stub (ParserState pstate, Include res/* , Sass_Import_Entry imp */ )
451+ : ImportBase(pstate), resource_(res)// , import_(imp)
487452 { statement_type (IMPORT_STUB); }
488453 Import_Stub::Import_Stub (const Import_Stub* ptr)
489- : ImportBase(ptr), resource_(ptr->resource_)
454+ : ImportBase(ptr), resource_(ptr->resource_)// , import_(ptr->import_)
490455 { statement_type (IMPORT_STUB); }
491456 Include Import_Stub::resource () { return resource_; };
457+ // Sass_Import_Entry Import_Stub::import() { return import_; };
492458 std::string Import_Stub::imp_path () { return resource_.imp_path ; };
493459 std::string Import_Stub::abs_path () { return resource_.abs_path ; };
494460
@@ -542,6 +508,36 @@ namespace Sass {
542508 // ///////////////////////////////////////////////////////////////////////
543509 // ///////////////////////////////////////////////////////////////////////
544510
511+ LoudComment::LoudComment (ParserState pstate, InterpolationObj itpl)
512+ : Statement(pstate), text_(itpl)
513+ {
514+ statement_type (COMMENT);
515+ }
516+ LoudComment::LoudComment (const LoudComment* ptr)
517+ : Statement(ptr),
518+ text_(ptr->text_)
519+ {
520+ statement_type (COMMENT);
521+ }
522+
523+ // ///////////////////////////////////////////////////////////////////////
524+ // ///////////////////////////////////////////////////////////////////////
525+
526+ SilentComment::SilentComment (ParserState pstate, std::string text)
527+ : Statement(pstate), text_(text)
528+ {
529+ statement_type (COMMENT);
530+ }
531+ SilentComment::SilentComment (const SilentComment* ptr)
532+ : Statement(ptr),
533+ text_(ptr->text_)
534+ {
535+ statement_type (COMMENT);
536+ }
537+
538+ // ///////////////////////////////////////////////////////////////////////
539+ // ///////////////////////////////////////////////////////////////////////
540+
545541 If::If (ParserState pstate, Expression_Obj pred, Block_Obj con, Block_Obj alt)
546542 : Has_Block(pstate, con), predicate_(pred), alternative_(alt)
547543 { statement_type (IF); }
@@ -804,9 +800,6 @@ namespace Sass {
804800 Argument::Argument (ParserState pstate, Expression_Obj val, std::string n, bool rest, bool keyword)
805801 : Expression(pstate), value_(val), name_(n), is_rest_argument_(rest), is_keyword_argument_(keyword), hash_(0 )
806802 {
807- if (!name_.empty () && is_rest_argument_) {
808- coreError (" variable-length argument may not be passed by name" , pstate_);
809- }
810803 }
811804 Argument::Argument (const Argument* ptr)
812805 : Expression(ptr),
@@ -816,9 +809,6 @@ namespace Sass {
816809 is_keyword_argument_(ptr->is_keyword_argument_),
817810 hash_(ptr->hash_)
818811 {
819- if (!name_.empty () && is_rest_argument_) {
820- coreError (" variable-length argument may not be passed by name" , pstate_);
821- }
822812 }
823813
824814 void Argument::set_delayed (bool delayed)
@@ -904,68 +894,19 @@ namespace Sass {
904894 void Arguments::adjust_after_pushing (Argument_Obj a)
905895 {
906896 if (!a->name ().empty ()) {
907- if (has_keyword_argument ()) {
908- coreError (" named arguments must precede variable-length argument" , a->pstate ());
909- }
910897 has_named_arguments (true );
911898 }
912899 else if (a->is_rest_argument ()) {
913- if (has_rest_argument ()) {
914- coreError (" functions and mixins may only be called with one variable-length argument" , a->pstate ());
915- }
916- if (has_keyword_argument_) {
917- coreError (" only keyword arguments may follow variable arguments" , a->pstate ());
918- }
919900 has_rest_argument (true );
920901 }
921902 else if (a->is_keyword_argument ()) {
922- if (has_keyword_argument ()) {
923- coreError (" functions and mixins may only be called with one keyword argument" , a->pstate ());
924- }
925903 has_keyword_argument (true );
926904 }
927- else {
928- if (has_rest_argument ()) {
929- coreError (" ordinal arguments must precede variable-length arguments" , a->pstate ());
930- }
931- if (has_named_arguments ()) {
932- coreError (" ordinal arguments must precede named arguments" , a->pstate ());
933- }
934- }
935905 }
936906
937907 // ///////////////////////////////////////////////////////////////////////
938908 // ///////////////////////////////////////////////////////////////////////
939909
940- Media_Query::Media_Query (ParserState pstate, String_Obj t, size_t s, bool n, bool r)
941- : Expression(pstate), Vectorized<Media_Query_Expression_Obj>(s),
942- media_type_(t), is_negated_(n), is_restricted_(r)
943- { }
944- Media_Query::Media_Query (const Media_Query* ptr)
945- : Expression(ptr),
946- Vectorized<Media_Query_Expression_Obj>(*ptr),
947- media_type_(ptr->media_type_),
948- is_negated_(ptr->is_negated_),
949- is_restricted_(ptr->is_restricted_)
950- { }
951-
952- // ///////////////////////////////////////////////////////////////////////
953- // ///////////////////////////////////////////////////////////////////////
954-
955- Media_Query_Expression::Media_Query_Expression (ParserState pstate,
956- Expression_Obj f, Expression_Obj v, bool i)
957- : Expression(pstate), feature_(f), value_(v), is_interpolated_(i)
958- { }
959- Media_Query_Expression::Media_Query_Expression (const Media_Query_Expression* ptr)
960- : Expression(ptr),
961- feature_(ptr->feature_),
962- value_(ptr->value_),
963- is_interpolated_(ptr->is_interpolated_)
964- { }
965-
966- // ///////////////////////////////////////////////////////////////////////
967- // ///////////////////////////////////////////////////////////////////////
968-
969910 At_Root_Query::At_Root_Query (ParserState pstate, Expression_Obj f, Expression_Obj v, bool i)
970911 : Expression(pstate), feature_(f), value_(v)
971912 { }
@@ -1027,7 +968,7 @@ namespace Sass {
1027968
1028969 if (s->statement_type () == Statement::DIRECTIVE)
1029970 {
1030- if (Directive_Obj dir = Cast<Directive >(s))
971+ if (AtRuleObj dir = Cast<AtRule >(s))
1031972 {
1032973 std::string keyword (dir->keyword ());
1033974 if (keyword.length () > 0 ) keyword.erase (0 , 1 );
@@ -1046,7 +987,7 @@ namespace Sass {
1046987 {
1047988 return expression ()->exclude (" supports" );
1048989 }
1049- if (Directive_Obj dir = Cast<Directive >(s))
990+ if (AtRuleObj dir = Cast<AtRule >(s))
1050991 {
1051992 if (dir->is_keyframes ()) return expression ()->exclude (" keyframes" );
1052993 }
@@ -1085,25 +1026,11 @@ namespace Sass {
10851026 void Parameters::adjust_after_pushing (Parameter_Obj p)
10861027 {
10871028 if (p->default_value ()) {
1088- if (has_rest_parameter ()) {
1089- coreError (" optional parameters may not be combined with variable-length parameters" , p->pstate ());
1090- }
10911029 has_optional_parameters (true );
10921030 }
10931031 else if (p->is_rest_parameter ()) {
1094- if (has_rest_parameter ()) {
1095- coreError (" functions and mixins cannot have more than one variable-length parameter" , p->pstate ());
1096- }
10971032 has_rest_parameter (true );
10981033 }
1099- else {
1100- if (has_rest_parameter ()) {
1101- coreError (" required parameters must precede variable-length parameters" , p->pstate ());
1102- }
1103- if (has_optional_parameters ()) {
1104- coreError (" required parameters must precede optional parameters" , p->pstate ());
1105- }
1106- }
11071034 }
11081035
11091036 // ///////////////////////////////////////////////////////////////////////
@@ -1115,29 +1042,28 @@ namespace Sass {
11151042 IMPLEMENT_AST_OPERATORS (Ruleset);
11161043 IMPLEMENT_AST_OPERATORS (MediaRule);
11171044 IMPLEMENT_AST_OPERATORS (CssMediaRule);
1118- IMPLEMENT_AST_OPERATORS (CssMediaQuery);
11191045 IMPLEMENT_AST_OPERATORS (Import);
11201046 IMPLEMENT_AST_OPERATORS (Import_Stub);
11211047 IMPLEMENT_AST_OPERATORS (ImportRule);
11221048 IMPLEMENT_AST_OPERATORS (StaticImport);
11231049 IMPLEMENT_AST_OPERATORS (DynamicImport);
1124- IMPLEMENT_AST_OPERATORS (Directive );
1050+ IMPLEMENT_AST_OPERATORS (AtRule );
11251051 IMPLEMENT_AST_OPERATORS (At_Root_Block);
11261052 IMPLEMENT_AST_OPERATORS (While);
11271053 IMPLEMENT_AST_OPERATORS (Each);
11281054 IMPLEMENT_AST_OPERATORS (For);
11291055 IMPLEMENT_AST_OPERATORS (If);
11301056 IMPLEMENT_AST_OPERATORS (Mixin_Call);
11311057 IMPLEMENT_AST_OPERATORS (ExtendRule);
1132- IMPLEMENT_AST_OPERATORS (Media_Query);
1133- IMPLEMENT_AST_OPERATORS (Media_Query_Expression);
11341058 IMPLEMENT_AST_OPERATORS (Debug);
11351059 IMPLEMENT_AST_OPERATORS (Error);
11361060 IMPLEMENT_AST_OPERATORS (Warning);
11371061 IMPLEMENT_AST_OPERATORS (Assignment);
11381062 IMPLEMENT_AST_OPERATORS (Return);
11391063 IMPLEMENT_AST_OPERATORS (At_Root_Query);
11401064 IMPLEMENT_AST_OPERATORS (Comment);
1065+ IMPLEMENT_AST_OPERATORS (LoudComment);
1066+ IMPLEMENT_AST_OPERATORS (SilentComment);
11411067 IMPLEMENT_AST_OPERATORS (Parameters);
11421068 IMPLEMENT_AST_OPERATORS (Parameter);
11431069 IMPLEMENT_AST_OPERATORS (Arguments);
@@ -1151,8 +1077,6 @@ namespace Sass {
11511077 IMPLEMENT_AST_OPERATORS (Bubble);
11521078 IMPLEMENT_AST_OPERATORS (Definition);
11531079 IMPLEMENT_AST_OPERATORS (Declaration);
1154- IMPLEMENT_AST_OPERATORS (Declaration2);
1155- IMPLEMENT_AST_OPERATORS (CssDeclaration);
11561080
11571081 // ///////////////////////////////////////////////////////////////////////
11581082 // ///////////////////////////////////////////////////////////////////////
0 commit comments