Skip to content

Commit

Permalink
feat(css-parser): CSS Parser: parse document at rule #1303 (#1535)
Browse files Browse the repository at this point in the history
  • Loading branch information
denbezrukov authored Jan 12, 2024
1 parent 7be126c commit e7fe085
Show file tree
Hide file tree
Showing 31 changed files with 2,060 additions and 11 deletions.
61 changes: 61 additions & 0 deletions crates/biome_css_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions crates/biome_css_factory/src/generated/syntax_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/any/at_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ impl FormatRule<AnyCssAtRule> for FormatAnyCssAtRule {
AnyCssAtRule::CssImportAtRule(node) => node.format().fmt(f),
AnyCssAtRule::CssNamespaceAtRule(node) => node.format().fmt(f),
AnyCssAtRule::CssStartingStyleAtRule(node) => node.format().fmt(f),
AnyCssAtRule::CssDocumentAtRule(node) => node.format().fmt(f),
AnyCssAtRule::CssBogusAtRule(node) => node.format().fmt(f),
}
}
Expand Down
16 changes: 16 additions & 0 deletions crates/biome_css_formatter/src/css/any/document_matcher.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! This is a generated file. Don't modify it by hand! Run 'cargo codegen formatter' to re-generate the file.
use crate::prelude::*;
use biome_css_syntax::AnyCssDocumentMatcher;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatAnyCssDocumentMatcher;
impl FormatRule<AnyCssDocumentMatcher> for FormatAnyCssDocumentMatcher {
type Context = CssFormatContext;
fn fmt(&self, node: &AnyCssDocumentMatcher, f: &mut CssFormatter) -> FormatResult<()> {
match node {
AnyCssDocumentMatcher::CssUrlFunction(node) => node.format().fmt(f),
AnyCssDocumentMatcher::CssDocumentCustomMatcher(node) => node.format().fmt(f),
AnyCssDocumentMatcher::CssBogusDocumentMatcher(node) => node.format().fmt(f),
}
}
}
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/any/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub(crate) mod declaration_list_block;
pub(crate) mod declaration_name;
pub(crate) mod declaration_or_at_rule;
pub(crate) mod dimension;
pub(crate) mod document_matcher;
pub(crate) mod expression;
pub(crate) mod function;
pub(crate) mod generic_component_value;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use crate::prelude::*;
use biome_css_syntax::CssDocumentCustomMatcher;
use biome_rowan::AstNode;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssDocumentCustomMatcher;
impl FormatNodeRule<CssDocumentCustomMatcher> for FormatCssDocumentCustomMatcher {
fn fmt_fields(
&self,
node: &CssDocumentCustomMatcher,
f: &mut CssFormatter,
) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub(crate) mod declaration_important;
pub(crate) mod declaration_list_block;
pub(crate) mod declaration_or_at_rule_block;
pub(crate) mod declaration_with_semicolon;
pub(crate) mod document_custom_matcher;
pub(crate) mod generic_delimiter;
pub(crate) mod import_anonymous_layer;
pub(crate) mod import_named_layer;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use crate::FormatBogusNodeRule;
use biome_css_syntax::CssBogusDocumentMatcher;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssBogusDocumentMatcher;
impl FormatBogusNodeRule<CssBogusDocumentMatcher> for FormatCssBogusDocumentMatcher {}
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/bogus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub(crate) mod bogus;
pub(crate) mod bogus_at_rule;
pub(crate) mod bogus_block;
pub(crate) mod bogus_declaration_item;
pub(crate) mod bogus_document_matcher;
pub(crate) mod bogus_keyframes_item;
pub(crate) mod bogus_layer;
pub(crate) mod bogus_media_query;
Expand Down
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/src/css/lists/document_matcher_list.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;
use biome_css_syntax::CssDocumentMatcherList;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssDocumentMatcherList;
impl FormatRule<CssDocumentMatcherList> for FormatCssDocumentMatcherList {
type Context = CssFormatContext;
fn fmt(&self, node: &CssDocumentMatcherList, f: &mut CssFormatter) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/lists/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub(crate) mod component_value_list;
pub(crate) mod compound_selector_list;
pub(crate) mod declaration_list;
pub(crate) mod declaration_or_at_rule_list;
pub(crate) mod document_matcher_list;
pub(crate) mod generic_component_value_list;
pub(crate) mod keyframes_item_list;
pub(crate) mod keyframes_selector_list;
Expand Down
10 changes: 10 additions & 0 deletions crates/biome_css_formatter/src/css/statements/document_at_rule.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::prelude::*;
use biome_css_syntax::CssDocumentAtRule;
use biome_rowan::AstNode;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatCssDocumentAtRule;
impl FormatNodeRule<CssDocumentAtRule> for FormatCssDocumentAtRule {
fn fmt_fields(&self, node: &CssDocumentAtRule, f: &mut CssFormatter) -> FormatResult<()> {
format_verbatim_node(node.syntax()).fmt(f)
}
}
1 change: 1 addition & 0 deletions crates/biome_css_formatter/src/css/statements/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub(crate) mod charset_at_rule;
pub(crate) mod color_profile_at_rule;
pub(crate) mod container_at_rule;
pub(crate) mod counter_style_at_rule;
pub(crate) mod document_at_rule;
pub(crate) mod font_face_at_rule;
pub(crate) mod font_palette_values_at_rule;
pub(crate) mod import_at_rule;
Expand Down
Loading

0 comments on commit e7fe085

Please sign in to comment.