use std::sync::Arc;
use crate::IEngineConfiguration;
use crate::TemplateMode;
use crate::engine::ITemplateHandler;
use crate::exceptions::TemplateInputException;
use crate::templateresource::ITemplateResource;
use crate::util::Utf16String;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum TemplateParserError {
#[error("{message}")]
IllegalArgument {
message: String,
},
#[error(transparent)]
Input(#[from] TemplateInputException),
}
pub trait ITemplateParser: Send + Sync {
#[allow(clippy::too_many_arguments)]
fn parse_standalone(
&self,
configuration: Arc<dyn IEngineConfiguration>,
owner_template: Option<&Utf16String>,
template: &Utf16String,
template_selectors: Option<&[Utf16String]>,
resource: Arc<dyn ITemplateResource>,
template_mode: TemplateMode,
use_decoupled_logic: bool,
handler: Box<dyn ITemplateHandler>,
) -> Result<(), TemplateParserError>;
#[allow(clippy::too_many_arguments)]
fn parse_string(
&self,
configuration: Arc<dyn IEngineConfiguration>,
owner_template: &Utf16String,
template: &Utf16String,
line_offset: i32,
col_offset: i32,
template_mode: TemplateMode,
handler: Box<dyn ITemplateHandler>,
) -> Result<(), TemplateParserError>;
}