Skip to content

Commit b9880e8

Browse files
committed
Fix String_Schema and Binary_Expression parsing
Fixes #948
1 parent 348fde8 commit b9880e8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

parser.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,11 @@ namespace Sass {
12311231
}
12321232
// if it's a singleton, return it directly; don't wrap it
12331233
if (!peek< class_char< static_ops > >(position)) return factor;
1234+
return parse_operators(factor);
1235+
}
1236+
1237+
Expression* Parser::parse_operators(Expression* factor)
1238+
{
12341239
// parse more factors and operators
12351240
vector<Expression*> operands; // factors
12361241
vector<Binary_Expression::Type> operators; // ops
@@ -1522,7 +1527,12 @@ namespace Sass {
15221527
(*schema) << new (ctx.mem) Textual(pstate, Textual::DIMENSION, lexed);
15231528
}
15241529
else if (lex< number >()) {
1525-
(*schema) << new (ctx.mem) Textual(pstate, Textual::NUMBER, lexed);
1530+
Expression* factor = new (ctx.mem) Textual(pstate, Textual::NUMBER, lexed);
1531+
if (peek< class_char< static_ops > >()) {
1532+
(*schema) << parse_operators(factor);
1533+
} else {
1534+
(*schema) << factor;
1535+
}
15261536
}
15271537
else if (lex< hex >()) {
15281538
(*schema) << new (ctx.mem) Textual(pstate, Textual::HEX, unquote(lexed));

parser.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ namespace Sass {
243243
String* parse_ie_property();
244244
String* parse_ie_keyword_arg();
245245
String_Schema* parse_value_schema(const char* stop);
246+
Expression* parse_operators(Expression* factor);
246247
String* parse_identifier_schema();
247248
// String_Schema* parse_url_schema();
248249
If* parse_if_directive(bool else_if = false);

0 commit comments

Comments
 (0)