Struct doomdooz_lib::types::ParserResult
source · pub struct ParserResult {
pub ast: Option<Box<Node, Global>>,
pub tokens: Vec<Token, Global>,
pub diagnostics: Vec<Diagnostic, Global>,
pub comments: Vec<Comment, Global>,
pub magic_comments: Vec<MagicComment, Global>,
pub input: DecodedInput,
}Expand description
Combination of all data that Parser can give you
Fields§
§ast: Option<Box<Node, Global>>Abstract Syntax Tree that was constructed from you code.
Contains None if the code gives no AST nodes
tokens: Vec<Token, Global>List of tokens returned by a Lexer and consumed by a Parser. Empty unless ParserOptions::record_tokens is set to true.
diagnostics: Vec<Diagnostic, Global>List of all diagnostics (errors and warings) that have been recorded during lexing and parsing
comments: Vec<Comment, Global>List of comments extracted from the source code.
magic_comments: Vec<MagicComment, Global>List of magic comments extracted from the source code.
input: DecodedInputInput that was used for parsing.
Note: this input is not necessary the same byte array that
you passed to Parser::parse. If encoding of the input is
not UTF-8 or ASCII-8BIT/BINARY Parser invokes decoder
that usually produces a different sequence of bytes.
Pass this data to Loc::source, otherwise you’ll get
incorrect source ranges.