#[repr(C)]pub struct pm_node {
pub type_: pm_node_type_t,
pub flags: pm_node_flags_t,
pub node_id: u32,
pub location: pm_location_t,
}Expand description
This is the base structure that represents a node in the syntax tree. It is embedded into every node type.
Fields§
§type_: pm_node_type_tThis represents the type of the node. It somewhat maps to the nodes that existed in the original grammar and ripper, but it is not a 1:1 mapping.
flags: pm_node_flags_tThis represents any flags on the node. Some are common to all nodes, and some are specific to the type of node.
node_id: u32The unique identifier for this node, which is deterministic based on the source. It is used to identify unique nodes across parses. Nodes created outside of parsing have no position in the source and can use 0, which no parsed node uses.
location: pm_location_tThis is the location of the node in the source. It is a range of bytes containing a start and an end.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for pm_node
impl RefUnwindSafe for pm_node
impl Send for pm_node
impl Sync for pm_node
impl Unpin for pm_node
impl UnsafeUnpin for pm_node
impl UnwindSafe for pm_node
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