From 470f8001a1dba0022ec9d3e46c67c3bbc31359be Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 30 Jun 2021 11:40:27 +0200 Subject: No more collisions between syntax::Tree and layout::Tree --- src/exec/context.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/exec/context.rs') diff --git a/src/exec/context.rs b/src/exec/context.rs index 3994fdb9..0f6d47f5 100644 --- a/src/exec/context.rs +++ b/src/exec/context.rs @@ -6,9 +6,9 @@ use crate::diag::{Diag, DiagSet, Pass}; use crate::eval::{ExprMap, TemplateValue}; use crate::geom::{Align, Dir, Gen, GenAxis, Length, Linear, Sides, Size}; use crate::layout::{ - AnyNode, PadNode, PageRun, ParChild, ParNode, StackChild, StackNode, Tree, + AnyNode, LayoutTree, PadNode, PageRun, ParChild, ParNode, StackChild, StackNode, }; -use crate::syntax::{self, Span}; +use crate::syntax::{Span, SyntaxTree}; /// The context for execution. pub struct ExecContext { @@ -17,7 +17,7 @@ pub struct ExecContext { /// Execution diagnostics. pub diags: DiagSet, /// The tree of finished page runs. - tree: Tree, + tree: LayoutTree, /// When we are building the top-level stack, this contains metrics of the /// page. While building a group stack through `exec_group`, this is `None`. page: Option, @@ -30,7 +30,7 @@ impl ExecContext { pub fn new(state: State) -> Self { Self { diags: DiagSet::new(), - tree: Tree { runs: vec![] }, + tree: LayoutTree { runs: vec![] }, page: Some(PageBuilder::new(&state, true)), stack: StackBuilder::new(&state), state, @@ -56,8 +56,8 @@ impl ExecContext { self.exec_stack(|ctx| template.exec(ctx)) } - /// Execute a tree with a map and return the result as a stack node. - pub fn exec_tree_stack(&mut self, tree: &syntax::Tree, map: &ExprMap) -> StackNode { + /// Execute a syntax tree with a map and return the result as a stack node. + pub fn exec_tree_stack(&mut self, tree: &SyntaxTree, map: &ExprMap) -> StackNode { self.exec_stack(|ctx| tree.exec_with_map(ctx, map)) } @@ -137,7 +137,7 @@ impl ExecContext { } /// Finish execution and return the created layout tree. - pub fn finish(mut self) -> Pass { + pub fn finish(mut self) -> Pass { assert!(self.page.is_some()); self.pagebreak(true, false, Span::default()); Pass::new(self.tree, self.diags) -- cgit v1.2.3