mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Make Vm
attributes more public (#5148)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
parent
1261d176b0
commit
753e59eaa0
@ -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.
|
||||||
|
@ -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};
|
||||||
|
@ -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> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user