Enum netsblox_ast::StmtKind
source · 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
§
vars: Vec<VariableDef>Assign
AddAssign
Warp
InfLoop
ForeachLoop
ForLoop
UntilLoop
Repeat
If
IfElse
TryCatch
Throw
ListInsert
ListInsertLast
ListInsertRandom
ListRemove
ListRemoveLast
ListRemoveAll
ListAssign
ListAssignLast
ListAssignRandom
Return
Sleep
WaitUntil
SwitchCostume
Forward
ChangePos
SetPos
Goto
Similar to SetPos except that the target can be either a list of [x, y] coordinates or a entity.
TurnRight
TurnLeft
SetHeading
BounceOffEdge
PenDown
PenUp
PenClear
Stamp
Write
SetPenColor
Say
Think
SetVisible
ChangeScalePercent
SetScalePercent
ChangePenSize
SetPenSize
RunRpc
RunFn
RunClosure
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).
SendNetworkMessage
Sends a message over the network to the specified targets.
target may be a single target or a list of targets.
SendNetworkReply
Sends a reply from a received message that was blocking (sender’s wait flag was true).