From 40b87d4066fe85cb3fde6cf84cd60d748273ae25 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 7 Dec 2021 16:36:39 +0100 Subject: Set Rules Episode II: Attack of the properties --- src/lib.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 096995b7..62452655 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,13 +44,12 @@ pub mod library; pub mod loading; pub mod parse; pub mod source; -pub mod style; pub mod syntax; use std::rc::Rc; use crate::diag::TypResult; -use crate::eval::{Module, Scope}; +use crate::eval::{Module, Scope, Styles}; use crate::font::FontStore; use crate::frame::Frame; use crate::image::ImageStore; @@ -59,7 +58,6 @@ use crate::layout::{EvictionPolicy, LayoutCache}; use crate::library::DocumentNode; use crate::loading::Loader; use crate::source::{SourceId, SourceStore}; -use crate::style::Style; /// The core context which holds the loader, configuration and cached artifacts. pub struct Context { @@ -76,8 +74,8 @@ pub struct Context { pub layouts: LayoutCache, /// The standard library scope. std: Scope, - /// The default style. - style: Style, + /// The default styles. + styles: Styles, } impl Context { @@ -96,9 +94,9 @@ impl Context { &self.std } - /// A read-only reference to the style. - pub fn style(&self) -> &Style { - &self.style + /// A read-only reference to the styles. + pub fn styles(&self) -> &Styles { + &self.styles } /// Evaluate a source file and return the resulting module. @@ -136,7 +134,7 @@ impl Context { /// This struct is created by [`Context::builder`]. pub struct ContextBuilder { std: Option, - style: Option