Struct endbasic_core::exec::Machine[][src]

pub struct Machine { /* fields omitted */ }
Expand description

Executes an EndBASIC program and tracks its state.

Implementations

Registers the given clearable.

In the common case, functions and commands hold a reference to the out-of-machine state they interact with. This state is invisible from here, but we may need to have access to it to reset it as part of the clear operation. In those cases, such state must be registered via this hook.

Registers the given builtin command, which must not yet be registered.

Registers the given builtin function, which must not yet be registered.

Resets the state of the machine by clearing all variable.

Tells the machine to stop execution at the next statement boundary.

The exec() call that’s stopped by this invocation will return the code given to this call.

Obtains immutable access to the state of the symbols.

Obtains mutable access to the state of the symbols.

Retrieves the variable name as a boolean. Fails if it is some other type or if it’s not defined.

Retrieves the variable name as an integer. Fails if it is some other type or if it’s not defined.

Retrieves the variable name as a string. Fails if it is some other type or if it’s not defined.

Defines a new array name of type subtype with dimensions. The array must not yet exist, and the name may not overlap function or variable names.

Executes a program extracted from the input readable.

Note that this does not consume self. As a result, it is possible to execute multiple different programs on the same machine, all sharing state.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.