Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The term "unbounded" seems a bit strange to me too. At worst you only need to lookahead until the next ; or { to figure out if it's a property or a nested selector.

I guess that's unbounded because the parser can't know how much data it will have to buffer, but in practice we're talking like a few dozen bytes most of the time.



You could be parsing invalid syntax (forgot a } somewhere), and now your parser tries to nest EVERYTHING until it finds that matching curly brace or errors out at EOF.


IIRC there are easily reproducible pathological cases. The author of Sass said it was one of mistakes he made when creating Sass: he didn't require & for nesting everywhere.

Unfortunately, on mobile I can't quickly find the relevant links.


I don’t mind the & being required, I just don’t like the fact that there are 2 syntax options depending on whether & is at the start or not.

If the parsing problems are that difficult, I’d rather the @nest be always required.


The lookahead isn’t to the next bit of CSS syntax, it’s looking ahead to the next potential selector match in the DOM. If that can’t be resolved, you can’t unblock the CSS resolution to un-suspend the next blocked portion of the initial render




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: