Skip to main content

Interpreter

Struct Interpreter 

Source
pub struct Interpreter<'a> {
    pub output: Vec<String>,
    /* private fields */
}

Fields§

§output: Vec<String>

The program’s output lines. Public API consumed by ui_bridge.

Implementations§

Source§

impl<'a> Interpreter<'a>

Source

pub fn new(interner: &'a Interner) -> Self

Source

pub fn with_program_args(self, args: Vec<String>) -> Self

Supply the program arguments read by the args() system native. The vector is the full argv (index 0 is the program name), matching the compiled binary’s env::args().

Source

pub fn with_vfs(self, vfs: Arc<dyn Vfs>) -> Self

Phase 55: Set the VFS for file operations.

Source

pub fn with_kernel(self, ctx: Arc<Context>) -> Self

Phase 102: Set the kernel context for inductive type support.

When set, the interpreter can query the kernel for inductive types and constructors, enabling unified type system.

Source

pub fn with_policies(self, registry: PolicyRegistry) -> Self

Set the policy registry for security checks.

Source

pub fn with_type_registry(self, registry: &TypeRegistry) -> Self

Populate struct_defs from a TypeRegistry (DiscoveryPass results). This allows the interpreter to initialize default field values for structs created with new Point (no explicit fields).

Source

pub fn with_output_callback(self, callback: OutputCallback) -> Self

Set a callback for streaming output. The callback is called each time Show executes, with the output line.

Source

pub fn is_kernel_inductive(&self, name: &str) -> bool

Phase 102: Check if a name is a kernel inductive type.

Source

pub fn get_kernel_constructors(&self, name: &str) -> Vec<(String, usize)>

Phase 102: Get constructors for a kernel inductive type.

Returns a vector of (constructor_name, arity) pairs.

Source

pub async fn run(&mut self, stmts: &[Stmt<'a>]) -> Result<(), String>

Execute a program (list of statements). Phase 55: Now async for VFS operations.

Source

pub fn values_equal_pub( &self, left: &RuntimeValue, right: &RuntimeValue, ) -> bool

Source

pub fn global_bindings(&self) -> Vec<(String, String, String)>

The program’s global bindings after execution, as sorted (name, type, value) rows — the substrate for the REPL’s :vars inspection (see crate::repl::ReplSession::vars).

Source

pub fn run_sync(&mut self, stmts: &[Stmt<'a>]) -> Result<(), String>

Execute a program synchronously (no async/Future allocation). Use when needs_async(stmts) returns false.

Auto Trait Implementations§

§

impl<'a> Freeze for Interpreter<'a>

§

impl<'a> !RefUnwindSafe for Interpreter<'a>

§

impl<'a> !Send for Interpreter<'a>

§

impl<'a> !Sync for Interpreter<'a>

§

impl<'a> Unpin for Interpreter<'a>

§

impl<'a> UnsafeUnpin for Interpreter<'a>

§

impl<'a> !UnwindSafe for Interpreter<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,