File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
- # This should be doing css2 .1; hopefully CSS3 when that's ready (but that may be a while)
1
+ # This should be doing CSS2 .1; hopefully CSS3 when that's ready (but that may be a while)
2
2
3
3
grammar CSSGrammar {
4
4
# builtin: ident (we use cssident), alpha
@@ -39,8 +39,7 @@ grammar CSSGrammar {
39
39
token angle {:i <number > [ deg | rad | grad ] };
40
40
token time {:i <number > [ ms | s ] };
41
41
token freq {:i <number > k? hz };
42
- token string { ('"' | \') (<- [ \n\r\f\\" ] >| \\<nl >)* $0 };
43
- token nl { \n | \r\n | \r };
42
+ token string { ('"' | \') (<- [ \n ] >| \\ \n )*? $0 };
44
43
token uri { url '(' [ <string > | <url >] ')' };
45
44
token url { ( <- [ \( \) \' \" \\ ] > )* };
46
45
token FUNCTION { <cssident > '(' };
@@ -55,5 +54,11 @@ grammar CSSGrammar {
55
54
56
55
rule page {:i '@page' [':' <cssident >]? <declarations > }
57
56
57
+ # Comments and whitespace.
58
+ token comment {'<!--' .*? '-->' | '/*' .*? '*/' }
59
+ # override <ws> builtin. Note: \n matches a logical (platform
60
+ # independent) newline in Perl 6
61
+ token ws { <!ww > [ \n | "\t" | " " | <comment > ]* }
62
+
58
63
method panic ($ e ) {die $ e ;}
59
64
}
You can’t perform that action at this time.
0 commit comments