pub type SpannedStatement<'a, T> = Spanned<'a, Statement<'a, T>>;
Expand description

Statement with the associated code span.

Aliased Type§

struct SpannedStatement<'a, T> {
    pub extra: Statement<'a, T>,
    /* private fields */
}

Fields§

§extra: Statement<'a, T>

Extra information that can be embedded by the user.

Implementations§

source§

impl<Span, T> LocatedSpan<Span, T>

source

pub fn location_offset(&self) -> usize

The offset represents the position of the fragment relatively to the input of the parser. It starts at offset 0.

source

pub fn location_line(&self) -> u32

The line number of the fragment relatively to the input of the parser. It starts at line 1.

source

pub fn get_column(&self) -> usize

The column of the fragment start.

source

pub fn fragment(&self) -> &Span

The fragment that is spanned. The fragment represents a part of the input of the parser.

source

pub fn map_extra<U>(self, map_fn: impl FnOnce(T) -> U) -> LocatedSpan<Span, U>

Maps the extra field of this span using the provided closure.

source

pub fn map_fragment<U>( self, map_fn: impl FnOnce(Span) -> U ) -> LocatedSpan<U, T>

Maps the fragment field of this span using the provided closure.

source§

impl<Span: Copy, T> LocatedSpan<Span, T>

source

pub fn as_ref(&self) -> LocatedSpan<Span, &T>

Returns a copy of this span with borrowed extra field.

source

pub fn copy_with_extra<U>(&self, value: U) -> LocatedSpan<Span, U>

Copies this span with the provided extra field.

source

pub fn with_no_extra(&self) -> LocatedSpan<Span>

Removes extra field from this span.

Trait Implementations§

source§

impl<Span: Clone, T: Clone> Clone for LocatedSpan<Span, T>

source§

fn clone(&self) -> LocatedSpan<Span, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Span: Debug, T: Debug> Debug for LocatedSpan<Span, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> From<LocatedSpan<&'a str, T>> for LocatedSpan<&'a str, T>

source§

fn from(value: LocatedSpan<&'a str, T>) -> Self

Converts to this type from the input type.
source§

impl<Span: PartialEq, T> PartialEq<LocatedSpan<Span, T>> for LocatedSpan<Span, T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Span: Copy, T: Copy> Copy for LocatedSpan<Span, T>