pub enum Expr {
Show 67 variants Value(Value), Variable { var: VariableRef, comment: Option<String>, }, Add { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Sub { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Mul { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Div { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Mod { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Pow { base: Box<Expr>, power: Box<Expr>, comment: Option<String>, }, Log { value: Box<Expr>, base: Box<Expr>, comment: Option<String>, }, And { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Or { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Conditional { condition: Box<Expr>, then: Box<Expr>, otherwise: Box<Expr>, comment: Option<String>, }, Identical { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Eq { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Less { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, Greater { left: Box<Expr>, right: Box<Expr>, comment: Option<String>, }, RandInclusive { a: Box<Expr>, b: Box<Expr>, comment: Option<String>, }, RangeInclusive { start: Box<Expr>, stop: Box<Expr>, comment: Option<String>, }, MakeList { values: Vec<Expr>, comment: Option<String>, }, Listcat { lists: Vec<Expr>, comment: Option<String>, }, Listlen { value: Box<Expr>, comment: Option<String>, }, ListAllButFirst { value: Box<Expr>, comment: Option<String>, }, ListFind { list: Box<Expr>, value: Box<Expr>, comment: Option<String>, }, ListIndex { list: Box<Expr>, index: Box<Expr>, comment: Option<String>, }, ListRandIndex { list: Box<Expr>, comment: Option<String>, }, ListLastIndex { list: Box<Expr>, comment: Option<String>, }, Strcat { values: Vec<Expr>, comment: Option<String>, }, Strlen { value: Box<Expr>, comment: Option<String>, }, UnicodeToChar { value: Box<Expr>, comment: Option<String>, }, CharToUnicode { value: Box<Expr>, comment: Option<String>, }, Not { value: Box<Expr>, comment: Option<String>, }, Neg { value: Box<Expr>, comment: Option<String>, }, Abs { value: Box<Expr>, comment: Option<String>, }, Sqrt { value: Box<Expr>, comment: Option<String>, }, Floor { value: Box<Expr>, comment: Option<String>, }, Ceil { value: Box<Expr>, comment: Option<String>, }, Round { value: Box<Expr>, comment: Option<String>, }, Sin { value: Box<Expr>, comment: Option<String>, }, Cos { value: Box<Expr>, comment: Option<String>, }, Tan { value: Box<Expr>, comment: Option<String>, }, Asin { value: Box<Expr>, comment: Option<String>, }, Acos { value: Box<Expr>, comment: Option<String>, }, Atan { value: Box<Expr>, comment: Option<String>, }, CallRpc { service: String, rpc: String, args: Vec<(String, Expr)>, comment: Option<String>, }, CallFn { function: FnRef, args: Vec<Expr>, comment: Option<String>, }, StageWidth { comment: Option<String>, }, StageHeight { comment: Option<String>, }, MouseX { comment: Option<String>, }, MouseY { comment: Option<String>, }, Latitude { comment: Option<String>, }, Longitude { comment: Option<String>, }, YPos { comment: Option<String>, }, XPos { comment: Option<String>, }, Heading { comment: Option<String>, }, PenDown { comment: Option<String>, }, Scale { comment: Option<String>, }, IsVisible { comment: Option<String>, }, This { comment: Option<String>, }, Entity { name: String, trans_name: String, comment: Option<String>, }, ImageOfEntity { entity: Box<Expr>, comment: Option<String>, }, ImageOfDrawings { comment: Option<String>, }, IsTouchingEntity { entity: Box<Expr>, comment: Option<String>, }, IsTouchingMouse { comment: Option<String>, }, IsTouchingEdge { comment: Option<String>, }, IsTouchingDrawings { comment: Option<String>, }, RpcError { comment: Option<String>, }, Closure { inputs: Vec<VariableDef>, captures: Vec<VariableRef>, stmts: Vec<Stmt>, comment: Option<String>, },
}

Variants

Value(Value)

Variable

Fields

comment: Option<String>

Add

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Sub

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Mul

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Div

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Mod

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Mathematical modulus (not remainder!). For instance, -1 mod 7 == 6.

Pow

Fields

base: Box<Expr>
power: Box<Expr>
comment: Option<String>

Log

Fields

value: Box<Expr>
base: Box<Expr>
comment: Option<String>

And

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Short-circuiting logical or.

Or

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Short-circuiting logical and.

Conditional

Fields

condition: Box<Expr>
then: Box<Expr>
otherwise: Box<Expr>
comment: Option<String>

Lazily-evaluated conditional expression. Returns then if condition is true, otherwise otherwise.

Identical

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

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

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Less

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

Greater

Fields

left: Box<Expr>
right: Box<Expr>
comment: Option<String>

RandInclusive

Fields

a: Box<Expr>
b: Box<Expr>
comment: Option<String>

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.

RangeInclusive

Fields

start: Box<Expr>
stop: Box<Expr>
comment: Option<String>

Get a list of all the numbers starting at start and stepping towards stop (by +1 or -1), but not going past stop.

MakeList

Fields

values: Vec<Expr>
comment: Option<String>

Listcat

Fields

lists: Vec<Expr>
comment: Option<String>

Listlen

Fields

value: Box<Expr>
comment: Option<String>

ListAllButFirst

Fields

value: Box<Expr>
comment: Option<String>

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.

ListFind

Fields

list: Box<Expr>
value: Box<Expr>
comment: Option<String>

Returns the (1-based) index of value in the list, or 0 if not present.

ListIndex

Fields

list: Box<Expr>
index: Box<Expr>
comment: Option<String>

ListRandIndex

Fields

list: Box<Expr>
comment: Option<String>

ListLastIndex

Fields

list: Box<Expr>
comment: Option<String>

Strcat

Fields

values: Vec<Expr>
comment: Option<String>

Strlen

Fields

value: Box<Expr>
comment: Option<String>

String length in terms of unicode code points (not bytes or grapheme clusters!).

UnicodeToChar

Fields

value: Box<Expr>
comment: Option<String>

Convert a unicode code point into a 1-character string.

CharToUnicode

Fields

value: Box<Expr>
comment: Option<String>

Convert a 1-character string into its unicode code point.

Not

Fields

value: Box<Expr>
comment: Option<String>

Neg

Fields

value: Box<Expr>
comment: Option<String>

Abs

Fields

value: Box<Expr>
comment: Option<String>

Sqrt

Fields

value: Box<Expr>
comment: Option<String>

Floor

Fields

value: Box<Expr>
comment: Option<String>

Ceil

Fields

value: Box<Expr>
comment: Option<String>

Round

Fields

value: Box<Expr>
comment: Option<String>

Sin

Fields

value: Box<Expr>
comment: Option<String>

Cos

Fields

value: Box<Expr>
comment: Option<String>

Tan

Fields

value: Box<Expr>
comment: Option<String>

Asin

Fields

value: Box<Expr>
comment: Option<String>

Acos

Fields

value: Box<Expr>
comment: Option<String>

Atan

Fields

value: Box<Expr>
comment: Option<String>

CallRpc

Fields

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

CallFn

Fields

function: FnRef
args: Vec<Expr>
comment: Option<String>

StageWidth

Fields

comment: Option<String>

StageHeight

Fields

comment: Option<String>

MouseX

Fields

comment: Option<String>

MouseY

Fields

comment: Option<String>

Latitude

Fields

comment: Option<String>

Longitude

Fields

comment: Option<String>

YPos

Fields

comment: Option<String>

XPos

Fields

comment: Option<String>

Heading

Fields

comment: Option<String>

PenDown

Fields

comment: Option<String>

Scale

Fields

comment: Option<String>

IsVisible

Fields

comment: Option<String>

This

Fields

comment: Option<String>

Entity

Fields

name: String
trans_name: String
comment: Option<String>

ImageOfEntity

Fields

entity: Box<Expr>
comment: Option<String>

ImageOfDrawings

Fields

comment: Option<String>

IsTouchingEntity

Fields

entity: Box<Expr>
comment: Option<String>

IsTouchingMouse

Fields

comment: Option<String>

IsTouchingEdge

Fields

comment: Option<String>

IsTouchingDrawings

Fields

comment: Option<String>

RpcError

Fields

comment: Option<String>

Closure

Fields

inputs: Vec<VariableDef>
captures: Vec<VariableRef>
stmts: Vec<Stmt>
comment: Option<String>

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

Converts to this type from the input type.

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.