pub enum SNode {
Show 29 variants
Num {
value: String,
ty: Option<Type>,
negative: bool,
unit: bool,
},
Bool {
value: bool,
},
Str {
value: String,
},
Unit,
Name {
path: Vec<String>,
},
DotCtor {
name: String,
},
App {
func: Box<SExpr>,
args: Vec<SExpr>,
},
Field {
object: Box<SExpr>,
field: String,
},
Unary {
op: UnaryOp,
arg: Box<SExpr>,
},
Binary {
op: BinaryOp,
left: Box<SExpr>,
right: Box<SExpr>,
rounding: Option<Rounding>,
},
If {
cond: Box<SExpr>,
then: Box<SExpr>,
otherwise: Box<SExpr>,
},
Let {
name: String,
ty: Option<Type>,
value: Box<SExpr>,
body: Box<SExpr>,
},
Match {
scrutinees: Vec<SExpr>,
rows: Vec<SRow>,
},
Match1 {
scrutinee: Box<SExpr>,
cases: Vec<SCase>,
},
ToString {
arg: Box<SExpr>,
},
Show {
arg: Box<SExpr>,
style: ShowStyle,
},
Cast {
arg: Box<SExpr>,
to: Type,
from: Option<Type>,
flavor: Flavor,
},
Abort {
message: String,
},
Print {
expr: Box<SExpr>,
style: ShowStyle,
body: Box<SExpr>,
},
CtorObject {
tag: String,
fields: Vec<(String, SExpr)>,
},
Array {
items: Vec<SArrayItem>,
element: Option<Type>,
},
Index {
object: Box<SExpr>,
index: Box<SExpr>,
},
Length {
object: Box<SExpr>,
integer: bool,
},
Math {
op: String,
name: String,
args: Vec<SArrayItem>,
},
Cons {
head: Box<SExpr>,
tail: Box<SExpr>,
},
Nil,
List {
items: Vec<SExpr>,
},
Tag {
tag: String,
},
Default,
}Variants§
Num
Fields
Bool
Str
Unit
Name
DotCtor
Lean’s .ctor, resolved against the expected type.
App
Field
Unary
Binary
If
Let
Match
Match1
A single-level match, as pattern compilation produces it.
ToString
Show
Cast
Abort
console.log(expr), then body.
CtorObject
A JavaScript { $: 'tag', field: value } constructor object, fields in source order.
Array
A JavaScript array literal [a, ...xs, b].
Fields
§
items: Vec<SArrayItem>Index
xs[i], a read of an array element.
Length
The length of an array: a Number, or for the counter of a for…of loop a BigInt.
Math
A call of a Math or Number function, Math.max(a, ...xs): op is
the function and name the path the program called it by.
Cons
Nil
List
Tag
Default
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SNode
impl<'de> Deserialize<'de> for SNode
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 SNode
impl StructuralPartialEq for SNode
Auto Trait Implementations§
impl Freeze for SNode
impl RefUnwindSafe for SNode
impl Send for SNode
impl Sync for SNode
impl Unpin for SNode
impl UnsafeUnpin for SNode
impl UnwindSafe for SNode
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.