Skip to content

Commit

Permalink
fix(css_parser): fix Constant crashes when editing css files #3256
Browse files Browse the repository at this point in the history
  • Loading branch information
denbezrukov committed Jun 22, 2024
1 parent 356f459 commit c645bd7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions crates/biome_css_parser/src/syntax/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::parser::CssParser;
use crate::syntax::at_rule::{is_at_at_rule, parse_at_rule};
use crate::syntax::block::parse_declaration_or_rule_list_block;
use crate::syntax::parse_error::{expected_any_rule, expected_non_css_wide_keyword_identifier};
use crate::syntax::property::color::{is_at_color, parse_color};
use crate::syntax::property::unicode_range::{is_at_unicode_range, parse_unicode_range};
use crate::syntax::property::{is_at_any_property, parse_any_property};
use crate::syntax::selector::is_nth_at_selector;
Expand All @@ -24,10 +25,8 @@ use biome_parser::parse_recovery::{ParseRecovery, ParseRecoveryTokenSet, Recover
use biome_parser::prelude::ParsedSyntax;
use biome_parser::prelude::ParsedSyntax::{Absent, Present};
use biome_parser::{token_set, Parser};
use biome_parser::diagnostic::expected_token;
use value::dimension::{is_at_any_dimension, parse_any_dimension};
use value::function::{is_at_any_function, parse_any_function};
use crate::syntax::property::color::{is_at_color, parse_color};

use self::parse_error::{expected_component_value, expected_declaration_item};

Expand Down
6 changes: 3 additions & 3 deletions crates/biome_css_parser/src/syntax/property/color.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::lexer::CssLexContext;
use crate::parser::CssParser;
use biome_css_syntax::CssSyntaxKind::{CSS_COLOR, CSS_COLOR_LITERAL};
use biome_css_syntax::{T, TextRange};
use biome_css_syntax::{TextRange, T};
use biome_parser::diagnostic::{expected_node, ParseDiagnostic};
use biome_parser::parsed_syntax::ParsedSyntax;
use biome_parser::parsed_syntax::ParsedSyntax::{Absent, Present};
use biome_parser::Parser;
use crate::lexer::CssLexContext;
use crate::parser::CssParser;

#[inline]
pub(crate) fn is_at_color(p: &mut CssParser) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_css_parser/src/syntax/property/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub(crate) mod unicode_range;
pub(crate) mod color;
pub(crate) mod unicode_range;

use crate::lexer::CssLexContext;
use crate::parser::CssParser;
Expand Down

0 comments on commit c645bd7

Please sign in to comment.