Struct mxmlextrema_as3parser::compilation_unit::Location
source · pub struct Location { /* private fields */ }
Expand description
Represents a source location. This location includes spanning lines and columns and the reference compilation unit.
Implementations§
source§impl Location
impl Location
sourcepub fn with_offsets(
compilation_unit: &Rc<CompilationUnit>,
first_offset: usize,
last_offset: usize,
) -> Self
pub fn with_offsets( compilation_unit: &Rc<CompilationUnit>, first_offset: usize, last_offset: usize, ) -> Self
Builds a location.
sourcepub fn with_offset(
compilation_unit: &Rc<CompilationUnit>,
offset: usize,
) -> Self
pub fn with_offset( compilation_unit: &Rc<CompilationUnit>, offset: usize, ) -> Self
Builds a location.
sourcepub fn combine_with(&self, other: Location) -> Self
pub fn combine_with(&self, other: Location) -> Self
Build a location by combining two locations. self
serves as the first location, while other
serves as the
last location.
sourcepub fn combine_with_start_of(&self, other: Location) -> Self
pub fn combine_with_start_of(&self, other: Location) -> Self
Build a location by combining two locations. self
serves as the first location, while the first column and first line
of other
serve as the last location.
sourcepub fn compilation_unit(&self) -> Rc<CompilationUnit>
pub fn compilation_unit(&self) -> Rc<CompilationUnit>
The compilation unit that this location belongs to.
sourcepub fn first_line_number(&self) -> usize
pub fn first_line_number(&self) -> usize
First line number, counted from one.
sourcepub fn last_line_number(&self) -> usize
pub fn last_line_number(&self) -> usize
Last line number, counted from one.
pub fn first_offset(&self) -> usize
pub fn last_offset(&self) -> usize
sourcepub fn first_column(&self) -> usize
pub fn first_column(&self) -> usize
Zero based first column of the location in code points.
sourcepub fn last_column(&self) -> usize
pub fn last_column(&self) -> usize
Zero based last column of the location in code points.
pub fn character_count(&self) -> usize
sourcepub fn line_break(&self, other: &Self) -> bool
pub fn line_break(&self, other: &Self) -> bool
Indicates whether a previous location and a next location have a line break in between.
sourcepub fn shift_until_eof(&self, count: usize) -> Location
pub fn shift_until_eof(&self, count: usize) -> Location
Shifts a count of characters off this location until end-of-file.
sourcepub fn shift_whitespace(&self, text: &str) -> Location
pub fn shift_whitespace(&self, text: &str) -> Location
Shifts the count of whitespace characters in a text off this location.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
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<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)