pub struct NodeData {
pub main_token: u32,
pub lhs: u32,
pub rhs: u32,
}Expand description
Fixed-size node data (12 bytes total).
Each node in the SOA AST has:
- A tag (stored in separate tags array)
- A main_token (for span information)
- Two u32 slots (lhs and rhs) whose meaning depends on the tag
This matches Zig’s design: compact, cache-friendly, uniform size.
Fields§
§main_token: u32Primary token for this node.
Used for:
- Span information in error messages
- Operator tokens (for BinaryExpr, UnaryExpr)
- Keyword tokens (for if, while, etc.)
lhs: u32Left child or first data slot.
Interpretation depends on NodeTag - see NodeTag documentation. Common uses:
- Left operand in binary expressions
- Single child in unary expressions
- Index into extra_data for multi-child nodes
- Direct data storage (e.g., low 32 bits of u64)
rhs: u32Right child or second data slot.
Interpretation depends on NodeTag - see NodeTag documentation. Common uses:
- Right operand in binary expressions
- Index into extra_data for multi-child nodes
- Direct data storage (e.g., high 32 bits of u64)
- Flags and small enums
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeData
impl RefUnwindSafe for NodeData
impl Send for NodeData
impl Sync for NodeData
impl Unpin for NodeData
impl UnwindSafe for NodeData
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,
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].