use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
use mago_syntax::settings::LexerSettings;
use mago_syntax::settings::ParserSettings;
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
pub struct ParserConfiguration {
#[serde(default = "default_enable_short_tags")]
pub enable_short_tags: bool,
}
fn default_enable_short_tags() -> bool {
true
}
impl Default for ParserConfiguration {
fn default() -> Self {
Self { enable_short_tags: default_enable_short_tags() }
}
}
impl ParserConfiguration {
#[must_use]
pub fn to_settings(&self) -> ParserSettings {
ParserSettings { lexer: LexerSettings { enable_short_tags: self.enable_short_tags } }
}
}