Skip to content

Commit

Permalink
Fix MSVC issue (appended invalid type to selector schema)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Apr 30, 2016
1 parent 734668f commit e9cb9ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ namespace Sass {
ADD_PROPERTY(bool, group_end)
public:
Statement(ParserState pstate, Statement_Type st = NONE, size_t t = 0)
: AST_Node(pstate), statement_type_(st), tabs_(t), group_end_(false)
: AST_Node(pstate), block_(0), statement_type_(st), tabs_(t), group_end_(false)
{ }
virtual ~Statement() = 0;
// needed for rearranging nested rulesets during CSS emission
Expand Down
11 changes: 6 additions & 5 deletions src/expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,17 @@ namespace Sass {
{
property_stack.push_back(p->property_fragment());
Block* expanded_block = p->block()->perform(this)->block();

for (size_t i = 0, L = expanded_block->length(); i < L; ++i) {
Statement* stm = (*expanded_block)[i];
if (Declaration* dec = static_cast<Declaration*>(stm)) {
String_Schema* combined_prop = SASS_MEMORY_NEW(ctx.mem, String_Schema, p->pstate());
if (!property_stack.empty()) {
*combined_prop << property_stack.back()->perform(&eval)
<< SASS_MEMORY_NEW(ctx.mem, String_Quoted,
p->pstate(), "-")
<< dec->property(); // TODO: eval the prop into a string constant
*combined_prop << property_stack.back()->perform(&eval);
*combined_prop << SASS_MEMORY_NEW(ctx.mem, String_Quoted, p->pstate(), "-");
if (dec->property()) {
// we cannot directly add block (from dec->property()) to string schema (combined_prop)
*combined_prop << SASS_MEMORY_NEW(ctx.mem, String_Quoted, dec->pstate(), dec->property()->to_string());
}
}
else {
*combined_prop << dec->property();
Expand Down

0 comments on commit e9cb9ac

Please sign in to comment.