diff --git a/ast.hpp b/ast.hpp index 12e3be473f..e4d37f93ef 100644 --- a/ast.hpp +++ b/ast.hpp @@ -431,10 +431,10 @@ namespace Sass { // Keyframe-rules -- the child blocks of "@keyframes" nodes. /////////////////////////////////////////////////////////////////////// class Keyframe_Rule : public Has_Block { - ADD_PROPERTY(String*, rules); + ADD_PROPERTY(Selector*, selector); public: Keyframe_Rule(ParserState pstate, Block* b) - : Has_Block(pstate, b), rules_(0) + : Has_Block(pstate, b), selector_(0) { statement_type(KEYFRAMERULE); } ATTACH_OPERATIONS(); }; diff --git a/cssize.cpp b/cssize.cpp index b00225a370..86738ccce2 100644 --- a/cssize.cpp +++ b/cssize.cpp @@ -87,7 +87,7 @@ namespace Sass { Keyframe_Rule* rr = new (ctx.mem) Keyframe_Rule(r->pstate(), r->block()->perform(this)->block()); - if (r->rules()) rr->rules(r->rules()); + if (r->selector()) rr->selector(r->selector()); return debubble(rr->block(), rr)->block(); } diff --git a/debugger.hpp b/debugger.hpp index e000e2fe3f..7c75023ae6 100644 --- a/debugger.hpp +++ b/debugger.hpp @@ -219,6 +219,11 @@ inline void debug_ast(AST_Node* node, string ind = "", Env* env = 0) cerr << ind << "Declaration " << block << " " << block->tabs() << endl; debug_ast(block->property(), ind + " prop: ", env); debug_ast(block->value(), ind + " value: ", env); + } else if (dynamic_cast(node)) { + Keyframe_Rule* has_block = dynamic_cast(node); + cerr << ind << "Keyframe_Rule " << has_block << " " << has_block->tabs() << endl; + if (has_block->selector()) debug_ast(has_block->selector(), ind + "@"); + if (has_block->block()) for(auto i : has_block->block()->elements()) { debug_ast(i, ind + " ", env); } } else if (dynamic_cast(node)) { At_Rule* block = dynamic_cast(node); cerr << ind << "At_Rule " << block << " [" << block->keyword() << "] " << block->tabs() << endl; @@ -342,7 +347,20 @@ inline void debug_ast(AST_Node* node, string ind = "", Env* env = 0) endl; } else if (dynamic_cast(node)) { Expression* expression = dynamic_cast(node); - cerr << ind << "Expression " << expression << " " << expression->concrete_type() << endl; + cerr << ind << "Expression " << expression; + switch (expression->concrete_type()) { + case Expression::Concrete_Type::NONE: cerr << " [NONE]"; break; + case Expression::Concrete_Type::BOOLEAN: cerr << " [BOOLEAN]"; break; + case Expression::Concrete_Type::NUMBER: cerr << " [NUMBER]"; break; + case Expression::Concrete_Type::COLOR: cerr << " [COLOR]"; break; + case Expression::Concrete_Type::STRING: cerr << " [STRING]"; break; + case Expression::Concrete_Type::LIST: cerr << " [LIST]"; break; + case Expression::Concrete_Type::MAP: cerr << " [MAP]"; break; + case Expression::Concrete_Type::SELECTOR: cerr << " [SELECTOR]"; break; + case Expression::Concrete_Type::NULL_VAL: cerr << " [NULL_VAL]"; break; + case Expression::Concrete_Type::NUM_TYPES: cerr << " [NUM_TYPES]"; break; + } + cerr << endl; } else if (dynamic_cast(node)) { Has_Block* has_block = dynamic_cast(node); cerr << ind << "Has_Block " << has_block << " " << has_block->tabs() << endl; diff --git a/expand.cpp b/expand.cpp index dd08dc69b9..08d461d303 100644 --- a/expand.cpp +++ b/expand.cpp @@ -47,11 +47,7 @@ namespace Sass { if (in_keyframes) { To_String to_string; Keyframe_Rule* k = new (ctx.mem) Keyframe_Rule(r->pstate(), r->block()->perform(this)->block()); - if (r->selector()) { - string s(r->selector()->perform(eval->with(env, backtrace))->perform(&to_string)); - String_Constant* ss = new (ctx.mem) String_Constant(r->selector()->pstate(), s); - k->rules(ss); - } + if (r->selector()) k->selector(r->selector()->perform(contextualize_eval->with(0, env, backtrace))); in_at_root = old_in_at_root; old_in_at_root = false; return k; diff --git a/inspect.cpp b/inspect.cpp index f807613297..f2056c8d1c 100644 --- a/inspect.cpp +++ b/inspect.cpp @@ -44,9 +44,8 @@ namespace Sass { void Inspect::operator()(Keyframe_Rule* rule) { - append_indentation(); - if (rule->rules()) rule->rules()->perform(this); - rule->block()->perform(this); + if (rule->selector()) rule->selector()->perform(this); + if (rule->block()) rule->block()->perform(this); } void Inspect::operator()(Propset* propset) diff --git a/output.cpp b/output.cpp index ce42d6c762..2468471771 100644 --- a/output.cpp +++ b/output.cpp @@ -172,11 +172,10 @@ namespace Sass { void Output::operator()(Keyframe_Rule* r) { - String* v = r->rules(); Block* b = r->block(); + Selector* v = r->selector(); if (v) { - append_indentation(); v->perform(this); }