Skip to content

Commit

Permalink
Merge pull request #1844 from mgreter/bigfix/issue_1765
Browse files Browse the repository at this point in the history
Fix expression parsing with comment between factors
  • Loading branch information
mgreter committed Jan 11, 2016
2 parents 13555cc + afe47e4 commit c13dfc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ namespace Sass {
{
Expression* lhs = parse_operators();
// if it's a singleton, return it (don't wrap it)
if (!(peek< exactly<'+'> >(position) ||
if (!(peek_css< exactly<'+'> >(position) ||
// condition is a bit misterious, but some combinations should not be counted as operations
(peek< no_spaces >(position) && peek< sequence< negate< unsigned_number >, exactly<'-'>, negate< space > > >(position)) ||
(peek< sequence< negate< unsigned_number >, exactly<'-'>, negate< unsigned_number > > >(position))) ||
Expand All @@ -1226,7 +1226,7 @@ namespace Sass {
std::vector<Expression*> operands;
std::vector<Operand> operators;
bool left_ws = peek < css_comments >();
while (lex< exactly<'+'> >() || lex< sequence< negate< digit >, exactly<'-'> > >()) {
while (lex_css< exactly<'+'> >() || lex< sequence< negate< digit >, exactly<'-'> > >()) {
bool right_ws = peek < css_comments >();
operators.push_back({ lexed.to_string() == "+" ? Sass_OP::ADD : Sass_OP::SUB, left_ws, right_ws });
operands.push_back(parse_operators());
Expand Down

0 comments on commit c13dfc0

Please sign in to comment.