Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-selectors] Error in the defintion of V in the lexical scanner section? #6955

Open
KommuSoft opened this issue Jan 15, 2022 · 2 comments

Comments

@KommuSoft
Copy link

On the Lexical Scanner section of the documentation on the Selectors Level 3, the lexer defines V as:

V         v|\\0{0,4}(58|78)(\r\n|[ \t\r\n\f])?|\\v

I'm wondering why it uses 58 or 78. Based on the other items, this is to specify the character in its hexadecimal form, but the hexadecimal form of the ASCII V is 0x56 (or 0x76 for lowercase), not 0x58 (this is the ASCII code for X). Therefore shouldn't V be defined as:

V         v|\\0{0,4}(56|76)(\r\n|[ \t\r\n\f])?|\\v

or am I missing something?

@tabatkins
Copy link
Member

Likely, but the grammar section of Selectors has been completely replaced in later levels and probably isn't worth maintaining; we no longer define our grammars in that form. Instead they're defined with the Rule Definition Syntax from the Syntax spec, like https://drafts.csswg.org/selectors/#grammar

Out of curiosity, why are you looking at Selectors 3?

@KommuSoft
Copy link
Author

Out of curiosity, why are you looking at Selectors 3?

@tabatkins : I made a parser that validates a css-selectors-3 at compile time: https://github.com/hapytex/css-selectors
In the future I will try to support selectors-4, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants