Closed hrj closed 8 years ago
Many thanks, merged. FYI, you may have noticed that some developers are (working)[https://github.com/radkovo/jStyleParser/network] on a migration of jStyleParser from ANTLRv3 to ANTLRv4. It seems to be almost done (all tests are passing) plan to merge their contributions during June. I believe this should improve the parser performance as well.
Oh nice! Wasn't aware of that work; thanks for the heads up.
Will it change the API? I am guessing (and hoping) it won't.
The API should not change.
When it reaches PR stage, I could run it through the css 2.1 test suite and check for regressions.
Consider an imported stylesheet that contains two adjacent
@charset
rules:The current code accepts the second
@charset
rule because the token-count is not incremented after the first@charset
rule. Since the parsing is restarted when a@charset
rule is processed and the new charset value differs from the previous value, the parser goes into an infinite loop.This change fixes this by ensuring that the token-count is incremented and hence, the second
@charset
rule is ignored.I have tested this change with
gngr
and the whole CSS2.1 test suite.