From 753e59eaa0574b561a52627c4d1f88f50c845847 Mon Sep 17 00:00:00 2001 From: frozolotl <44589151+frozolotl@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:53:10 +0100 Subject: [PATCH] Make `Vm` attributes more public (#5148) Co-authored-by: Laurenz --- crates/typst-eval/src/flow.rs | 2 +- crates/typst-eval/src/lib.rs | 8 ++++---- crates/typst-eval/src/vm.rs | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/typst-eval/src/flow.rs b/crates/typst-eval/src/flow.rs index 5c9d2a006..231e68998 100644 --- a/crates/typst-eval/src/flow.rs +++ b/crates/typst-eval/src/flow.rs @@ -11,7 +11,7 @@ const MAX_ITERATIONS: usize = 10_000; /// A control flow event that occurred during evaluation. #[derive(Debug, Clone, PartialEq)] -pub(crate) enum FlowEvent { +pub enum FlowEvent { /// Stop iteration in a loop. Break(Span), /// Skip the remainder of the current iteration in a loop. diff --git a/crates/typst-eval/src/lib.rs b/crates/typst-eval/src/lib.rs index a5c0c7e30..69c20e8cc 100644 --- a/crates/typst-eval/src/lib.rs +++ b/crates/typst-eval/src/lib.rs @@ -14,14 +14,14 @@ mod methods; mod rules; mod vm; -pub use self::call::*; -pub use self::import::*; -pub use self::vm::*; +pub use self::call::{eval_closure, CapturesVisitor}; +pub use self::flow::FlowEvent; +pub use self::import::import; +pub use self::vm::Vm; pub use typst_library::routines::EvalMode; use self::access::*; use self::binding::*; -use self::flow::*; use self::methods::*; use comemo::{Track, Tracked, TrackedMut}; diff --git a/crates/typst-eval/src/vm.rs b/crates/typst-eval/src/vm.rs index adf7dd762..a5cbb6fa0 100644 --- a/crates/typst-eval/src/vm.rs +++ b/crates/typst-eval/src/vm.rs @@ -14,15 +14,15 @@ use crate::FlowEvent; /// new virtual machine is created for each module evaluation and function call. pub struct Vm<'a> { /// The underlying virtual typesetter. - pub(crate) engine: Engine<'a>, + pub engine: Engine<'a>, /// A control flow event that is currently happening. - pub(crate) flow: Option, + pub flow: Option, /// The stack of scopes. - pub(crate) scopes: Scopes<'a>, + pub scopes: Scopes<'a>, /// A span that is currently under inspection. - pub(crate) inspected: Option, + pub inspected: Option, /// Data that is contextually made accessible to code behind the scenes. - pub(crate) context: Tracked<'a, Context<'a>>, + pub context: Tracked<'a, Context<'a>>, } impl<'a> Vm<'a> {