Skip to content

Commit

Permalink
Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Apr 30, 2016
1 parent 3edc713 commit e74268c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 22 deletions.
5 changes: 2 additions & 3 deletions src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1467,10 +1467,9 @@ namespace Sass {
// "flat" strings.
////////////////////////////////////////////////////////////////////////
class String : public Value {
ADD_PROPERTY(bool, sass_fix_1291)
public:
String(ParserState pstate, bool delayed = false, bool sass_fix_1291 = false)
: Value(pstate, delayed), sass_fix_1291_(sass_fix_1291)
String(ParserState pstate, bool delayed = false)
: Value(pstate, delayed)
{ concrete_type(STRING); }
static std::string type_name() { return "string"; }
virtual ~String() = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/debugger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " [" << prettyprint(expression->value()) << "]";
if (expression->is_delayed()) std::cerr << " [delayed]";
if (expression->sass_fix_1291()) std::cerr << " [sass_fix_1291]";
if (expression->is_interpolant()) std::cerr << " [interpolant]";
if (expression->quote_mark()) std::cerr << " [quote_mark: " << expression->quote_mark() << "]";
std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
Expand All @@ -609,7 +608,6 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
std::cerr << " (" << pstate_source_position(node) << ")";
std::cerr << " [" << prettyprint(expression->value()) << "]";
if (expression->is_delayed()) std::cerr << " [delayed]";
if (expression->sass_fix_1291()) std::cerr << " [sass_fix_1291]";
if (expression->is_interpolant()) std::cerr << " [interpolant]";
std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
} else if (dynamic_cast<String_Schema*>(node)) {
Expand All @@ -628,7 +626,6 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
std::cerr << ind << "String " << expression;
std::cerr << " " << expression->concrete_type();
std::cerr << " (" << pstate_source_position(node) << ")";
if (expression->sass_fix_1291()) std::cerr << " [sass_fix_1291]";
if (expression->is_interpolant()) std::cerr << " [interpolant]";
std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
} else if (dynamic_cast<Expression*>(node)) {
Expand Down
8 changes: 3 additions & 5 deletions src/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ namespace Sass {

Expression* Eval::operator()(Binary_Expression* b)
{
// debug_ast(b);

String_Schema* ret_schema = 0;
enum Sass_OP op_type = b->type();

Expand Down Expand Up @@ -890,7 +890,7 @@ namespace Sass {
if (result->pstate().file == std::string::npos)
result->pstate(c->pstate());

if (!result->is_delayed()) result = result->perform(this);
result = result->perform(this);
result->is_interpolant(c->is_interpolant());
exp.env_stack.pop_back();
return result;
Expand Down Expand Up @@ -1136,7 +1136,7 @@ namespace Sass {
bool is_quoted = dynamic_cast<String_Quoted*>((*s)[i]) != NULL;
if (was_quoted && !(*s)[i]->is_interpolant() && !was_interpolant) { res += " "; }
else if (i > 0 && is_quoted && !(*s)[i]->is_interpolant() && !was_interpolant) { res += " "; }
Expression* ex = (*s)[i]->is_delayed() ? (*s)[i] : (*s)[i]->perform(this);
Expression* ex = (*s)[i]->perform(this);
interpolation(ctx, res, ex, into_quotes, ex->is_interpolant());
was_quoted = dynamic_cast<String_Quoted*>((*s)[i]) != NULL;
was_interpolant = (*s)[i]->is_interpolant();
Expand Down Expand Up @@ -1279,8 +1279,6 @@ namespace Sass {
Expression* Eval::operator()(Argument* a)
{
Expression* val = a->value();
// delay missin function arguments?
val->is_delayed(a->is_delayed());
val = val->perform(this);

bool is_rest_argument = a->is_rest_argument();
Expand Down
1 change: 0 additions & 1 deletion src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,6 @@ namespace Sass {
if (String_Quoted* string_quoted = dynamic_cast<String_Quoted*>(arg)) {
String_Constant* result = SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, string_quoted->value());
// remember if the string was quoted (color tokens)
result->sass_fix_1291(string_quoted->quote_mark() != 0);
result->is_delayed(true); // delay colors
return result;
}
Expand Down
12 changes: 4 additions & 8 deletions src/inspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,8 @@ namespace Sass {
(output_style() == INSPECT) || (
expr->op().ws_before
&& (!expr->is_interpolant())
&& (!expr->is_delayed() ||
expr->is_left_interpolant() ||
expr->is_right_interpolant()
)
&& (expr->is_left_interpolant() ||
expr->is_right_interpolant())

)) append_string(" ");
switch (expr->type()) {
Expand All @@ -469,10 +467,8 @@ namespace Sass {
(output_style() == INSPECT) || (
expr->op().ws_after
&& (!expr->is_interpolant())
&& (!expr->is_delayed()
|| expr->is_left_interpolant()
|| expr->is_right_interpolant()
)
&& (expr->is_left_interpolant() ||
expr->is_right_interpolant())
)) append_string(" ");
expr->right()->perform(this);
}
Expand Down
2 changes: 0 additions & 2 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ namespace Sass {
lex_css< exactly<':'> >();
Expression* val = parse_space_list();
arg = SASS_MEMORY_NEW(ctx.mem, Argument, p, val, name);
arg->is_delayed(val->is_delayed()); // inherit from value
}
else {
bool is_arglist = false;
Expand All @@ -456,7 +455,6 @@ namespace Sass {
else is_arglist = true;
}
arg = SASS_MEMORY_NEW(ctx.mem, Argument, pstate, val, "", is_arglist, is_keyword);
arg->is_delayed(val->is_delayed()); // inherit from value
}
return arg;
}
Expand Down

0 comments on commit e74268c

Please sign in to comment.