Elements of the array.
(&self)
| 2094 | |
| 2095 | /// Elements of the array. |
| 2096 | pub fn elements(&self) -> Vec<CstNode> { |
| 2097 | self |
| 2098 | .0 |
| 2099 | .borrow() |
| 2100 | .value |
| 2101 | .iter() |
| 2102 | .filter(|child| match child { |
| 2103 | CstNode::Container(_) => true, |
| 2104 | CstNode::Leaf(leaf) => match leaf { |
| 2105 | CstLeafNode::BooleanLit(_) |
| 2106 | | CstLeafNode::NullKeyword(_) |
| 2107 | | CstLeafNode::NumberLit(_) |
| 2108 | | CstLeafNode::StringLit(_) |
| 2109 | | CstLeafNode::WordLit(_) => true, |
| 2110 | CstLeafNode::Token(_) | CstLeafNode::Whitespace(_) | CstLeafNode::Newline(_) | CstLeafNode::Comment(_) => { |
| 2111 | false |
| 2112 | } |
| 2113 | }, |
| 2114 | }) |
| 2115 | .cloned() |
| 2116 | .collect() |
| 2117 | } |
| 2118 | |
| 2119 | /// Appends an element to the end of the array. |
| 2120 | /// |