raffia/
config.rs

1#[cfg(feature = "config_serde")]
2use serde::{Deserialize, Serialize};
3
4/// Supported syntax.
5#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
6#[cfg_attr(feature = "config_serde", derive(Serialize, Deserialize))]
7#[cfg_attr(feature = "config_serde", serde(rename_all = "camelCase"))]
8pub enum Syntax {
9    #[default]
10    Css,
11    Scss,
12    /// Indented Sass Syntax
13    Sass,
14    Less,
15}
16
17/// Parser options for customizing parser behaviors.
18#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
19#[cfg_attr(feature = "config_serde", derive(Serialize, Deserialize))]
20#[cfg_attr(feature = "config_serde", serde(rename_all = "camelCase"))]
21pub struct ParserOptions {
22    /// Enabling this will make parser attempt to parse
23    /// custom property value as normal declaration value instead of tokens.
24    /// It will fallback to parse as tokens if there're syntax errors
25    /// when parsing as values.
26    pub try_parsing_value_in_custom_property: bool,
27
28    /// If enabled, trailing semicolon of each statement will be treated
29    /// as recoverable errors, instead of raising a syntax error.
30    pub tolerate_semicolon_in_sass: bool,
31}