Enum erg_parser::ast::Signature
source · pub enum Signature {
Var(VarSignature),
Subr(SubrSignature),
}
Expand description
represents a declaration of a variable
Variants§
Var(VarSignature)
Subr(SubrSignature)
Implementations§
source§impl Signature
impl Signature
pub fn name_as_str(&self) -> Option<&Str>
pub fn new_var(ident: Identifier) -> Self
pub fn new_subr(ident: Identifier, params: Params) -> Self
pub fn ident(&self) -> Option<&Identifier>
pub fn ident_mut(&mut self) -> Option<&mut Identifier>
pub fn params(self) -> Option<Params>
pub fn decorators(&self) -> Option<&HashSet<Decorator>>
pub fn t_spec(&self) -> Option<&TypeSpec>
pub fn is_const(&self) -> bool
pub const fn is_subr(&self) -> bool
pub fn vis(&self) -> &VisModifierSpec
Trait Implementations§
source§impl Locational for Signature
impl Locational for Signature
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.