pub enum StmtKind {
Show 56 variants DeclareLocals { vars: Vec<VariableDef>, }, Assign { var: VariableRef, value: Expr, }, AddAssign { var: VariableRef, value: Expr, }, Warp { stmts: Vec<Stmt>, }, InfLoop { stmts: Vec<Stmt>, }, ForeachLoop { var: VariableRef, items: Expr, stmts: Vec<Stmt>, }, ForLoop { var: VariableRef, start: Expr, stop: Expr, stmts: Vec<Stmt>, }, UntilLoop { condition: Expr, stmts: Vec<Stmt>, }, Repeat { times: Expr, stmts: Vec<Stmt>, }, If { condition: Expr, then: Vec<Stmt>, }, IfElse { condition: Expr, then: Vec<Stmt>, otherwise: Vec<Stmt>, }, TryCatch { code: Vec<Stmt>, var: VariableRef, handler: Vec<Stmt>, }, Throw { error: Expr, }, ListInsert { list: Expr, value: Expr, index: Expr, }, ListInsertLast { list: Expr, value: Expr, }, ListInsertRandom { list: Expr, value: Expr, }, ListRemove { list: Expr, index: Expr, }, ListRemoveLast { list: Expr, }, ListRemoveAll { list: Expr, }, ListAssign { list: Expr, value: Expr, index: Expr, }, ListAssignLast { list: Expr, value: Expr, }, ListAssignRandom { list: Expr, value: Expr, }, Return { value: Expr, }, Sleep { seconds: Expr, }, WaitUntil { condition: Expr, }, SwitchCostume { costume: Option<Expr>, }, Forward { distance: Expr, }, ChangePos { dx: Option<Expr>, dy: Option<Expr>, }, SetPos { x: Option<Expr>, y: Option<Expr>, }, Goto { target: Expr, }, TurnRight { angle: Expr, }, TurnLeft { angle: Expr, }, SetHeading { value: Expr, }, BounceOffEdge, PenDown, PenUp, PenClear, Stamp, Write { content: Expr, font_size: Expr, }, SetPenColor { color: (u8, u8, u8), }, Say { content: Expr, duration: Option<Expr>, }, Think { content: Expr, duration: Option<Expr>, }, SetVisible { value: bool, }, ChangeScalePercent { amount: Expr, }, SetScalePercent { value: Expr, }, ChangePenSize { amount: Expr, }, SetPenSize { value: Expr, }, RunRpc { service: String, rpc: String, args: Vec<(String, Expr)>, }, RunFn { function: FnRef, args: Vec<Expr>, }, RunClosure { closure: Expr, args: Vec<Expr>, }, SendLocalMessage { target: Option<Expr>, msg_type: Expr, wait: bool, }, SendNetworkMessage { target: Expr, msg_type: String, values: Vec<(String, Expr)>, }, SendNetworkReply { value: Expr, }, Ask { prompt: Expr, }, ResetTimer, Syscall { name: Expr, args: VariadicInput, },
}

Variants§

§

DeclareLocals

Fields

§

Assign

Fields

§value: Expr
§

AddAssign

Fields

§value: Expr
§

Warp

Fields

§stmts: Vec<Stmt>
§

InfLoop

Fields

§stmts: Vec<Stmt>
§

ForeachLoop

Fields

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

ForLoop

Fields

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

UntilLoop

Fields

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

Repeat

Fields

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

If

Fields

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

IfElse

Fields

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

TryCatch

Fields

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

Throw

Fields

§error: Expr
§

ListInsert

Fields

§list: Expr
§value: Expr
§index: Expr
§

ListInsertLast

Fields

§list: Expr
§value: Expr
§

ListInsertRandom

Fields

§list: Expr
§value: Expr
§

ListRemove

Fields

§list: Expr
§index: Expr
§

ListRemoveLast

Fields

§list: Expr
§

ListRemoveAll

Fields

§list: Expr
§

ListAssign

Fields

§list: Expr
§value: Expr
§index: Expr
§

ListAssignLast

Fields

§list: Expr
§value: Expr
§

ListAssignRandom

Fields

§list: Expr
§value: Expr
§

Return

Fields

§value: Expr
§

Sleep

Fields

§seconds: Expr
§

WaitUntil

Fields

§condition: Expr
§

SwitchCostume

Fields

§costume: Option<Expr>
§

Forward

Fields

§distance: Expr
§

ChangePos

Fields

§

SetPos

Fields

§

Goto

Fields

§target: Expr

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

§

TurnRight

Fields

§angle: Expr
§

TurnLeft

Fields

§angle: Expr
§

SetHeading

Fields

§value: Expr
§

BounceOffEdge

§

PenDown

§

PenUp

§

PenClear

§

Stamp

§

Write

Fields

§content: Expr
§font_size: Expr
§

SetPenColor

Fields

§color: (u8, u8, u8)
§

Say

Fields

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

Think

Fields

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

SetVisible

Fields

§value: bool
§

ChangeScalePercent

Fields

§amount: Expr
§

SetScalePercent

Fields

§value: Expr
§

ChangePenSize

Fields

§amount: Expr
§

SetPenSize

Fields

§value: Expr
§

RunRpc

Fields

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

RunFn

Fields

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

RunClosure

Fields

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

SendLocalMessage

Fields

§target: Option<Expr>
§msg_type: 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: 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: Expr

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

§

Ask

Fields

§prompt: Expr
§

ResetTimer

§

Syscall

Fields

§name: Expr

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.