From 0bfee5b7772338fd39bbf708d3e31ea7bcec859b Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 28 May 2021 12:44:44 +0200 Subject: Refactored loading and cache architecture --- src/exec/mod.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/exec/mod.rs') diff --git a/src/exec/mod.rs b/src/exec/mod.rs index b6765d1e..643d5b44 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -9,29 +9,18 @@ pub use state::*; use std::rc::Rc; use crate::diag::Pass; -use crate::env::Env; use crate::eval::{NodeMap, TemplateFunc, TemplateNode, TemplateValue, Value}; use crate::layout; use crate::pretty::pretty; use crate::syntax::*; -/// Execute a syntax tree to produce a layout tree. -/// -/// The `map` shall be a node map computed for this tree with -/// [`eval`](crate::eval::eval). Note that `tree` must be the _exact_ same tree -/// as used for evaluation (no cloned version), because the node map depends on -/// the pointers being stable. +/// Execute a template to produce a layout tree. /// /// The `state` is the base state that may be updated over the course of /// execution. -pub fn exec( - env: &mut Env, - tree: &Tree, - map: &NodeMap, - state: State, -) -> Pass { - let mut ctx = ExecContext::new(env, state); - tree.exec_with_map(&mut ctx, &map); +pub fn exec(template: &TemplateValue, state: State) -> Pass { + let mut ctx = ExecContext::new(state); + template.exec(&mut ctx); ctx.finish() } -- cgit v1.2.3