Enum erg_parser::ast::ConstExpr
source · pub enum ConstExpr {
Show 13 variants
Lit(Literal),
Accessor(ConstAccessor),
App(ConstApp),
List(ConstList),
Set(ConstSet),
Dict(ConstDict),
Tuple(ConstTuple),
Record(ConstRecord),
Def(ConstDef),
Lambda(ConstLambda),
BinOp(ConstBinOp),
UnaryOp(ConstUnaryOp),
TypeAsc(ConstTypeAsc),
}
Expand description
valid expression for an argument of polymorphic types 多相型の実引数として有効な式
Variants§
Lit(Literal)
Accessor(ConstAccessor)
App(ConstApp)
List(ConstList)
Set(ConstSet)
Dict(ConstDict)
Tuple(ConstTuple)
Record(ConstRecord)
Def(ConstDef)
Lambda(ConstLambda)
BinOp(ConstBinOp)
UnaryOp(ConstUnaryOp)
TypeAsc(ConstTypeAsc)
Implementations§
source§impl ConstExpr
impl ConstExpr
pub fn need_to_be_closed(&self) -> bool
pub fn downgrade(self) -> Expr
pub fn attr(self, attr_name: ConstIdentifier) -> ConstAccessor
pub fn attr_expr(self, attr_name: ConstIdentifier) -> Self
pub fn call(self, args: ConstArgs) -> ConstApp
pub fn call_expr(self, args: ConstArgs) -> Self
Trait Implementations§
source§impl FromIterator<ConstExpr> for ConstBlock
impl FromIterator<ConstExpr> for ConstBlock
source§impl Locational for ConstExpr
impl Locational for ConstExpr
source§impl NestedDisplay for ConstExpr
impl NestedDisplay for ConstExpr
source§impl Stream<ConstExpr> for ConstBlock
impl Stream<ConstExpr> for ConstBlock
fn payload(self) -> Vec<ConstExpr>
fn ref_payload(&self) -> &Vec<ConstExpr>
fn ref_mut_payload(&mut self) -> &mut Vec<ConstExpr>
fn clear(&mut self)
fn len(&self) -> usize
fn size(&self) -> usize
fn is_empty(&self) -> bool
fn insert(&mut self, idx: usize, elem: T)
fn remove(&mut self, idx: usize) -> T
fn push(&mut self, elem: T)
fn append<S>(&mut self, s: &mut S)where
S: Stream<T>,
fn pop(&mut self) -> Option<T>
fn lpop(&mut self) -> Option<T>
fn get(&self, idx: usize) -> Option<&T>
fn get_mut(&mut self, idx: usize) -> Option<&mut T>
fn first(&self) -> Option<&T>
fn first_mut(&mut self) -> Option<&mut T>
fn last(&self) -> Option<&T>
fn last_mut(&mut self) -> Option<&mut T>
fn iter(&self) -> Iter<'_, T>
fn iter_mut(&mut self) -> IterMut<'_, T>
fn take_all(&mut self) -> Vec<T>
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn split_off(&mut self, at: usize) -> Vec<T>
source§fn retain(&mut self, f: impl FnMut(&T) -> bool)
fn retain(&mut self, f: impl FnMut(&T) -> bool)
Remove all elements that don’t satisfy the predicate.
fn concat(self, other: Self) -> Self
source§impl TryFrom<&ParamListPattern> for ConstExpr
impl TryFrom<&ParamListPattern> for ConstExpr
source§impl TryFrom<&ParamPattern> for ConstExpr
impl TryFrom<&ParamPattern> for ConstExpr
source§impl TryFrom<&ParamTuplePattern> for ConstExpr
impl TryFrom<&ParamTuplePattern> for ConstExpr
impl Eq for ConstExpr
impl StructuralPartialEq for ConstExpr
Auto Trait Implementations§
impl Freeze for ConstExpr
impl RefUnwindSafe for ConstExpr
impl Send for ConstExpr
impl Sync for ConstExpr
impl Unpin for ConstExpr
impl UnwindSafe for ConstExpr
Blanket Implementations§
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)