Struct ruby_prism::ParseResult
source · pub struct ParseResult<'pr> { /* private fields */ }
Expand description
The result of parsing a source string.
Implementations§
source§impl<'pr> ParseResult<'pr>
impl<'pr> ParseResult<'pr>
sourcepub fn frozen_string_literals(&self) -> bool
pub fn frozen_string_literals(&self) -> bool
Returns whether we found a frozen_string_literal
magic comment with a true value.
sourcepub fn as_slice(&self, location: &Location<'pr>) -> &'pr [u8] ⓘ
pub fn as_slice(&self, location: &Location<'pr>) -> &'pr [u8] ⓘ
Returns a slice of the source string that was parsed using the given location range.
Panics
Panics if start offset or end offset are not valid offsets from the root.
sourcepub fn errors(&self) -> Diagnostics<'_> ⓘ
pub fn errors(&self) -> Diagnostics<'_> ⓘ
Returns an iterator that can be used to iterate over the errors in the parse result.
sourcepub fn warnings(&self) -> Diagnostics<'_> ⓘ
pub fn warnings(&self) -> Diagnostics<'_> ⓘ
Returns an iterator that can be used to iterate over the warnings in the parse result.
sourcepub fn comments(&self) -> Comments<'_> ⓘ
pub fn comments(&self) -> Comments<'_> ⓘ
Returns an iterator that can be used to iterate over the comments in the parse result.
Trait Implementations§
source§impl<'pr> Debug for ParseResult<'pr>
impl<'pr> Debug for ParseResult<'pr>
Auto Trait Implementations§
impl<'pr> RefUnwindSafe for ParseResult<'pr>
impl<'pr> !Send for ParseResult<'pr>
impl<'pr> !Sync for ParseResult<'pr>
impl<'pr> Unpin for ParseResult<'pr>
impl<'pr> UnwindSafe for ParseResult<'pr>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more