Fixed a problem parsing CSS comments

-- The WS rule was incorrect, so two WHITESPACE tokens in a row wouldn't
work.
pull/120/head
Ian Prest 9 years ago
parent e4d2cf4537
commit accec31c4e

@ -186,7 +186,6 @@ unquoted_attribute_value_char
WS
: /*empty*/ { $$ = ''; }
| WHITESPACE { $$ = ''; }
| ws WHITESPACE { $$ = ''; }
| WHITESPACE+ { $$ = ''; }
;

@ -116,5 +116,10 @@ describe('css parser', function() {
expect(css.parse('@foo { nested { arbitrary-stuff; } here(); }')).toEqual([ {name: '@foo', content: "nested { arbitrary-stuff; } here();"} ]);
});
it('should ignore CSS comments', function() {
expect(css.parse('/*foo*/\n')).toEqual([]);
expect(css.parse('/*foo*/foo{}')).toEqual([ {selector: ["foo"]} ]);
expect(css.parse('foo{}/*foo*/')).toEqual([ {selector: ["foo"]} ]);
});
});

Loading…
Cancel
Save