-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
feat(css-parser): CSS Parser: namespace at rule #1472
Conversation
✅ Deploy Preview for biomejs canceled.
|
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
CodSpeed Performance ReportMerging #1472 will degrade performances by 21.82%Falling back to comparing Summary
Benchmarks breakdown
|
// The problem is that both `url` and `src` are valid identifiers. | ||
parse_regular_identifier(p).ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping to figure out how to differentiate "function tokens" from identifiers soon, which the CSS spec defines as just <ident>(
with no spaces in between. It'll most likely be the same way that CSS_DIMENSION_VALUE
works now, where the lexer returns a special kind that can be converted to the actual kind (in this case, IDENT
).
I'd thought about making the parser not skip over whitespace, but i think that just makes all of the steps in the parser more complicated, while re-casting a token to a different kind is effectively free and makes checks incredibly fast, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, having function_tokens
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can go ahead and get started on that. I've got a good idea in mind already.
Summary
namespace
at rule.https://developer.mozilla.org/en-US/docs/Web/CSS/@namespace#specifications
Test Plan
cargo test