-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css_parser,css_formatter): start parsing exact properties and va…
…lues (#1419)
- Loading branch information
1 parent
bd88d8f
commit 86688e4
Showing
47 changed files
with
4,234 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
129 changes: 129 additions & 0 deletions
129
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.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
crates/biome_css_formatter/src/css/any/all_property_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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::AnyCssAllPropertyValue; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatAnyCssAllPropertyValue; | ||
impl FormatRule<AnyCssAllPropertyValue> for FormatAnyCssAllPropertyValue { | ||
type Context = CssFormatContext; | ||
fn fmt(&self, node: &AnyCssAllPropertyValue, f: &mut CssFormatter) -> FormatResult<()> { | ||
match node { | ||
AnyCssAllPropertyValue::CssWideKeyword(node) => node.format().fmt(f), | ||
AnyCssAllPropertyValue::CssUnknownPropertyValue(node) => node.format().fmt(f), | ||
AnyCssAllPropertyValue::CssBogusPropertyValue(node) => node.format().fmt(f), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
crates/biome_css_formatter/src/css/any/z_index_property_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//! 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::AnyCssZIndexPropertyValue; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatAnyCssZIndexPropertyValue; | ||
impl FormatRule<AnyCssZIndexPropertyValue> for FormatAnyCssZIndexPropertyValue { | ||
type Context = CssFormatContext; | ||
fn fmt(&self, node: &AnyCssZIndexPropertyValue, f: &mut CssFormatter) -> FormatResult<()> { | ||
match node { | ||
AnyCssZIndexPropertyValue::CssAuto(node) => node.format().fmt(f), | ||
AnyCssZIndexPropertyValue::CssNumber(node) => node.format().fmt(f), | ||
AnyCssZIndexPropertyValue::CssWideKeyword(node) => node.format().fmt(f), | ||
AnyCssZIndexPropertyValue::CssUnknownPropertyValue(node) => node.format().fmt(f), | ||
AnyCssZIndexPropertyValue::CssBogusPropertyValue(node) => node.format().fmt(f), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssAuto, CssAutoFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssAuto; | ||
impl FormatNodeRule<CssAuto> for FormatCssAuto { | ||
fn fmt_fields(&self, node: &CssAuto, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssAutoFields { value_token } = node.as_fields(); | ||
|
||
write!(f, [value_token.format()]) | ||
} | ||
} |
9 changes: 6 additions & 3 deletions
9
crates/biome_css_formatter/src/css/auxiliary/generic_delimiter.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::CssGenericDelimiter; | ||
use biome_rowan::AstNode; | ||
use biome_css_syntax::{CssGenericDelimiter, CssGenericDelimiterFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssGenericDelimiter; | ||
impl FormatNodeRule<CssGenericDelimiter> for FormatCssGenericDelimiter { | ||
fn fmt_fields(&self, node: &CssGenericDelimiter, f: &mut CssFormatter) -> FormatResult<()> { | ||
format_verbatim_node(node.syntax()).fmt(f) | ||
let CssGenericDelimiterFields { value } = node.as_fields(); | ||
|
||
write!(f, [value.format()]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
crates/biome_css_formatter/src/css/auxiliary/unknown_property_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssUnknownPropertyValue, CssUnknownPropertyValueFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssUnknownPropertyValue; | ||
impl FormatNodeRule<CssUnknownPropertyValue> for FormatCssUnknownPropertyValue { | ||
fn fmt_fields(&self, node: &CssUnknownPropertyValue, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssUnknownPropertyValueFields { | ||
css_generic_component_value_list, | ||
} = node.as_fields(); | ||
|
||
write!(f, [css_generic_component_value_list.format()]) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
crates/biome_css_formatter/src/css/auxiliary/wide_keyword.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::prelude::*; | ||
use biome_css_syntax::{CssWideKeyword, CssWideKeywordFields}; | ||
use biome_formatter::write; | ||
|
||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssWideKeyword; | ||
impl FormatNodeRule<CssWideKeyword> for FormatCssWideKeyword { | ||
fn fmt_fields(&self, node: &CssWideKeyword, f: &mut CssFormatter) -> FormatResult<()> { | ||
let CssWideKeywordFields { value } = node.as_fields(); | ||
|
||
write!(f, [value.format()]) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/biome_css_formatter/src/css/bogus/bogus_property_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::FormatBogusNodeRule; | ||
use biome_css_syntax::CssBogusPropertyValue; | ||
#[derive(Debug, Clone, Default)] | ||
pub(crate) struct FormatCssBogusPropertyValue; | ||
impl FormatBogusNodeRule<CssBogusPropertyValue> for FormatCssBogusPropertyValue {} |
Oops, something went wrong.