Skip to content

Commit ce9d015

Browse files
committed
Merge branch 'master' into str_len_func
2 parents 4a2ab7b + 983aa9e commit ce9d015

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

constants.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,22 @@ namespace Sass {
5454
extern const char vendor_khtml_kwd[] = "-khtml-";
5555

5656
// css functions and keywords
57-
extern const char charset_kwd[] = "@charset";
58-
extern const char media_kwd[] = "@media";
59-
extern const char keyframes_kwd[] = "keyframes";
60-
extern const char only_kwd[] = "only";
61-
extern const char rgb_kwd[] = "rgb(";
62-
extern const char url_kwd[] = "url(";
63-
extern const char image_url_kwd[] = "image-url(";
64-
extern const char important_kwd[] = "important";
65-
extern const char pseudo_not_kwd[] = ":not(";
66-
extern const char even_kwd[] = "even";
67-
extern const char odd_kwd[] = "odd";
68-
extern const char progid_kwd[] = "progid";
69-
extern const char expression_kwd[] = "expression";
70-
extern const char calc_kwd[] = "calc(";
57+
extern const char charset_kwd[] = "@charset";
58+
extern const char media_kwd[] = "@media";
59+
extern const char keyframes_kwd[] = "keyframes";
60+
extern const char only_kwd[] = "only";
61+
extern const char rgb_kwd[] = "rgb(";
62+
extern const char url_kwd[] = "url(";
63+
extern const char image_url_kwd[] = "image-url(";
64+
extern const char important_kwd[] = "important";
65+
extern const char pseudo_not_kwd[] = ":not(";
66+
extern const char even_kwd[] = "even";
67+
extern const char odd_kwd[] = "odd";
68+
extern const char progid_kwd[] = "progid";
69+
extern const char expression_kwd[] = "expression";
70+
extern const char calc_kwd[] = "calc(";
71+
extern const char moz_calc_kwd[] = "-moz-calc(";
72+
extern const char webkit_calc_kwd[] = "-webkit-calc(";
7173

7274
// css attribute-matching operators
7375
extern const char tilde_equal[] = "~=";

constants.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ namespace Sass {
6868
extern const char progid_kwd[];
6969
extern const char expression_kwd[];
7070
extern const char calc_kwd[];
71+
extern const char moz_calc_kwd[];
72+
extern const char webkit_calc_kwd[];
7173

7274
// css attribute-matching operators
7375
extern const char tilde_equal[];

eval.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ namespace Sass {
477477
Expression* Eval::operator()(String_Schema* s)
478478
{
479479
string acc;
480-
To_String to_string(&ctx);
480+
To_String to_string(0);
481481
for (size_t i = 0, L = s->length(); i < L; ++i) {
482482
string chunk((*s)[i]->perform(this)->perform(&to_string));
483483
if (((s->quote_mark() && is_quoted(chunk)) || !s->quote_mark()) && (*s)[i]->is_interpolant()) { // some redundancy in that test

parser.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,9 @@ namespace Sass {
916916
}
917917
return kwd_arg;
918918
}
919-
else if (peek< exactly<calc_kwd> >()) {
919+
else if (peek< exactly< calc_kwd > >() ||
920+
peek< exactly< moz_calc_kwd > >() ||
921+
peek< exactly< webkit_calc_kwd > >()) {
920922
return parse_calc_function();
921923
}
922924
else if (peek< functional_schema >()) {
@@ -1469,6 +1471,7 @@ namespace Sass {
14691471
{
14701472
const char* p = start ? start : position;
14711473
const char* q;
1474+
bool saw_stuff = false;
14721475
bool saw_interpolant = false;
14731476

14741477
while ((q = peek< identifier >(p)) ||
@@ -1508,12 +1511,13 @@ namespace Sass {
15081511
(q = peek< sequence< exactly<'-'>, interpolant > >(p)) ||
15091512
(q = peek< sequence< pseudo_prefix, interpolant > >(p)) ||
15101513
(q = peek< interpolant >(p))) {
1514+
saw_stuff = true;
15111515
p = q;
15121516
if (*(p - 1) == '}') saw_interpolant = true;
15131517
}
15141518

15151519
Selector_Lookahead result;
1516-
result.found = peek< exactly<'{'> >(p) ? p : 0;
1520+
result.found = saw_stuff && peek< exactly<'{'> >(p) ? p : 0;
15171521
result.has_interpolants = saw_interpolant;
15181522

15191523
return result;

0 commit comments

Comments
 (0)