Enum ExprDesc

Source
pub enum ExprDesc {
Show 34 variants Nil, Bool(bool), Number(f64), String(RcStr), Name(RcStr), List(Vec<Expr>), Map(Vec<(Expr, Expr)>), Parentheses(Box<Expr>), Block(Vec<Expr>), Switch(Box<Expr>, Vec<(Expr, Expr)>, Option<Box<Expr>>), If(Vec<(Expr, Expr)>, Option<Box<Expr>>), For(AssignTarget, Box<Expr>, Box<Expr>), While(Box<Expr>, Box<Expr>), Binop(Binop, Box<Expr>, Box<Expr>), LogicalBinop(LogicalBinop, Box<Expr>, Box<Expr>), Unop(Unop, Box<Expr>), Subscript(Box<Expr>, Box<Expr>), Slice(Box<Expr>, Option<Box<Expr>>, Option<Box<Expr>>), Attr(Box<Expr>, RcStr), CallFunction(Box<Expr>, Args), CallMethod(Box<Expr>, RcStr, Args), Assign(AssignTarget, Box<Expr>), AugAssign(AssignTarget, Binop, Box<Expr>), NonlocalAssign(RcStr, Box<Expr>), Nonlocal(Vec<RcStr>), New(Option<RcStr>, Vec<(RcStr, Expr)>), Del(RcStr), Yield(Box<Expr>), Return(Option<Box<Expr>>), Import(RcStr), BreakPoint, AssignDoc(Box<Expr>, RcStr, RcStr), Function { is_generator: bool, name: Option<RcStr>, params: ArgSpec, docstr: Option<RcStr>, body: Box<Expr>, varspec: Option<VarSpec>, }, Class { name: RcStr, bases: Vec<Expr>, docstr: Option<RcStr>, methods: Vec<(RcStr, Expr)>, static_methods: Vec<(RcStr, Expr)>, hidden_name: Option<RcStr>, },
}

Variants§

§

Nil

§

Bool(bool)

§

Number(f64)

§

String(RcStr)

§

Name(RcStr)

§

List(Vec<Expr>)

§

Map(Vec<(Expr, Expr)>)

§

Parentheses(Box<Expr>)

§

Block(Vec<Expr>)

§

Switch(Box<Expr>, Vec<(Expr, Expr)>, Option<Box<Expr>>)

§

If(Vec<(Expr, Expr)>, Option<Box<Expr>>)

§

For(AssignTarget, Box<Expr>, Box<Expr>)

§

While(Box<Expr>, Box<Expr>)

§

Binop(Binop, Box<Expr>, Box<Expr>)

§

LogicalBinop(LogicalBinop, Box<Expr>, Box<Expr>)

§

Unop(Unop, Box<Expr>)

§

Subscript(Box<Expr>, Box<Expr>)

§

Slice(Box<Expr>, Option<Box<Expr>>, Option<Box<Expr>>)

§

Attr(Box<Expr>, RcStr)

§

CallFunction(Box<Expr>, Args)

§

CallMethod(Box<Expr>, RcStr, Args)

§

Assign(AssignTarget, Box<Expr>)

§

AugAssign(AssignTarget, Binop, Box<Expr>)

§

NonlocalAssign(RcStr, Box<Expr>)

§

Nonlocal(Vec<RcStr>)

§

New(Option<RcStr>, Vec<(RcStr, Expr)>)

§

Del(RcStr)

§

Yield(Box<Expr>)

§

Return(Option<Box<Expr>>)

§

Import(RcStr)

§

BreakPoint

§

AssignDoc(Box<Expr>, RcStr, RcStr)

AssignDoc at runtime is more or less a nop. However, it attaches docstrings to field assignments (the first ‘Expr’ parameter should always be an Assign)

§

Function

Fields

§is_generator: bool
§params: ArgSpec
§docstr: Option<RcStr>
§body: Box<Expr>
§varspec: Option<VarSpec>
§

Class

Fields

§name: RcStr
§bases: Vec<Expr>
§docstr: Option<RcStr>
§methods: Vec<(RcStr, Expr)>
§static_methods: Vec<(RcStr, Expr)>
§hidden_name: Option<RcStr>

The hidden name for a class is computed during annotation. The hidden name is used by methods to refer to the class that they belong to

Trait Implementations§

Source§

impl Debug for ExprDesc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.