pub enum StmtKind {
Show 76 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: Option<Box<Expr>>, }, NextCostume, 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 { service: String, rpc: String, args: Vec<(String, 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: String, values: Vec<(String, 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: String, 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: Option<Box<Expr>>
§

NextCostume

§

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

Fields

§target: Box<Expr>

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

§

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

Fields

§service: String
§args: Vec<(String, Expr)>
§

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

Fields

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

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).

§

SendNetworkMessage

Fields

§target: Box<Expr>
§msg_type: String
§values: Vec<(String, Expr)>

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

§

SendNetworkReply

Fields

§value: Box<Expr>

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

§

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

§name: String
§args: Vec<Expr>

Trait Implementations§

source§

impl Clone for StmtKind

source§

fn clone(&self) -> StmtKind

Returns a copy 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.