pub struct ParseResult<'arena, 'src> {
pub source: &'src str,
pub program: Program<'arena, 'src>,
pub comments: Vec<Comment<'src>>,
pub errors: Vec<ParseError>,
pub errors_truncated: bool,
pub source_map: SourceMap,
}Expand description
The result of parsing a PHP source string.
Fields§
§source: &'src strThe 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.
errors_truncated: booltrue when the error list was capped at the internal limit and further
errors were silently dropped. Callers that need a complete error list
(e.g. linters) should treat this as an incomplete result.
source_map: SourceMapPre-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.