Struct erg_parser::ast::VarName
source · pub struct VarName(_);
Expand description
symbol as a left value
Implementations§
source§impl VarName
impl VarName
pub const fn new(symbol: Token) -> Self
pub const fn from_static(symbol: &'static str) -> Self
pub fn from_str(symbol: Str) -> Self
pub fn from_str_and_line(symbol: Str, line: u32) -> Self
pub fn is_const(&self) -> bool
pub fn is_procedural(&self) -> bool
pub fn is_raw(&self) -> bool
pub const fn token(&self) -> &Token
pub fn into_token(self) -> Token
sourcepub fn trim_end_proc_mark(&mut self)
pub fn trim_end_proc_mark(&mut self)
Remove !
from the end of the identifier.
Procedures defined in d.er
automatically register the name without !
as py_name
.
This method is for undoing it (e.g. pylyzer-mode)
Trait Implementations§
source§impl Locational for VarName
impl Locational for VarName
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.fn ln_begin(&self) -> Option<u32>
fn ln_end(&self) -> Option<u32>
fn col_begin(&self) -> Option<u32>
fn col_end(&self) -> Option<u32>
source§impl PartialEq<VarName> for VarName
impl PartialEq<VarName> for VarName
impl Eq for VarName
impl StructuralEq for VarName
Auto Trait Implementations§
impl RefUnwindSafe for VarName
impl !Send for VarName
impl !Sync for VarName
impl Unpin for VarName
impl UnwindSafe for VarName
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