pub struct CssParse { /* private fields */ }Expand description
A utility struct for managing the result of a parser job
Implementations§
Source§impl CssParse
impl CssParse
pub fn new(root: CssSyntaxNode, diagnostics: Vec<ParseDiagnostic>) -> CssParse
Sourcepub fn syntax(&self) -> CssSyntaxNode
pub fn syntax(&self) -> CssSyntaxNode
The syntax node represented by this Parse result
use biome_css_syntax::CssSyntaxKind;
use biome_css_parser::CssParserOptions;
let parse = parse_css(r#""#, CssParserOptions::default());
let root_value = parse.tree().rules();
assert_eq!(root_value.syntax().kind(), CssSyntaxKind::CSS_RULE_LIST);
Sourcepub fn diagnostics(&self) -> &[ParseDiagnostic]
pub fn diagnostics(&self) -> &[ParseDiagnostic]
Get the diagnostics which occurred when parsing
Sourcepub fn into_diagnostics(self) -> Vec<ParseDiagnostic>
pub fn into_diagnostics(self) -> Vec<ParseDiagnostic>
Get the diagnostics which occurred when parsing
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true if the parser encountered some errors during the parsing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CssParse
impl RefUnwindSafe for CssParse
impl !Send for CssParse
impl !Sync for CssParse
impl Unpin for CssParse
impl UnwindSafe for CssParse
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