Enum solang_parser::pt::Loc
source · pub enum Loc {
Builtin,
CommandLine,
Implicit,
Codegen,
File(usize, usize, usize),
}Expand description
A code location.
Variants§
Builtin
Builtin
CommandLine
Command line
Implicit
Implicit
Codegen
Codegen
File(usize, usize, usize)
The file number, start offset and end offset in bytes of the source file.
Implementations§
source§impl Loc
impl Loc
sourcepub fn begin_range(&self) -> Self
pub fn begin_range(&self) -> Self
Returns this location’s beginning range.
sourcepub fn try_file_no(&self) -> Option<usize>
pub fn try_file_no(&self) -> Option<usize>
Returns this location’s file number if it is a file, otherwise None.
sourcepub fn use_start_from(&mut self, other: &Loc)
pub fn use_start_from(&mut self, other: &Loc)
sourcepub fn use_end_from(&mut self, other: &Loc)
pub fn use_end_from(&mut self, other: &Loc)
sourcepub fn with_start_from(self, other: &Self) -> Self
pub fn with_start_from(self, other: &Self) -> Self
sourcepub fn with_end_from(self, other: &Self) -> Self
pub fn with_end_from(self, other: &Self) -> Self
sourcepub fn with_start(self, start: usize) -> Self
pub fn with_start(self, start: usize) -> Self
Trait Implementations§
source§impl OptionalCodeLocation for Loc
impl OptionalCodeLocation for Loc
source§impl Ord for Loc
impl Ord for Loc
source§impl PartialOrd<Loc> for Loc
impl PartialOrd<Loc> for Loc
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more