Struct yash_syntax::source::Location
source · [−]Expand description
Position of a character in source code.
Fields
code: Rc<Code>
Code that contains the character.
index: usize
Character position in the code, counted from 0.
Characters are counted in the number of Unicode scalar values, not
bytes. That means the index
should be between 0 and
code.value.borrow().chars().count()
.
Implementations
Creates a dummy location.
The returned location has unknown source and the
given source code value. The start_line_number
and index
are 1.
This function is mainly for use in testing.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Location
impl !UnwindSafe for Location
Blanket Implementations
Mutably borrows from an owned value. Read more