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