pub struct MultExprNode {
pub parent: Option<NodeId>,
pub children: Vec<NodeId>,
pub operators: Vec<MultExprOp>,
pub begin_token: TokenId,
pub end_token: TokenId,
}Expand description
AST node for multExpr production
Fields§
§parent: Option<NodeId>Parent node (if any)
children: Vec<NodeId>Child nodes
operators: Vec<MultExprOp>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 MultExprNode
impl MultExprNode
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<MultExprOp>
pub fn op(&self, index: usize) -> Option<MultExprOp>
Get operator at index (between children[i] and children[i+1])
Sourcepub fn first_op(&self) -> Option<MultExprOp>
pub fn first_op(&self) -> Option<MultExprOp>
Get first operator (for binary expressions)
Sourcepub fn op_operand_pairs(
&self,
) -> impl Iterator<Item = (MultExprOp, NodeId)> + '_
pub fn op_operand_pairs( &self, ) -> impl Iterator<Item = (MultExprOp, NodeId)> + '_
Iterator over (operator, operand) pairs after the first operand
Trait Implementations§
Source§impl Clone for MultExprNode
impl Clone for MultExprNode
Source§fn clone(&self) -> MultExprNode
fn clone(&self) -> MultExprNode
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 MultExprNode
impl RefUnwindSafe for MultExprNode
impl Send for MultExprNode
impl Sync for MultExprNode
impl Unpin for MultExprNode
impl UnsafeUnpin for MultExprNode
impl UnwindSafe for MultExprNode
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