diff --git a/crates/plotnik-lib/src/parser/core.rs b/crates/plotnik-lib/src/parser/core.rs index c68b5efd..48095b45 100644 --- a/crates/plotnik-lib/src/parser/core.rs +++ b/crates/plotnik-lib/src/parser/core.rs @@ -25,7 +25,7 @@ const DEFAULT_RECURSION_FUEL: u32 = 4096; /// represented as `SyntaxKind::Error` nodes in the tree itself. #[derive(Debug, Clone)] pub struct Parse { - pub(super) green: GreenNode, + pub(super) cst: GreenNode, pub(super) errors: Vec, } @@ -110,7 +110,7 @@ impl<'src> Parser<'src> { return Err(err); } Ok(Parse { - green: self.builder.finish(), + cst: self.builder.finish(), errors: self.errors, }) } diff --git a/crates/plotnik-lib/src/parser/mod.rs b/crates/plotnik-lib/src/parser/mod.rs index b76efb8b..6a762cea 100644 --- a/crates/plotnik-lib/src/parser/mod.rs +++ b/crates/plotnik-lib/src/parser/mod.rs @@ -73,14 +73,14 @@ pub struct Parse { impl Parse { #[allow(dead_code)] - pub fn green(&self) -> &rowan::GreenNode { - &self.inner.green + pub fn as_cst(&self) -> &rowan::GreenNode { + &self.inner.cst } /// Creates a typed view over the immutable green tree. /// This is cheap—SyntaxNode is a thin wrapper with parent pointers. pub fn syntax(&self) -> SyntaxNode { - SyntaxNode::new_root(self.inner.green.clone()) + SyntaxNode::new_root(self.inner.cst.clone()) } pub fn errors(&self) -> &[Diagnostic] {