Enum netsblox_ast::Stmt
source · [−]pub enum Stmt {
Show 48 variants
Assign {
vars: Vec<VariableRef>,
value: Expr,
comment: Option<String>,
},
AddAssign {
var: VariableRef,
value: Expr,
comment: Option<String>,
},
Warp {
stmts: Vec<Stmt>,
comment: Option<String>,
},
InfLoop {
stmts: Vec<Stmt>,
comment: Option<String>,
},
ForeachLoop {
var: VariableRef,
items: Expr,
stmts: Vec<Stmt>,
comment: Option<String>,
},
ForLoop {
var: VariableRef,
start: Expr,
stop: Expr,
stmts: Vec<Stmt>,
comment: Option<String>,
},
UntilLoop {
condition: Expr,
stmts: Vec<Stmt>,
comment: Option<String>,
},
Repeat {
times: Expr,
stmts: Vec<Stmt>,
comment: Option<String>,
},
If {
condition: Expr,
then: Vec<Stmt>,
comment: Option<String>,
},
IfElse {
condition: Expr,
then: Vec<Stmt>,
otherwise: Vec<Stmt>,
comment: Option<String>,
},
Push {
list: Expr,
value: Expr,
comment: Option<String>,
},
InsertAt {
list: Expr,
value: Expr,
index: Expr,
comment: Option<String>,
},
InsertAtRand {
list: Expr,
value: Expr,
comment: Option<String>,
},
Pop {
list: Expr,
comment: Option<String>,
},
RemoveAt {
list: Expr,
index: Expr,
comment: Option<String>,
},
RemoveAll {
list: Expr,
comment: Option<String>,
},
IndexAssign {
list: Expr,
value: Expr,
index: Expr,
comment: Option<String>,
},
RandIndexAssign {
list: Expr,
value: Expr,
comment: Option<String>,
},
LastIndexAssign {
list: Expr,
value: Expr,
comment: Option<String>,
},
Return {
value: Expr,
comment: Option<String>,
},
Sleep {
seconds: Expr,
comment: Option<String>,
},
WaitUntil {
condition: Expr,
comment: Option<String>,
},
SwitchCostume {
costume: Option<Expr>,
comment: Option<String>,
},
Forward {
distance: Expr,
comment: Option<String>,
},
ChangePos {
dx: Option<Expr>,
dy: Option<Expr>,
comment: Option<String>,
},
SetPos {
x: Option<Expr>,
y: Option<Expr>,
comment: Option<String>,
},
Goto {
target: Expr,
comment: Option<String>,
},
TurnRight {
angle: Expr,
comment: Option<String>,
},
TurnLeft {
angle: Expr,
comment: Option<String>,
},
SetHeading {
value: Expr,
comment: Option<String>,
},
BounceOffEdge {
comment: Option<String>,
},
PenDown {
comment: Option<String>,
},
PenUp {
comment: Option<String>,
},
PenClear {
comment: Option<String>,
},
Stamp {
comment: Option<String>,
},
Write {
content: Expr,
font_size: Expr,
comment: Option<String>,
},
SetPenColor {
color: (u8, u8, u8),
comment: Option<String>,
},
Say {
content: Expr,
duration: Option<Expr>,
comment: Option<String>,
},
Think {
content: Expr,
duration: Option<Expr>,
comment: Option<String>,
},
SetVisible {
value: bool,
comment: Option<String>,
},
ChangeScalePercent {
amount: Expr,
comment: Option<String>,
},
SetScalePercent {
value: Expr,
comment: Option<String>,
},
ChangePenSize {
amount: Expr,
comment: Option<String>,
},
SetPenSize {
value: Expr,
comment: Option<String>,
},
RunRpc {
service: String,
rpc: String,
args: Vec<(String, Expr)>,
comment: Option<String>,
},
RunFn {
function: FnRef,
args: Vec<Expr>,
comment: Option<String>,
},
SendLocalMessage {
target: Option<Expr>,
msg_type: Expr,
wait: bool,
comment: Option<String>,
},
SendNetworkMessage {
target: Expr,
msg_type: String,
values: Vec<(String, Expr)>,
comment: Option<String>,
},
}Variants
Assign
Assign the given value to each of the listed variables (afterwards, they should all be ref-eq).
AddAssign
Warp
InfLoop
ForeachLoop
ForLoop
UntilLoop
Repeat
If
IfElse
Push
InsertAt
InsertAtRand
Pop
RemoveAt
RemoveAll
IndexAssign
RandIndexAssign
LastIndexAssign
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
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnwindSafe for Stmt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more