Commit d64401f9 by Aaron Leung

Fixed a weird breakage caused by an accidentally commented line.

parent cb03bb0b
......@@ -373,6 +373,7 @@ namespace Sass {
if (lex< exactly<'('> >()) {
Node value(parse_list());
value.parenthesized = true;
lex< exactly<')'> >();
return value;
}
else {
......
$x: 1 2 3;
div {
a: 42 $x 43;
b: 1, 2 3, 4;
c: 1/2;
d: (10px/3em);
d: (10 / 5px);
}
/*div {
a: a, b, c, d;
b: a b, c d;
c: a (b, c) d;
e: $x;
f: 20px / 10;
g: (1 (9*2))/3;
h: (1/2 3/4 5/6);
i: 4 - (2) 3;
j: 3 + $x;
}
*/
\ No newline at end of file
a: b c d;
}
\ No newline at end of file
......@@ -110,7 +110,7 @@ namespace Sass {
} break;
default: {
// return string(token);
return string(token);
} break;
}
}
......
......@@ -140,6 +140,24 @@ namespace Sass {
const char* percentage(const char* src) {
return sequence< number, exactly<'%'> >(src);
}
extern const char em_kwd[] = "em";
extern const char ex_kwd[] = "ex";
extern const char px_kwd[] = "px";
extern const char cm_kwd[] = "cm";
extern const char mm_kwd[] = "mm";
extern const char in_kwd[] = "in";
extern const char pt_kwd[] = "pt";
extern const char pc_kwd[] = "pc";
extern const char deg_kwd[] = "deg";
extern const char rad_kwd[] = "rad";
extern const char grad_kwd[] = "grad";
extern const char ms_kwd[] = "ms";
extern const char s_kwd[] = "s";
extern const char Hz_kwd[] = "Hz";
extern const char kHz_kwd[] = "kHz";
const char* em(const char* src) {
return sequence< number, exactly<em_kwd> >(src);
}
const char* dimension(const char* src) {
return sequence<number, identifier>(src);
}
......@@ -157,6 +175,13 @@ namespace Sass {
optional<spaces>,
exactly<')'> >(src);
}
// Match CSS "!important" keyword.
extern const char important_kwd[] = "important";
const char* important(const char* src) {
return sequence< exactly<'!'>,
spaces_and_comments,
exactly<important_kwd> >(src);
}
// Match CSS pseudo-class/element prefixes.
const char* pseudo_prefix(const char* src) {
return sequence< exactly<':'>, optional< exactly<':'> > >(src);
......
......@@ -294,6 +294,8 @@ namespace Sass {
const char* hex(const char* src);
// Match CSS uri specifiers.
const char* uri(const char* src);
// Match CSS "!important" keyword.
const char* important(const char* src);
// Match CSS pseudo-class/element prefixes
const char* pseudo_prefix(const char* src);
// Match CSS function call openers.
......
......@@ -57,13 +57,15 @@ char nonbi1[] = "- n+2";
char fld1[] = "blah/bloo/foo.txt";
char fld2[] = "/bloo/blee";
char nonfld1[] = "blah.txt";
char imp1[] = "! /*hey*/ important;";
char nonimp1[] = "!imblah";
extern const char slash_star[] = "/*";
prelexer ptr = 0;
template <prelexer mx>
void try_and_set(char* src) {
char* p = mx(src);
const char* p = mx(src);
if (p) ptr = mx;
}
......@@ -108,6 +110,7 @@ int main() {
check_twice(folder, fld2, nonfld1);
check_twice(folders, fld1, nonfld1);
check_twice(folders, fld2, nonfld1);
check_twice(important, imp1, nonimp1);
cout << count_interval<'\n'>(ws1, spaces_and_comments(ws1)) << endl;
cout << count_interval<'*'>(ws1, spaces_and_comments(ws1)) << endl;
cout << count_interval<exactly<slash_star> >(ws1, spaces_and_comments(ws1)) << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment