From adb71ee040752f9348b0c9a511b2ab7e3710cb80 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 21 Jul 2021 20:35:02 +0200 Subject: Move and refactor --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 594b4a59..5c477248 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,7 +51,7 @@ pub mod util; use std::rc::Rc; use crate::diag::Pass; -use crate::eval::Scope; +use crate::eval::{ModuleCache, Scope}; use crate::exec::State; use crate::font::FontCache; use crate::image::ImageCache; @@ -68,6 +68,8 @@ pub struct Context { pub fonts: FontCache, /// Caches decoded images. pub images: ImageCache, + /// Caches evaluated modules. + pub modules: ModuleCache, /// Caches layouting artifacts. #[cfg(feature = "layout-cache")] pub layouts: LayoutCache, @@ -145,6 +147,7 @@ impl ContextBuilder { loader: Rc::clone(&loader), fonts: FontCache::new(Rc::clone(&loader)), images: ImageCache::new(loader), + modules: ModuleCache::new(), #[cfg(feature = "layout-cache")] layouts: LayoutCache::new(), std: self.std.unwrap_or(library::new()), -- cgit v1.2.3