Rename all_instructions -> template_functions

This commit is contained in:
Olivier 'reivilibre' 2025-05-18 11:19:48 +01:00
parent 659f3a88e4
commit 5a115b3a20

View File

@ -173,7 +173,7 @@ impl<'a, LS> LoadedTemplates<LS> {
// TODO add support for running an `init` or `pre` fragment before running any fragment
// This would allow boilerplate `set` statements to be done ahead of time for example...
PreparedTemplate {
all_instructions: Arc::new(self.template_functions.clone()),
template_functions: Arc::new(self.template_functions.clone()),
entrypoint: if let Some(frag) = fragment_name {
format!("{template_name}__{frag}")
} else {
@ -188,8 +188,7 @@ impl<'a, LS> LoadedTemplates<LS> {
}
pub struct PreparedTemplate<LS> {
// TODO rename to `template_functions`
pub(crate) all_instructions: Arc<BTreeMap<String, Arc<TemplateFunction>>>,
pub(crate) template_functions: Arc<BTreeMap<String, Arc<TemplateFunction>>>,
pub(crate) methods: Arc<BTreeMap<String, TemplateAccessibleMethod>>,
pub(crate) entrypoint: String,
pub(crate) variables: Params,
@ -204,7 +203,7 @@ impl<LS: LocalisationSystem + Sync + Send> PreparedTemplate<LS> {
) -> Result<(), InterpreterError<LS::Error, O::Error>> {
let interpreter = Interpreter {
entrypoint: self.entrypoint,
program: &self.all_instructions,
program: &self.template_functions,
output,
localisation: self.localisation,
locale: self.locale,