oak_liquid/language/
mod.rs1use oak_core::language::{Language, LanguageCategory};
5
6use crate::{ast::LiquidRoot, lexer::token_type::LiquidTokenType, parser::element_type::LiquidElementType};
7
8#[derive(Debug, Clone, PartialEq, Eq, Hash)]
10pub struct LiquidLanguage {
11 pub trim_blocks: bool,
13 pub lstrip_blocks: bool,
15 pub keep_trailing_newline: bool,
17 pub variable_start: String,
19 pub variable_end: String,
21 pub tag_start: String,
23 pub tag_end: String,
25 pub comment_start: String,
27 pub comment_end: String,
29}
30
31impl Default for LiquidLanguage {
32 fn default() -> Self {
33 Self {
34 trim_blocks: false,
35 lstrip_blocks: false,
36 keep_trailing_newline: false,
37 variable_start: "{{".to_string(),
38 variable_end: "}}".to_string(),
39 tag_start: "{%".to_string(),
40 tag_end: "%}".to_string(),
41 comment_start: "{#".to_string(),
42 comment_end: "#}".to_string(),
43 }
44 }
45}
46
47impl Language for LiquidLanguage {
48 const NAME: &'static str = "Liquid2";
49 const CATEGORY: LanguageCategory = LanguageCategory::Markup;
50
51 type TokenType = LiquidTokenType;
52 type ElementType = LiquidElementType;
53 type TypedRoot = LiquidRoot<'static>;
54}
55
56impl LiquidLanguage {
57 pub fn new() -> Self {
59 Self::default()
60 }
61}