Struct parol_runtime::lexer::location::Location
source · pub struct Location {
pub start_line: u32,
pub start_column: u32,
pub end_line: u32,
pub end_column: u32,
pub length: u32,
pub scanner_switch_pos: usize,
pub offset: usize,
pub file_name: Arc<PathBuf>,
}
Expand description
Common Location type
Fields§
§start_line: u32
Position information: line number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
start_column: u32
Position information: column number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
end_line: u32
Position information: line number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
end_column: u32
Position information: column number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
length: u32
Length of the matched input terminal A value of 0 indicates a virtual token, for instance an EOF token. Be careful: User tokens with length 0 are always invalid!!!
scanner_switch_pos: usize
Start position in the input stream as byte offset at last scanner switching.
offset: usize
Relative position from scanner_switch_pos as byte offset.
file_name: Arc<PathBuf>
The name of the input file
Trait Implementations§
source§impl Ord for Location
impl Ord for Location
source§impl PartialEq for Location
impl PartialEq for Location
source§impl PartialOrd for Location
impl PartialOrd for Location
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.