pub struct AddExpressionNode {
pub parent: Option<NodeId>,
pub children: Vec<NodeId>,
pub operators: Vec<AddOp>,
pub begin_token: TokenId,
pub end_token: TokenId,
}Expand description
AST node for addExpression production
Fields§
§parent: Option<NodeId>Parent node (if any)
children: Vec<NodeId>Child nodes
operators: Vec<AddOp>Operators between children: operators[i] is between children[i] and children[i+1]
begin_token: TokenIdFirst token of this node
end_token: TokenIdLast token of this node
Implementations§
Source§impl AddExpressionNode
impl AddExpressionNode
Sourcepub fn right<'a>(&self, arena: &'a Arena) -> Option<&'a AstNode>
pub fn right<'a>(&self, arena: &'a Arena) -> Option<&'a AstNode>
Get the right operand (second child for binary case)
Sourcepub fn op(&self, index: usize) -> Option<AddOp>
pub fn op(&self, index: usize) -> Option<AddOp>
Get operator at index (between children[i] and children[i+1])
Sourcepub fn op_operand_pairs(&self) -> impl Iterator<Item = (AddOp, NodeId)> + '_
pub fn op_operand_pairs(&self) -> impl Iterator<Item = (AddOp, NodeId)> + '_
Iterator over (operator, operand) pairs after the first operand
Trait Implementations§
Source§impl Clone for AddExpressionNode
impl Clone for AddExpressionNode
Source§fn clone(&self) -> AddExpressionNode
fn clone(&self) -> AddExpressionNode
Returns a duplicate of the value. Read more
1.0.0 · 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 AddExpressionNode
impl RefUnwindSafe for AddExpressionNode
impl Send for AddExpressionNode
impl Sync for AddExpressionNode
impl Unpin for AddExpressionNode
impl UnsafeUnpin for AddExpressionNode
impl UnwindSafe for AddExpressionNode
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