Struct commands::tokenizer::SourceOffset
[−]
[src]
pub struct SourceOffset {
pub char: usize,
pub line: usize,
pub column: usize,
}A position within a body of text.
The SourceOffset tracks 2 different ways of locating the
position:
- The index of the character within the body of text.
- The column and line number of the character.
The SourceOffset is typically used as a pair of offsets
indicating the start and end of a range of text as used
by the SourceLocation.
Fields
char | The index of this character within the body of text. |
line | The line number on which this character may be found. |
column | The column on which this character may be found. |
Methods
impl SourceOffset
fn new(char: usize, line: usize, column: usize) -> SourceOffset
Construct a SourceOffset.