diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-25 14:13:01 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-25 14:56:37 +0200 |
| commit | 30fdba4356683198a298eebb44e28cb8c191a0e1 (patch) | |
| tree | 3c702ca8ecd3240b25bb3bee9cc26e3b608baef0 /src/lib.rs | |
| parent | c010cbc17dcbb2f0d6005d21530143bf57cb5871 (diff) | |
Move deps from context to VM
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -76,30 +76,27 @@ pub fn typeset(ctx: &mut Context, id: SourceId) -> TypResult<Vec<Arc<Frame>>> { /// The core context which holds the configuration and stores. pub struct Context { + /// The context's configuration. + pub config: Config, /// Stores loaded source files. pub sources: SourceStore, /// Stores parsed font faces. pub fonts: FontStore, /// Stores decoded images. pub images: ImageStore, - /// The context's configuration. - pub config: Config, - /// Cached modules. - modules: HashMap<SourceId, Module>, - /// The dependencies of the current evaluation process. - deps: Vec<(SourceId, usize)>, + /// Stores evaluated modules. + pub modules: HashMap<SourceId, Module>, } impl Context { /// Create a new context. pub fn new(loader: Arc<dyn Loader>, config: Config) -> Self { Self { + config, sources: SourceStore::new(Arc::clone(&loader)), fonts: FontStore::new(Arc::clone(&loader)), images: ImageStore::new(loader), - config, modules: HashMap::new(), - deps: vec![], } } } |
