Skip to main content

ParseResult

Struct ParseResult 

Source
pub struct ParseResult<'arena, 'src> {
    pub source: &'src str,
    pub program: Program<'arena, 'src>,
    pub comments: Vec<Comment<'src>>,
    pub errors: Vec<ParseError>,
    pub source_map: SourceMap,
}
Expand description

The result of parsing a PHP source string.

Fields§

§source: &'src str

The original source text. Useful for extracting text from spans via &result.source[span.start as usize..span.end as usize].

§program: Program<'arena, 'src>

The parsed AST. Always produced, even when errors are present.

§comments: Vec<Comment<'src>>

All comments found in the source, in source order. Comments are not attached to AST nodes; callers can map them by span.

§errors: Vec<ParseError>

Parse errors and diagnostics. Empty on a successful parse.

§source_map: SourceMap

Pre-computed line index for resolving byte offsets in Span to line/column positions. Use SourceMap::offset_to_line_col or SourceMap::span_to_line_col to convert.

Auto Trait Implementations§

§

impl<'arena, 'src> Freeze for ParseResult<'arena, 'src>

§

impl<'arena, 'src> !RefUnwindSafe for ParseResult<'arena, 'src>

§

impl<'arena, 'src> !Send for ParseResult<'arena, 'src>

§

impl<'arena, 'src> !Sync for ParseResult<'arena, 'src>

§

impl<'arena, 'src> Unpin for ParseResult<'arena, 'src>

§

impl<'arena, 'src> UnsafeUnpin for ParseResult<'arena, 'src>

§

impl<'arena, 'src> !UnwindSafe for ParseResult<'arena, 'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.