From e9cb9ac069f9a3b924943c9f0d2b5cf1aca2d29b Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sat, 30 Apr 2016 10:38:54 +0200 Subject: [PATCH] Fix MSVC issue (appended invalid type to selector schema) --- src/ast.hpp | 2 +- src/expand.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ast.hpp b/src/ast.hpp index 3ed927bff4..02a25e12d8 100644 --- a/src/ast.hpp +++ b/src/ast.hpp @@ -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 diff --git a/src/expand.cpp b/src/expand.cpp index 2515483bb1..3128a8f209 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -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(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();