Skip to content

Commit

Permalink
Merge pull request sass#1319 from xzyfer/fix/1307
Browse files Browse the repository at this point in the history
Fix parsing edge case for number units
  • Loading branch information
xzyfer committed Jul 8, 2015
2 parents 5f93d91 + 0939984 commit efd7b76
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,15 @@ namespace Sass {
bool nominator = true;
while (true) {
r = u.find_first_of("*/", l);
string unit(u.substr(l, r - l));
string unit(u.substr(l, r == string::npos ? r : r - l));
if (nominator) numerator_units_.push_back(unit);
else denominator_units_.push_back(unit);
if (u[r] == '/') nominator = false;
if (r == string::npos) break;
else l = r + 1;
// ToDo: should error for multiple slashes
// if (!nominator && u[r] == '/') error(...)
if (u[r] == '/')
nominator = false;
l = r + 1;
}
}
concrete_type(NUMBER);
Expand Down

0 comments on commit efd7b76

Please sign in to comment.