-
-
Notifications
You must be signed in to change notification settings - Fork 495
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): allow multiple semicolons after declaration #4315
Conversation
cb7164e
to
4c88c33
Compare
4c88c33
to
3e8fe68
Compare
CodSpeed Performance ReportMerging #4315 will not alter performanceComparing Summary
|
3e8fe68
to
af67eaf
Compare
this mr is ready for review~ |
A couple of things:
|
ok, i will update the template later. i try to update the CssDeclarationWithSemicolon =
declaration: CssDeclaration
';'* But it will get an panic like: And I've looked elsewhere and haven't seen similar writing methods. So i refer the statement |
af67eaf
to
78f7231
Compare
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.
One thing missing, then we can merge it
#[inline] | ||
fn is_at_declaration_important(p: &mut CssParser) -> bool { | ||
p.at(T![!]) && p.nth_at(1, T![important]) | ||
} | ||
|
||
#[inline] | ||
pub(crate) fn is_at_declaration_semion(p: &mut CssParser) -> bool { |
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.
Is this a typo? What does "semion" mean?
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.
yes, a typo, semicolon
here, i will update later
pub(crate) struct FormatCssEmptyDeclaration; | ||
impl FormatNodeRule<CssEmptyDeclaration> for FormatCssEmptyDeclaration { | ||
fn fmt_fields(&self, node: &CssEmptyDeclaration, f: &mut CssFormatter) -> FormatResult<()> { | ||
format_verbatim_node(node.syntax()).fmt(f) |
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.
This must be implemented
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.
sorry, i forget here, i implement this method and add a test case for this at declaration.css
test file
78f7231
to
26e7fa8
Compare
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.
Amazing work @fireairforce, thank you very much for this contribution! ❤️
Summary
closes: #3836
I introduce a new syntax for css parser which named
CSS_EMPTY_DECLARATION
, you can see it at my change atcss.ungram
, theCSS_EMPTY_DECLARATION
just use to deal the multiple;
atCSS_DECLARATION_LIST
which like JS parser'sJS_EMPTY_STATEMENTS
:Test Plan
I add test case for
biome_css_parser
like:And update some test case of
biome_css_formatter
.