Struct doomdooz_lib::types::Loc
source · Expand description
Representation of any location in the given input
Fields§
§begin: usizeBegin of the Loc range
end: usizeEnd of the Loc range
Implementations§
source§impl Loc
impl Loc
sourcepub fn with_begin(&self, begin: usize) -> Loc
pub fn with_begin(&self, begin: usize) -> Loc
Returns a new Loc with given begin and current end
sourcepub fn adjust_begin(&self, delta: i32) -> Loc
pub fn adjust_begin(&self, delta: i32) -> Loc
Adds given delta to begin
sourcepub fn adjust_end(&self, d: i32) -> Loc
pub fn adjust_end(&self, d: i32) -> Loc
Adds given delta to end
sourcepub fn resize(&self, new_size: usize) -> Loc
pub fn resize(&self, new_size: usize) -> Loc
Returns a new Loc with the same begin, but adjusted end,
so that its size is equal to given new_size
sourcepub fn source(&self, input: &DecodedInput) -> Option<String>
pub fn source(&self, input: &DecodedInput) -> Option<String>
Returns source code of the current Loc on a given Input