Skip to content

Commit

Permalink
Merge pull request sass#1129 from xzyfer/cleanup/function/unquote
Browse files Browse the repository at this point in the history
Tidy up the unquote function implementation
  • Loading branch information
xzyfer committed Apr 25, 2015
2 parents 8963264 + 0a66561 commit 25f2d10
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,18 +760,17 @@ namespace Sass {
Signature unquote_sig = "unquote($string)";
BUILT_IN(sass_unquote)
{
if (dynamic_cast<Null*>(env["$string"])) {
AST_Node* arg = env["$string"];
if (dynamic_cast<Null*>(arg)) {
return new (ctx.mem) Null(pstate);
}

To_String to_string(&ctx);
AST_Node* arg = env["$string"];
if (String_Quoted* string_quoted = dynamic_cast<String_Quoted*>(arg)) {
else if (String_Quoted* string_quoted = dynamic_cast<String_Quoted*>(arg)) {
String_Constant* result = 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);
return result;
}
To_String to_string(&ctx);
return new (ctx.mem) String_Constant(pstate, string(arg->perform(&to_string)));
}

Expand Down

0 comments on commit 25f2d10

Please sign in to comment.