#![doc = include_str!("readme.md")]
use crate::ast::DjangoRoot;
use oak_core::{Language, LanguageCategory};
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct DjangoLanguage {
pub strict_mode: bool,
pub allow_custom_tags: bool,
pub variable_start: String,
pub variable_end: String,
pub tag_start: String,
pub tag_end: String,
pub comment_start: String,
pub comment_end: String,
}
impl DjangoLanguage {
pub fn new() -> Self {
Self::default()
}
}
impl Default for DjangoLanguage {
fn default() -> Self {
Self { strict_mode: false, allow_custom_tags: true, variable_start: "{{".to_string(), variable_end: "}}".to_string(), tag_start: "{%".to_string(), tag_end: "%}".to_string(), comment_start: "{#".to_string(), comment_end: "#}".to_string() }
}
}
impl Language for DjangoLanguage {
const NAME: &'static str = "django";
const CATEGORY: LanguageCategory = LanguageCategory::Programming;
type TokenType = crate::lexer::token_type::DjangoTokenType;
type ElementType = crate::parser::element_type::DjangoElementType;
type TypedRoot = DjangoRoot;
}