pub enum ExprKind {
Show 122 variants
Value(Value),
Variable {
var: VariableRef,
},
Add {
values: Box<Expr>,
},
Mul {
values: Box<Expr>,
},
Min {
values: Box<Expr>,
},
Max {
values: Box<Expr>,
},
Sub {
left: Box<Expr>,
right: Box<Expr>,
},
Div {
left: Box<Expr>,
right: Box<Expr>,
},
Mod {
left: Box<Expr>,
right: Box<Expr>,
},
Pow {
base: Box<Expr>,
power: Box<Expr>,
},
Log {
value: Box<Expr>,
base: Box<Expr>,
},
Atan2 {
y: Box<Expr>,
x: Box<Expr>,
},
And {
left: Box<Expr>,
right: Box<Expr>,
},
Or {
left: Box<Expr>,
right: Box<Expr>,
},
Conditional {
condition: Box<Expr>,
then: Box<Expr>,
otherwise: Box<Expr>,
},
Identical {
left: Box<Expr>,
right: Box<Expr>,
},
Eq {
left: Box<Expr>,
right: Box<Expr>,
},
Neq {
left: Box<Expr>,
right: Box<Expr>,
},
Less {
left: Box<Expr>,
right: Box<Expr>,
},
LessEq {
left: Box<Expr>,
right: Box<Expr>,
},
Greater {
left: Box<Expr>,
right: Box<Expr>,
},
GreaterEq {
left: Box<Expr>,
right: Box<Expr>,
},
Random {
a: Box<Expr>,
b: Box<Expr>,
},
Range {
start: Box<Expr>,
stop: Box<Expr>,
},
MakeList {
values: Vec<Expr>,
},
CopyList {
list: Box<Expr>,
},
ListCat {
lists: Box<Expr>,
},
ListLen {
value: Box<Expr>,
},
ListRank {
value: Box<Expr>,
},
ListDims {
value: Box<Expr>,
},
ListFlatten {
value: Box<Expr>,
},
ListColumns {
value: Box<Expr>,
},
ListRev {
value: Box<Expr>,
},
ListLines {
value: Box<Expr>,
},
ListCsv {
value: Box<Expr>,
},
ListJson {
value: Box<Expr>,
},
ListReshape {
value: Box<Expr>,
dims: Box<Expr>,
},
ListCombinations {
sources: Box<Expr>,
},
ListIsEmpty {
value: Box<Expr>,
},
ListCdr {
value: Box<Expr>,
},
ListCons {
item: Box<Expr>,
list: Box<Expr>,
},
ListFind {
list: Box<Expr>,
value: Box<Expr>,
},
ListContains {
list: Box<Expr>,
value: Box<Expr>,
},
ListGet {
list: Box<Expr>,
index: Box<Expr>,
},
ListGetLast {
list: Box<Expr>,
},
ListGetRandom {
list: Box<Expr>,
},
StrGet {
string: Box<Expr>,
index: Box<Expr>,
},
StrGetLast {
string: Box<Expr>,
},
StrGetRandom {
string: Box<Expr>,
},
StrCat {
values: Box<Expr>,
},
StrLen {
value: Box<Expr>,
},
UnicodeToChar {
value: Box<Expr>,
},
CharToUnicode {
value: Box<Expr>,
},
Not {
value: Box<Expr>,
},
Neg {
value: Box<Expr>,
},
Abs {
value: Box<Expr>,
},
Sign {
value: Box<Expr>,
},
Sqrt {
value: Box<Expr>,
},
Floor {
value: Box<Expr>,
},
Ceil {
value: Box<Expr>,
},
Round {
value: Box<Expr>,
},
Sin {
value: Box<Expr>,
},
Cos {
value: Box<Expr>,
},
Tan {
value: Box<Expr>,
},
Asin {
value: Box<Expr>,
},
Acos {
value: Box<Expr>,
},
Atan {
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>,
},
StageWidth,
StageHeight,
MouseX,
MouseY,
Latitude,
Longitude,
KeyDown {
key: Box<Expr>,
},
YPos,
XPos,
Heading,
PenDown,
Size,
IsVisible,
This,
Entity {
name: CompactString,
trans_name: CompactString,
},
ImageOfEntity {
entity: Box<Expr>,
},
ImageOfDrawings,
IsTouchingEntity {
entity: Box<Expr>,
},
IsTouchingMouse,
IsTouchingEdge,
IsTouchingDrawings,
RpcError,
Closure {
kind: ClosureKind,
params: Vec<VariableDef>,
captures: Vec<VariableRef>,
stmts: Vec<Stmt>,
},
TextSplit {
text: Box<Expr>,
mode: TextSplitMode,
},
Answer,
Message,
Timer,
Map {
f: Box<Expr>,
list: Box<Expr>,
},
Keep {
f: Box<Expr>,
list: Box<Expr>,
},
FindFirst {
f: Box<Expr>,
list: Box<Expr>,
},
Combine {
f: Box<Expr>,
list: Box<Expr>,
},
NetworkMessageReply {
target: Box<Expr>,
msg_type: CompactString,
values: Vec<(CompactString, Expr)>,
},
Effect {
kind: EffectKind,
},
PenAttr {
attr: PenAttribute,
},
CostumeList,
Costume,
CostumeNumber,
CostumeName {
costume: Box<Expr>,
},
CostumeWidth {
costume: Box<Expr>,
},
CostumeHeight {
costume: Box<Expr>,
},
CostumePixels {
costume: Box<Expr>,
},
SoundList,
SoundName {
sound: Box<Expr>,
},
SoundDuration {
sound: Box<Expr>,
},
SoundSampleRate {
sound: Box<Expr>,
},
SoundSamples {
sound: Box<Expr>,
},
SoundSamplesLength {
sound: Box<Expr>,
},
SoundChannelCount {
sound: Box<Expr>,
},
Clone {
target: Box<Expr>,
},
TypeQuery {
value: Box<Expr>,
ty: ValueType,
},
RealTime {
query: TimeQuery,
},
UnknownBlock {
name: CompactString,
args: Vec<Expr>,
},
}Variants§
Value(Value)
Variable
Fields
var: VariableRefAdd
Mul
Min
Max
Sub
Div
Mod
Mathematical modulus (not remainder!). For instance, -1 mod 7 == 6.
Pow
Log
Atan2
And
Short-circuiting logical or.
Or
Short-circuiting logical and.
Conditional
Lazily-evaluated conditional expression. Returns then if condition is true, otherwise otherwise.
Identical
If both values are lists, returns true of they are references to the same list.
If both values are non-lists, returns true if the values are equal.
Otherwise returns false.
Eq
Neq
Less
LessEq
Greater
GreaterEq
Random
Get a random number between a and b (inclusive).
There are no ordering guarantees (swapping a and b is equivalent).
If both values are integers, the result is an integer, otherwise continuous floats are returned.
Range
Get a list of all the numbers starting at start and stepping towards stop (by +1 or -1), but not going past stop.
MakeList
CopyList
ListCat
ListLen
ListRank
ListDims
ListFlatten
ListColumns
ListRev
ListLines
ListCsv
ListJson
ListReshape
ListCombinations
ListIsEmpty
ListCdr
Given a list, returns a new (shallow copy) of all the items except the first. If the list is empty, an empty list is returned.
ListCons
Given a value and a list, returns a new list (shallow copy) with the item prepended.
ListFind
Returns the (1-based) index of value in the list, or 0 if not present.
ListContains
ListGet
ListGetLast
ListGetRandom
StrGet
StrGetLast
StrGetRandom
StrCat
StrLen
String length in terms of unicode code points (not bytes or grapheme clusters!).
UnicodeToChar
Convert a unicode code point into a 1-character string.
CharToUnicode
Convert a 1-character string into its unicode code point.
Not
Neg
Abs
Sign
Sqrt
Floor
Ceil
Round
Sin
Cos
Tan
Asin
Acos
Atan
CallRpc
Fields
host: Option<CompactString>service: CompactStringrpc: CompactStringargs: Vec<(CompactString, Expr)>CallFn
CallClosure
StageWidth
StageHeight
MouseX
MouseY
Latitude
Longitude
KeyDown
YPos
XPos
Heading
PenDown
Size
IsVisible
This
Entity
ImageOfEntity
ImageOfDrawings
IsTouchingEntity
IsTouchingMouse
IsTouchingEdge
IsTouchingDrawings
RpcError
Closure
TextSplit
Answer
Message
Timer
Map
Keep
FindFirst
Combine
NetworkMessageReply
Effect
Fields
kind: EffectKindPenAttr
Fields
attr: PenAttribute