One more little contribution to the useful PhpCss selector parser by Thomas Weinert. In this case, the regular expressions were greedily including combinators in pseudo-class literals, instead of seeing the end of the token.
Before: it saw
a:hover>span and errored, saying “there is no such pseudo-class as
After: it sees
a:hover>span and putters along happily with element
:hover, child combinator
>, and element
Students of programming should learn their history. At the very least, not be given an alternative, misrepresentation of history. As important as where you are going, is where you have been. Standing on the shoulders of giants and all that.
I have found the PhpCss library from Thomas Weinert very useful. I used it so much, I found a bug and fixed it. It’s nice that this library has unit tests so I could quickly create a new pattern and expected output, then make my little correction.
Typical programming mistake, a missing plus (+)!