amn / csspring

A CSS parsing library
GNU General Public License v3.0
1 stars 0 forks source link

`QualifiedRule.selector_list` partially broken #10

Closed amn closed 1 month ago

amn commented 1 month ago

Unfortunately, the QualifiedRule.selector_list accessor property getter at

https://github.com/amn/csspring/blob/5e0e19339061ad376619e8ec7a18c7bcc913d31a/src/csspring/__init__.py#L10-L11

is broken for some prelude values, specifically those containing component values and not just tokens. The prelude must be "flattened", with e.g. tokens, in order to even be usable to normalize_input and subsequently being turned to a token stream for parsing [as a selector list].

MyPy should have uncovered this issue, but there's no type hinting in the initialization module, another omission hiding an issue.

amn commented 1 month ago

Fixed with commit fde1a78466b023dc3ebd001750a7fc036f165e48.