pub struct NormalizeNode {
pub kind: String,
pub children: Vec<NormalizeNode>,
}Expand description
A node in a pattern AST subtree used by normalize_and_hash.
A leaf node has kind set and an empty children slice. For v0, language
adapters still emit kind-only pattern hints, so children is always empty
and the output is byte-identical to crate::fingerprint::fingerprint_node_kind.
§Examples
use sdivi_patterns::normalize::{NormalizeNode, normalize_and_hash};
// Leaf node: same digest as fingerprint_node_kind("try_expression")
let result = normalize_and_hash("try_expression", &[]);
assert_eq!(result.len(), 64);Fields§
§kind: StringThe tree-sitter node kind string.
children: Vec<NormalizeNode>Ordered children of this node.
Trait Implementations§
Source§impl Clone for NormalizeNode
impl Clone for NormalizeNode
Source§fn clone(&self) -> NormalizeNode
fn clone(&self) -> NormalizeNode
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 moreAuto Trait Implementations§
impl Freeze for NormalizeNode
impl RefUnwindSafe for NormalizeNode
impl Send for NormalizeNode
impl Sync for NormalizeNode
impl Unpin for NormalizeNode
impl UnsafeUnpin for NormalizeNode
impl UnwindSafe for NormalizeNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more