pub enum Node {
Show 21 variants
Lit {
value: LitValue,
},
Unit,
Var {
name: String,
},
Call {
func: String,
args: Vec<Expr>,
},
Ctor {
data: String,
ctor: String,
args: Vec<Expr>,
},
Unary {
op: UnaryOp,
arg: Box<Expr>,
semantics: Option<Semantics>,
},
Binary {
op: BinaryOp,
left: Box<Expr>,
right: Box<Expr>,
domain: Option<Type>,
semantics: Option<Semantics>,
rounding: Option<Rounding>,
by_zero: Option<ByZero>,
},
If {
cond: Box<Expr>,
then: Box<Expr>,
otherwise: Box<Expr>,
},
Let {
name: String,
value: Box<Expr>,
body: Box<Expr>,
},
Match {
scrutinee: Box<Expr>,
cases: Vec<Case>,
},
ToString {
arg: Box<Expr>,
console: bool,
},
Cast {
arg: Box<Expr>,
from: Type,
to: Type,
flavor: Flavor,
message: Option<String>,
order: Option<usize>,
},
Abort {
message: String,
},
Print {
text: Box<Expr>,
body: Box<Expr>,
},
Array {
items: Vec<Expr>,
},
Append {
left: Box<Expr>,
right: Box<Expr>,
},
Index {
array: Box<Expr>,
index: Box<Expr>,
},
Length {
array: Box<Expr>,
},
Math {
op: String,
args: Vec<Expr>,
},
OutNil,
OutCons {
head: Box<Expr>,
tail: Box<Expr>,
},
}Variants§
Lit
Unit
Var
Call
Ctor
Unary
Binary
Fields
If
Let
Match
ToString
Fields
Cast
Fields
Abort
Prints text, then is body.
Array
A JavaScript array of items.
Append
The elements of left, then those of right.
Index
The element of array at index, a Number or an integer; a read
outside the array aborts.
Length
The number of elements of array, as a Number or an integer.
Math
A Math or Number function of Numbers; maxOf and minOf fold
max and min over one array.
OutNil
No lines printed (see output).
OutCons
The lines tail with head printed after them.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.