pub struct Location {
pub start_line: u32,
pub start_column: u32,
pub end_line: u32,
pub end_column: u32,
pub start: u32,
pub end: u32,
pub file_name: Arc<PathBuf>,
}Expand description
Common Location type This type is used to store the location of a token in the input text. The location is stored as line and column numbers, and as start and end positions in the input text.
We don’t use std::ops::Range
Fields§
§start_line: u32Position information: line number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
start_column: u32Position information: column number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
end_line: u32Position information: line number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
end_column: u32Position information: column number, starting by 1 A value of 0 indicates an invalid position, for instance for EOF token.
start: u32The start of the span of the token in the input text We use 0 also when dealing with artificial tokens introduced by the parser during error recovery.
end: u32The end of the span of the token in the input text The end is exclusive. It is the first character after the span. We use 0 also when dealing with artificial tokens introduced by the parser during error recovery.
file_name: Arc<PathBuf>The name of the input file
Implementations§
Trait Implementations§
Source§impl Ord for Location
impl Ord for Location
Source§impl PartialOrd for Location
impl PartialOrd for Location
impl 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.