pub struct Parse {
pub syntax: SourceFile,
pub source_text: String,
pub source_map: SourceMap,
pub source_encoding: SourceEncoding,
pub decode_errors: Vec<DecodeDiagnostic>,
pub lex_errors: Vec<LexDiagnostic>,
pub errors: Vec<ParseError>,
}Expand description
Owned full-parse result for source text plus all parser-side diagnostics.
This is the main result type returned by parse_source, parse_bytes,
and parse_file. The typed MEL syntax tree is stored in Self::syntax,
while the original decoded text and source mapping remain available for
diagnostics and source slicing.
Fields§
§syntax: SourceFile§source_text: String§source_map: SourceMap§source_encoding: SourceEncoding§decode_errors: Vec<DecodeDiagnostic>§lex_errors: Vec<LexDiagnostic>§errors: Vec<ParseError>Implementations§
Source§impl Parse
impl Parse
pub fn source_view(&self) -> SourceView<'_>
pub fn source_range(&self, range: TextRange) -> Range<usize>
pub fn source_slice(&self, range: TextRange) -> &str
pub fn display_slice(&self, range: TextRange) -> &str
pub fn string_literal_contents(&self, range: TextRange) -> Option<&str>
Trait Implementations§
Source§fn from(value: SharedParse) -> Self
fn from(value: SharedParse) -> Self
Converts to this type from the input type.
impl Eq for Parse
impl StructuralPartialEq for Parse
Auto Trait Implementations§
impl Freeze for Parse
impl RefUnwindSafe for Parse
impl Send for Parse
impl Sync for Parse
impl Unpin for Parse
impl UnsafeUnpin for Parse
impl UnwindSafe for Parse
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