mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 20:35:20 +00:00
dev: make eval compat (#1269)
* fix: compile when preview feature is disabled * build: update cargo.lock * old * old * old * back
This commit is contained in:
parent
5b2b34ee9e
commit
d0188a768e
12 changed files with 68 additions and 28 deletions
|
|
@ -14,12 +14,11 @@ use tinymist_std::hash::{hash128, FxDashMap};
|
|||
use tinymist_world::vfs::{PathResolution, WorkspaceResolver};
|
||||
use tinymist_world::{EntryReader, DETACHED_ENTRY};
|
||||
use typst::diag::{eco_format, At, FileError, FileResult, SourceResult, StrResult};
|
||||
use typst::engine::{Route, Sink, Traced};
|
||||
use typst::eval::Eval;
|
||||
use typst::foundations::{Bytes, Module, Styles};
|
||||
use typst::layout::Position;
|
||||
use typst::syntax::package::{PackageManifest, PackageSpec};
|
||||
use typst::syntax::{Span, VirtualPath};
|
||||
use typst_shim::eval::{eval_compat, Eval};
|
||||
|
||||
use crate::adt::revision::{RevisionLock, RevisionManager, RevisionManagerLike, RevisionSlot};
|
||||
use crate::analysis::prelude::*;
|
||||
|
|
@ -401,7 +400,7 @@ impl LocalContext {
|
|||
self.shared_().preload_package(entry_point);
|
||||
}
|
||||
|
||||
pub(crate) fn with_vm<T>(&self, f: impl FnOnce(&mut typst::eval::Vm) -> T) -> T {
|
||||
pub(crate) fn with_vm<T>(&self, f: impl FnOnce(&mut typst_shim::eval::Vm) -> T) -> T {
|
||||
crate::upstream::with_vm((self.world() as &dyn World).track(), f)
|
||||
}
|
||||
|
||||
|
|
@ -671,17 +670,7 @@ impl SharedContext {
|
|||
|
||||
/// Get (Create) a module by source.
|
||||
pub fn module_by_src(&self, source: Source) -> SourceResult<Module> {
|
||||
let route = Route::default();
|
||||
let traced = Traced::default();
|
||||
let mut sink = Sink::default();
|
||||
|
||||
typst::eval::eval(
|
||||
((&self.world) as &dyn World).track(),
|
||||
traced.track(),
|
||||
sink.track_mut(),
|
||||
route.track(),
|
||||
&source,
|
||||
)
|
||||
eval_compat(&self.world, &source)
|
||||
}
|
||||
|
||||
/// Try to load a module from the current source file.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue