Struct cranelift_isle::lexer::Pos
source · Expand description
A source position.
Fields§
§file: usize
This source position’s file.
Indexes into Lexer::filenames
early in the compiler pipeline, and
later into TypeEnv::filenames
once we get into semantic analysis.
offset: usize
This source position’s byte offset in the file.
line: usize
This source position’s line number in the file.
col: usize
This source position’s column number in the file.
Implementations§
source§impl Pos
impl Pos
sourcepub fn pretty_print(&self, filenames: &[Arc<str>]) -> String
pub fn pretty_print(&self, filenames: &[Arc<str>]) -> String
Print this source position as file.isle:12:34
.
sourcepub fn pretty_print_line(&self, filenames: &[Arc<str>]) -> String
pub fn pretty_print_line(&self, filenames: &[Arc<str>]) -> String
Print this source position as file.isle line 12
.
sourcepub fn pretty_print_with_filename(&self, filename: &str) -> String
pub fn pretty_print_with_filename(&self, filename: &str) -> String
As above for pretty_print
, but with the specific filename
already provided.
Trait Implementations§
source§impl Ord for Pos
impl Ord for Pos
source§impl PartialOrd<Pos> for Pos
impl PartialOrd<Pos> for Pos
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