Skip to content

Commit

Permalink
Merge pull request sass#1111 from xzyfer/fix/ie-hack-regression
Browse files Browse the repository at this point in the history
Fixes a regression in handling common IE property hacks
  • Loading branch information
xzyfer committed Apr 26, 2015
2 parents a140623 + 925220c commit 73979ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,8 @@ namespace Sass {
Token str(lexed);
--str.end;
--position;
String_Constant* str_node = new (ctx.mem) String_Constant(pstate, str);

String_Constant* str_node = new (ctx.mem) String_Constant(pstate, str.time_wspace());
// str_node->is_delayed(true);
return str_node;
}
Expand Down
5 changes: 5 additions & 0 deletions position.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ namespace Sass {
size_t length() const { return end - begin; }
string ws_before() const { return string(prefix, begin); }
string to_string() const { return string(begin, end); }
string time_wspace() const {
string str(to_string());
string whitespaces(" \t\f\v\n\r");
return str.erase(str.find_last_not_of(whitespaces)+1);
}

operator bool() { return begin && end && begin >= end; }
operator string() { return to_string(); }
Expand Down
6 changes: 5 additions & 1 deletion prelexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,10 @@ namespace Sass {
}

const char* static_value(const char* src) {
return sequence< static_component,
return sequence< sequence<
static_component,
zero_plus< identifier >
>,
zero_plus < sequence<
alternatives<
sequence< optional_spaces, alternatives<
Expand All @@ -722,6 +725,7 @@ namespace Sass {
>,
static_component
> >,
optional_css_whitespace,
alternatives< exactly<';'>, exactly<'}'> >
>(src);
}
Expand Down

0 comments on commit 73979ff

Please sign in to comment.