Skip to content

Commit

Permalink
Merge pull request #767 from xzyfer/fix/better-parsing-of-minus-operand
Browse files Browse the repository at this point in the history
Improved parsing of - in declaration values
  • Loading branch information
xzyfer committed Jan 3, 2015
2 parents 5275553 + d1894bd commit 9087a77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,13 +1020,14 @@ namespace Sass {
Expression* term1 = parse_term();
// if it's a singleton, return it directly; don't wrap it
if (!(peek< exactly<'+'> >(position) ||
peek< sequence< negate< number >, exactly<'-'> > >(position)) ||
(peek< no_spaces >(position) && peek< sequence< negate< digits >, exactly<'-'> > >(position)) ||
(peek< sequence< negate< digits >, exactly<'-'>, negate< digits > > >(position))) ||
peek< identifier >(position))
{ return term1; }

vector<Expression*> operands;
vector<Binary_Expression::Type> operators;
while (lex< exactly<'+'> >() || lex< sequence< negate< number >, exactly<'-'> > >()) {
while (lex< exactly<'+'> >() || lex< sequence< negate< digits >, exactly<'-'> > >()) {
operators.push_back(lexed == "+" ? Binary_Expression::ADD : Binary_Expression::SUB);
operands.push_back(parse_term());
}
Expand Down

0 comments on commit 9087a77

Please sign in to comment.