Make Vm attributes more public (#5148)

Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
frozolotl 2024-10-31 19:53:10 +01:00 committed by GitHub
parent 1261d176b0
commit 753e59eaa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 10 deletions

View File

@ -11,7 +11,7 @@ const MAX_ITERATIONS: usize = 10_000;
/// A control flow event that occurred during evaluation. /// A control flow event that occurred during evaluation.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub(crate) enum FlowEvent { pub enum FlowEvent {
/// Stop iteration in a loop. /// Stop iteration in a loop.
Break(Span), Break(Span),
/// Skip the remainder of the current iteration in a loop. /// Skip the remainder of the current iteration in a loop.

View File

@ -14,14 +14,14 @@ mod methods;
mod rules; mod rules;
mod vm; mod vm;
pub use self::call::*; pub use self::call::{eval_closure, CapturesVisitor};
pub use self::import::*; pub use self::flow::FlowEvent;
pub use self::vm::*; pub use self::import::import;
pub use self::vm::Vm;
pub use typst_library::routines::EvalMode; pub use typst_library::routines::EvalMode;
use self::access::*; use self::access::*;
use self::binding::*; use self::binding::*;
use self::flow::*;
use self::methods::*; use self::methods::*;
use comemo::{Track, Tracked, TrackedMut}; use comemo::{Track, Tracked, TrackedMut};

View File

@ -14,15 +14,15 @@ use crate::FlowEvent;
/// new virtual machine is created for each module evaluation and function call. /// new virtual machine is created for each module evaluation and function call.
pub struct Vm<'a> { pub struct Vm<'a> {
/// The underlying virtual typesetter. /// The underlying virtual typesetter.
pub(crate) engine: Engine<'a>, pub engine: Engine<'a>,
/// A control flow event that is currently happening. /// A control flow event that is currently happening.
pub(crate) flow: Option<FlowEvent>, pub flow: Option<FlowEvent>,
/// The stack of scopes. /// The stack of scopes.
pub(crate) scopes: Scopes<'a>, pub scopes: Scopes<'a>,
/// A span that is currently under inspection. /// A span that is currently under inspection.
pub(crate) inspected: Option<Span>, pub inspected: Option<Span>,
/// Data that is contextually made accessible to code behind the scenes. /// 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> { impl<'a> Vm<'a> {