StmtKind

Enum StmtKind 

Source
pub enum StmtKind {
Show 80 variants DeclareLocals { vars: Vec<VariableDef>, }, Assign { var: VariableRef, value: Box<Expr>, }, AddAssign { var: VariableRef, value: Box<Expr>, }, ShowVar { var: VariableRef, }, HideVar { var: VariableRef, }, Warp { stmts: Vec<Stmt>, }, InfLoop { stmts: Vec<Stmt>, }, ForeachLoop { var: VariableRef, items: Box<Expr>, stmts: Vec<Stmt>, }, ForLoop { var: VariableRef, start: Box<Expr>, stop: Box<Expr>, stmts: Vec<Stmt>, }, UntilLoop { condition: Box<Expr>, stmts: Vec<Stmt>, }, Repeat { times: Box<Expr>, stmts: Vec<Stmt>, }, If { condition: Box<Expr>, then: Vec<Stmt>, }, IfElse { condition: Box<Expr>, then: Vec<Stmt>, otherwise: Vec<Stmt>, }, TryCatch { code: Vec<Stmt>, var: VariableRef, handler: Vec<Stmt>, }, Throw { error: Box<Expr>, }, ListInsert { list: Box<Expr>, value: Box<Expr>, index: Box<Expr>, }, ListInsertLast { list: Box<Expr>, value: Box<Expr>, }, ListInsertRandom { list: Box<Expr>, value: Box<Expr>, }, ListRemove { list: Box<Expr>, index: Box<Expr>, }, ListRemoveLast { list: Box<Expr>, }, ListRemoveAll { list: Box<Expr>, }, ListAssign { list: Box<Expr>, value: Box<Expr>, index: Box<Expr>, }, ListAssignLast { list: Box<Expr>, value: Box<Expr>, }, ListAssignRandom { list: Box<Expr>, value: Box<Expr>, }, Return { value: Box<Expr>, }, Sleep { seconds: Box<Expr>, }, WaitUntil { condition: Box<Expr>, }, SetCostume { costume: Box<Expr>, }, NextCostume, PlaySound { sound: Box<Expr>, blocking: bool, }, PlayNotes { notes: Box<Expr>, beats: Box<Expr>, blocking: bool, }, Rest { beats: Box<Expr>, }, StopSounds, Forward { distance: Box<Expr>, }, SetX { value: Box<Expr>, }, ChangeX { delta: Box<Expr>, }, SetY { value: Box<Expr>, }, ChangeY { delta: Box<Expr>, }, GotoXY { x: Box<Expr>, y: Box<Expr>, }, GotoMouse, GotoRandom, Goto { target: Box<Expr>, }, PointTowards { target: Box<Expr>, }, PointTowardsXY { x: Box<Expr>, y: Box<Expr>, }, TurnRight { angle: Box<Expr>, }, TurnLeft { angle: Box<Expr>, }, SetHeading { value: Box<Expr>, }, SetHeadingRandom, BounceOffEdge, SetPenDown { value: bool, }, PenClear, Stamp, Write { content: Box<Expr>, font_size: Box<Expr>, }, SetPenColor { color: (u8, u8, u8, u8), }, Say { content: Box<Expr>, duration: Option<Box<Expr>>, }, Think { content: Box<Expr>, duration: Option<Box<Expr>>, }, SetVisible { value: bool, }, ChangeSize { delta: Box<Expr>, }, SetSize { value: Box<Expr>, }, ChangePenSize { delta: Box<Expr>, }, SetPenSize { value: Box<Expr>, }, CallRpc { host: Option<CompactString>, service: CompactString, rpc: CompactString, args: Vec<(CompactString, Expr)>, }, CallFn { function: FnRef, args: Vec<Expr>, upvars: Vec<VariableRef>, }, CallClosure { new_entity: Option<Box<Expr>>, closure: Box<Expr>, args: Vec<Expr>, }, ForkClosure { closure: Box<Expr>, args: Vec<Expr>, }, Clone { target: Box<Expr>, }, DeleteClone, SendLocalMessage { target: Option<Box<Expr>>, msg_type: Box<Expr>, wait: bool, }, SendNetworkMessage { target: Box<Expr>, msg_type: CompactString, values: Vec<(CompactString, Expr)>, }, SendNetworkReply { value: Box<Expr>, }, Ask { prompt: Box<Expr>, }, ResetTimer, Pause, SetEffect { kind: EffectKind, value: Box<Expr>, }, ChangeEffect { kind: EffectKind, delta: Box<Expr>, }, ClearEffects, SetPenAttr { attr: PenAttribute, value: Box<Expr>, }, ChangePenAttr { attr: PenAttribute, delta: Box<Expr>, }, Stop { mode: StopMode, }, UnknownBlock { name: CompactString, args: Vec<Expr>, },
}

Variants§

§

DeclareLocals

Fields

§

Assign

Fields

§value: Box<Expr>
§

AddAssign

Fields

§value: Box<Expr>
§

ShowVar

Fields

§

HideVar

Fields

§

Warp

Fields

§stmts: Vec<Stmt>
§

InfLoop

Fields

§stmts: Vec<Stmt>
§

ForeachLoop

Fields

§items: Box<Expr>
§stmts: Vec<Stmt>
§

ForLoop

Fields

§start: Box<Expr>
§stop: Box<Expr>
§stmts: Vec<Stmt>
§

UntilLoop

Fields

§condition: Box<Expr>
§stmts: Vec<Stmt>
§

Repeat

Fields

§times: Box<Expr>
§stmts: Vec<Stmt>
§

If

Fields

§condition: Box<Expr>
§then: Vec<Stmt>
§

IfElse

Fields

§condition: Box<Expr>
§then: Vec<Stmt>
§otherwise: Vec<Stmt>
§

TryCatch

Fields

§code: Vec<Stmt>
§handler: Vec<Stmt>
§

Throw

Fields

§error: Box<Expr>
§

ListInsert

Fields

§list: Box<Expr>
§value: Box<Expr>
§index: Box<Expr>
§

ListInsertLast

Fields

§list: Box<Expr>
§value: Box<Expr>
§

ListInsertRandom

Fields

§list: Box<Expr>
§value: Box<Expr>
§

ListRemove

Fields

§list: Box<Expr>
§index: Box<Expr>
§

ListRemoveLast

Fields

§list: Box<Expr>
§

ListRemoveAll

Fields

§list: Box<Expr>
§

ListAssign

Fields

§list: Box<Expr>
§value: Box<Expr>
§index: Box<Expr>
§

ListAssignLast

Fields

§list: Box<Expr>
§value: Box<Expr>
§

ListAssignRandom

Fields

§list: Box<Expr>
§value: Box<Expr>
§

Return

Fields

§value: Box<Expr>
§

Sleep

Fields

§seconds: Box<Expr>
§

WaitUntil

Fields

§condition: Box<Expr>
§

SetCostume

Fields

§costume: Box<Expr>
§

NextCostume

§

PlaySound

Fields

§sound: Box<Expr>
§blocking: bool
§

PlayNotes

Fields

§notes: Box<Expr>
§beats: Box<Expr>
§blocking: bool
§

Rest

Fields

§beats: Box<Expr>
§

StopSounds

§

Forward

Fields

§distance: Box<Expr>
§

SetX

Fields

§value: Box<Expr>
§

ChangeX

Fields

§delta: Box<Expr>
§

SetY

Fields

§value: Box<Expr>
§

ChangeY

Fields

§delta: Box<Expr>
§

GotoXY

Fields

§

GotoMouse

§

GotoRandom

§

Goto

Similar to SetPos except that the target can be either a list of [x, y] coordinates or a entity.

Fields

§target: Box<Expr>
§

PointTowards

Fields

§target: Box<Expr>
§

PointTowardsXY

Fields

§

TurnRight

Fields

§angle: Box<Expr>
§

TurnLeft

Fields

§angle: Box<Expr>
§

SetHeading

Fields

§value: Box<Expr>
§

SetHeadingRandom

§

BounceOffEdge

§

SetPenDown

Fields

§value: bool
§

PenClear

§

Stamp

§

Write

Fields

§content: Box<Expr>
§font_size: Box<Expr>
§

SetPenColor

Fields

§color: (u8, u8, u8, u8)
§

Say

Fields

§content: Box<Expr>
§duration: Option<Box<Expr>>
§

Think

Fields

§content: Box<Expr>
§duration: Option<Box<Expr>>
§

SetVisible

Fields

§value: bool
§

ChangeSize

Fields

§delta: Box<Expr>
§

SetSize

Fields

§value: Box<Expr>
§

ChangePenSize

Fields

§delta: Box<Expr>
§

SetPenSize

Fields

§value: Box<Expr>
§

CallRpc

§

CallFn

Fields

§function: FnRef
§args: Vec<Expr>
§

CallClosure

Fields

§new_entity: Option<Box<Expr>>
§closure: Box<Expr>
§args: Vec<Expr>
§

ForkClosure

Fields

§closure: Box<Expr>
§args: Vec<Expr>
§

Clone

Fields

§target: Box<Expr>
§

DeleteClone

§

SendLocalMessage

Sends a message to local entities (not over the network). If target is None, this should broadcast to all entities. Otherwise target is either a single target or a list of targets to send to. The wait flag determines if the broadcast should be blocking (wait for receivers to terminate).

Fields

§target: Option<Box<Expr>>
§msg_type: Box<Expr>
§wait: bool
§

SendNetworkMessage

Sends a message over the network to the specified targets. target may be a single target or a list of targets.

Fields

§target: Box<Expr>
§msg_type: CompactString
§

SendNetworkReply

Sends a reply from a received message that was blocking (sender’s wait flag was true).

Fields

§value: Box<Expr>
§

Ask

Fields

§prompt: Box<Expr>
§

ResetTimer

§

Pause

§

SetEffect

Fields

§value: Box<Expr>
§

ChangeEffect

Fields

§delta: Box<Expr>
§

ClearEffects

§

SetPenAttr

Fields

§value: Box<Expr>
§

ChangePenAttr

Fields

§delta: Box<Expr>
§

Stop

Fields

§

UnknownBlock

Fields

§args: Vec<Expr>

Trait Implementations§

Source§

impl Clone for StmtKind

Source§

fn clone(&self) -> StmtKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StmtKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.