pub struct SyntaxTree { /* private fields */ }Expand description
A parsed GDScript file: the source text plus its tree and diagnostics.
Implementations§
Source§impl SyntaxTree
impl SyntaxTree
Sourcepub fn root(&self) -> SyntaxNode<'_>
pub fn root(&self) -> SyntaxNode<'_>
The outermost node, always SyntaxKind::SourceFile.
Sourcepub fn errors(&self) -> &[SyntaxError]
pub fn errors(&self) -> &[SyntaxError]
Diagnostics collected while lexing and parsing.
A non-empty list does not mean the tree is unusable — it is still
complete and lossless, with the unparseable regions wrapped in
SyntaxKind::Error nodes.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Whether parsing found any problems.
Sourcepub fn node(&self, id: NodeId) -> SyntaxNode<'_>
pub fn node(&self, id: NodeId) -> SyntaxNode<'_>
Resolve a node id obtained from this tree.
Trait Implementations§
Source§impl Clone for SyntaxTree
impl Clone for SyntaxTree
Source§fn clone(&self) -> SyntaxTree
fn clone(&self) -> SyntaxTree
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyntaxTree
impl Debug for SyntaxTree
Auto Trait Implementations§
impl Freeze for SyntaxTree
impl RefUnwindSafe for SyntaxTree
impl Send for SyntaxTree
impl Sync for SyntaxTree
impl Unpin for SyntaxTree
impl UnsafeUnpin for SyntaxTree
impl UnwindSafe for SyntaxTree
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