Skip to content

Commit efd7b76

Browse files
committed
Merge pull request #1319 from xzyfer/fix/1307
Fix parsing edge case for number units
2 parents 5f93d91 + 0939984 commit efd7b76

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ast.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,12 +668,15 @@ namespace Sass {
668668
bool nominator = true;
669669
while (true) {
670670
r = u.find_first_of("*/", l);
671-
string unit(u.substr(l, r - l));
671+
string unit(u.substr(l, r == string::npos ? r : r - l));
672672
if (nominator) numerator_units_.push_back(unit);
673673
else denominator_units_.push_back(unit);
674-
if (u[r] == '/') nominator = false;
675674
if (r == string::npos) break;
676-
else l = r + 1;
675+
// ToDo: should error for multiple slashes
676+
// if (!nominator && u[r] == '/') error(...)
677+
if (u[r] == '/')
678+
nominator = false;
679+
l = r + 1;
677680
}
678681
}
679682
concrete_type(NUMBER);

0 commit comments

Comments
 (0)