Skip to content

Commit 9387623

Browse files
committed
Merge pull request #1466 from mgreter/bugfix/url-keyword
Enable url parsing for `url-prefix` keyword
2 parents 1eefb23 + edb10a8 commit 9387623

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/ast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ namespace Sass {
13371337
public:
13381338
String_Schema(ParserState pstate, size_t size = 0, bool has_interpolants = false)
13391339
: String(pstate), Vectorized<Expression*>(size), has_interpolants_(has_interpolants), hash_(0)
1340-
{ }
1340+
{ concrete_type(STRING); }
13411341
std::string type() { return "string"; }
13421342
static std::string type_name() { return "string"; }
13431343

src/functions.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,11 +1447,7 @@ namespace Sass {
14471447
BUILT_IN(type_of)
14481448
{
14491449
Expression* v = ARG("$value", Expression);
1450-
if (v->concrete_type() == Expression::STRING) {
1451-
To_String to_string(&ctx);
1452-
std::string str(v->perform(&to_string));
1453-
}
1454-
return new (ctx.mem) String_Quoted(pstate, ARG("$value", Expression)->type());
1450+
return new (ctx.mem) String_Quoted(pstate, v->type());
14551451
}
14561452

14571453
Signature unit_sig = "unit($number)";

src/parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,8 @@ namespace Sass {
17311731
std::string name(lexed);
17321732

17331733
ParserState call_pos = pstate;
1734-
Arguments* args = parse_arguments(name == "url");
1734+
bool expect_url = name == "url" || name == "url-prefix";
1735+
Arguments* args = parse_arguments(expect_url);
17351736
return new (ctx.mem) Function_Call(call_pos, name, args);
17361737
}
17371738

0 commit comments

Comments
 (0)