Enum erg_parser::ast::Accessor
source · pub enum Accessor {
Ident(Identifier),
Attr(Attribute),
TupleAttr(TupleAttribute),
Subscr(Subscript),
TypeApp(TypeApp),
}
Variants§
Implementations§
source§impl Accessor
impl Accessor
pub const fn local(symbol: Token) -> Self
pub const fn public(dot: Token, symbol: Token) -> Self
pub const fn explicit_local(dcolon: Token, symbol: Token) -> Self
pub const fn restricted(rest: VisRestriction, symbol: Token) -> Self
pub fn attr(obj: Expr, ident: Identifier) -> Self
pub fn tuple_attr(obj: Expr, index: Literal) -> Self
pub fn subscr(obj: Expr, index: Expr, r_sqbr: Token) -> Self
pub fn type_app(obj: Expr, type_args: TypeAppArgs) -> Self
pub const fn name(&self) -> Option<&Str>
pub fn is_const(&self) -> bool
Trait Implementations§
source§impl FromIterator<Accessor> for Namespaces
impl FromIterator<Accessor> for Namespaces
source§impl Locational for Accessor
impl Locational for Accessor
source§fn loc(&self) -> Location
fn loc(&self) -> Location
NOTE:
loc
cannot be treated as a light method when self
is a large grammatical element.
If possible, delay the computation by passing &impl Locational
or other means.